Commit 9ff976f0 authored by Anton's avatar Anton

Add audio capability to VideoPlayer

parent 1d925b20
Pipeline #14190 passed with stage
in 23 seconds
......@@ -3,6 +3,7 @@
ref="videoPlayer",
:options="playerOptions",
:playsinline="true",
:audio="isAudio",
customEventName="customstatechangedeventname",
@play="onPlayerEvent('play', $event)",
@pause="onPlayerEvent('pause', $event)",
......@@ -42,6 +43,7 @@
'vjs-big-play-centered': true,
'vjs-betweenus': process.env.FEATURE_BETWEENUS
},
isAudio: undefined,
playerOptions: {
fluid: true,
autoplay: this.autoplay,
......@@ -104,6 +106,9 @@
async getSource (src, annotation = undefined) {
if (!src && !annotation) return
this.type = guessType(src || annotation.body.source.id)
this.isAudio = this.type.substr(0, 6) === 'audio/'
// FIXME: fix m4a mime type hack
if (this.type === 'audio/m4a') this.type = 'audio/mp4'
if (this.type === 'video/youtube') {
this.playerOptions.techOrder = ['youtube']
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment