Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
// initiate video player
this.player = new Plyr(this.$refs.fmVideo);
// load source
this.player.source = {
type: 'video',
title: this.videoFile.filename,
sources: [{
src: `${this.$store.getters['fm/settings/baseUrl']}stream-file?disk=${this.selectedDisk}&path=${encodeURIComponent(this.videoFile.path)}`,
type: `audio/${this.videoFile.extension}`,
}],
};
},
beforeDestroy() {
mounted () {
// eslint-disable-next-line
new Plyr('audio', {
controls: this.options
})
}
}
this.$nextTick(() => {
this.player = new Plyr(this.$refs.player, {
title: this.file.name,
ratio: '16:9',
controls: [
'play-large', // The large play button in the center
'restart', // Restart playback
'play', // Play/pause playback
'progress', // The progress bar and scrubber for playback and buffering
'current-time', // The current time of playback
'duration', // The full duration of the media
'mute', // Toggle mute
'volume', // Volume control
'captions', // Toggle captions
'settings', // Settings menu
'pip', // Picture-in-picture (currently Safari only)
'airplay', // Airplay (currently Safari only)
'fullscreen', // Toggle fullscreen
let t = setInterval(() => {
let item = document.querySelector('[data-player]')
if (item) {
let plr = this.player.item = new Plyr(item, options)
// status
plr.on('playing', (e) => {
this.player.playing = true
})
plr.on('pause', (e) => {
this.player.playing = false
})
// fs
plr.on('enterfullscreen', (e) => {
this.player.fs = true
document.querySelector('[data-plyr="fullscreen"]').blur()
})
plr.on('exitfullscreen', (e) => {
this.player.fs = false
mounted () {
this.player = new Plyr(this.$el.firstChild, this.opts)
this.$emit('player', this.player)
this.emit.forEach(element => {
this.player.on(element, this.emitPlayerEvent)
})
},
beforeDestroy () {
function setupPlyr(el) {
let player = new Plyr(el, {
debug: !IS_PRODUCTION,
controls:
['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions']
,
fullscreen: {
enabled: false
},
storage: {
enabled: true,
key: 'tana'
}
});
}
function setupPlyr(el) {
let player = new Plyr(el, {
debug: !IS_PRODUCTION,
controls:
['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions']
,
fullscreen: {
enabled: false
},
storage: {
enabled: true,
key: 'tana'
}
});
}