Commit 5b47e464 authored by christianrhansen's avatar christianrhansen

fixed broken player on piecemaker videos

parent 054a6405
Pipeline #56435 passed with stage
in 6 minutes and 54 seconds
......@@ -4,9 +4,10 @@
q-window-resize-observable(@resize="resizeMedia")
template(v-if="display")
media-player(
v-if="video",
:class="{ hidePlayer: !showPlayer }",
ref='videoPlayer',
:annotation="video || fauxMedia",
:annotation="video",
@ready="handlePlayerReady",
@play="handlePlayerPlaying",
@canplay:once="onCanPlay",
......@@ -39,19 +40,6 @@
showPlayer: false
}
},
computed: {
fauxMedia () {
return {
body: {
type: 'Video',
purpose: 'linking',
source: {
id: this.cell ? this.cell.source._value.content : undefined
}
}
}
}
},
watch: {
visible (val) {
if (!val && this.player) {
......@@ -65,15 +53,16 @@
}
},
async mounted () {
// if (this.cell && this.cell.data.id) {
if (this.cell && this.cell.id && this.cell.source._value.id) {
// this.video = await this.$store.dispatch('annotations/get', this.cell.source.id)
this.video = await this.$store.dispatch('annotations/get', this.cell.source._value.id)
if (this.video) {
this.videoTime = DateTime.fromMillis(this.video.target.selector._valueMillis)
this.contextTime = this.videoTime
}
}
else {
this.fauxMedia()
}
if (this.display) {
if (!this.cell.source.start) this.showPlayer = true
else {
......@@ -97,6 +86,17 @@
}
},
methods: {
fauxMedia () {
this.video = {
body: {
type: 'Video',
purpose: 'linking',
source: {
id: this.cell ? this.cell.source._value.content : undefined
}
}
}
},
onCanPlay () {
if (this.cell && this.cell.source._value.start) {
if (this.player) {
......
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