summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-16 17:53:51 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-16 17:53:51 +0200
commit017a000e6490ef7156f5562310321c506fcd0eb8 (patch)
tree3f90553a8da5abf44547905c1a7a378969c982a8
parentde798073fd1e97c68572338169d852ae43d532df (diff)
opening still skips to video
-rw-r--r--animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js12
-rw-r--r--animism-align/frontend/app/views/viewer/player/player.transcript.js10
2 files changed, 20 insertions, 2 deletions
diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js
index a4d952d..28f7e79 100644
--- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js
+++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import { CURTAIN_COLOR_SELECT_OPTIONS } from 'app/constants'
-import { Select, Checkbox } from 'app/common'
+import { Select, Checkbox, TextInput } from 'app/common'
import { AnnotationFormFullscreen } from './annotationForm.utility'
export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect, handleSettingsChange }) => {
@@ -55,6 +55,16 @@ export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect, h
onChange={handleSettingsSelect}
/>
+ <TextInput
+ title="Override start time"
+ name="override_start_ts"
+ className="number"
+ placeholder="0:00"
+ data={annotation.settings}
+ onChange={handleSettingsChange}
+ autoComplete="off"
+ />
+
{(annotation.settings.fullscreen && !annotation.settings.inline) && (
<AnnotationFormFullscreen
annotation={annotation}
diff --git a/animism-align/frontend/app/views/viewer/player/player.transcript.js b/animism-align/frontend/app/views/viewer/player/player.transcript.js
index 9048227..0d0a636 100644
--- a/animism-align/frontend/app/views/viewer/player/player.transcript.js
+++ b/animism-align/frontend/app/views/viewer/player/player.transcript.js
@@ -4,6 +4,7 @@ import React, { Component } from 'react'
import { connect } from 'react-redux'
import actions from 'app/actions'
+import { timestampToSeconds } from 'app/utils'
import ParagraphList from 'app/views/paragraph/components/paragraph.list'
import { inlineComponents } from './components.inline'
@@ -29,7 +30,14 @@ class PlayerTranscript extends Component {
handleAnnotationClick(e, paragraph, annotation) {
// console.log(annotation)
- actions.audio.seek(paragraph.start_ts)
+ if (annotation.settings.override_start_ts) {
+ const ts = timestampToSeconds(annotation.settings.override_start_ts)
+ if (ts) {
+ actions.audio.seek(ts)
+ }
+ } else {
+ actions.audio.seek(paragraph.start_ts)
+ }
actions.audio.play()
}