Commit 9d9947e3 authored by christianrhansen's avatar christianrhansen

jump to timestamp works

parent aa9617bf
<template lang="pug">
full-screen
back-button(slot="backButton")
template(slot="form-title") Annotations Table
template(slot="form-title") Annotations Table {{ baseSelector() }}
div(style="width: 300px;")
video-player(v-if="video", :src="video.body.source.id", @ready="playerReady($event)", @time="onPlayerTime($event)")
......@@ -20,8 +20,10 @@
data () {
const _this = this
return {
playerTime: 0.0,
query: undefined,
video: undefined,
player: undefined,
timeline: undefined,
metadata: undefined,
config: {
......@@ -77,8 +79,26 @@
}
},
methods: {
onStart (val) {
alert(DateTime.fromISO(val))
playerReady (player) {
this.player = player
},
onPlayerTime (seconds) {
this.playerTime = seconds
console.log(seconds)
},
baseSelector () {
if (!this.video) return DateTime.local().toISO()
return DateTime.fromISO(this.video.target.selector.value, { setZone: true })
.plus(this.playerTime * 1000)
.toISO()
},
onStart (selector) {
// alert(DateTime.fromISO(selector))
const millis = DateTime.fromISO(selector, { setZone: true }).toMillis() -
DateTime.fromISO(this.video.target.selector.value, { setZone: true }).toMillis()
const targetMillis = millis * 0.001
if (this.playerTime !== targetMillis) this.player.currentTime(targetMillis)
console.log(targetMillis)
},
async getVideo () {
this.video = await this.$store.dispatch('annotations/get', this.$route.params.id)
......
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