Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted: function() {
if (!(this.vimeoId || this.videoSrc)) {
throw new Error('You must pass in a "vimeoId" or a "videoSrc"')
}
if (this.vimeoId) {
const player = new VimeoPlayer('vimeo-player')
player.ready().then(() => {
player.play()
})
// TODO: Instead of emitting completed, requires end screen UI.
// Currently a stop gap to provide Intro support.
player.on('ended', () => this.$emit('completed'))
} else if (this.videoSrc) {
new Plyr(this.$refs['player'], { captions: {active: true } })
}
}
}