Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
globals: {
appVersion: true,
isTesting: true,
PLYR_ICONS: true,
},
extends: [
'@nextcloud',
Expand Down
1 change: 0 additions & 1 deletion img/plyr.svg

This file was deleted.

16 changes: 8 additions & 8 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/components/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<script>
import Vue from 'vue'
import VuePlyr from 'vue-plyr'
import { generateFilePath } from '@nextcloud/router'

const liveExt = ['jpg', 'jpeg', 'png']
const liveExtRegex = new RegExp(`\\.(${liveExt.join('|')})$`, 'i')
Expand Down Expand Up @@ -81,7 +80,7 @@ export default {
options() {
return {
controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'fullscreen'],
iconUrl: generateFilePath('viewer', 'img', 'plyr.svg'),
loadSprite: false,
}
},
},
Expand Down
7 changes: 7 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ const ViewerRoot = document.createElement('div')
ViewerRoot.id = 'viewer'
document.body.appendChild(ViewerRoot)

// Put controls for video viewer
// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system
const VideoControls = document.createElement('div')
VideoControls.innerHTML = PLYR_ICONS
VideoControls.style.display = 'none'
document.body.appendChild(VideoControls)

// Init vue
export default new Vue({
el: '#viewer',
Expand Down
8 changes: 7 additions & 1 deletion webpack.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const fs = require('fs')
const path = require('path')
const { merge } = require('webpack-merge')
const webpack = require('webpack')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')

const isTesting = !!process.env.TESTING
const plyrIcons = fs.readFileSync(path.join('node_modules', 'plyr', 'dist', 'plyr.svg'), { encoding: 'utf8' })

const config = {
module: {
Expand All @@ -27,7 +30,10 @@ const config = {
],
},
plugins: [
new webpack.DefinePlugin({ isTesting }),
new webpack.DefinePlugin({
isTesting,
PLYR_ICONS: JSON.stringify(plyrIcons),
}),
],
}

Expand Down