From 948da5caeff1a0ae9990e6ddb2fbc37f8d0d04ae Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 5 Nov 2020 15:16:33 +0100 Subject: fixing scrubber --- .../annotationForms/annotationForm.video.js | 8 ++++ .../components.fullscreen/fullscreen.video.js | 3 +- .../player/components.inline/inline.video.js | 43 ++++++++++++++++------ .../player/components.media/video.scrubber.js | 7 ++-- .../app/views/viewer/player/player.transcript.css | 4 ++ 5 files changed, 50 insertions(+), 15 deletions(-) (limited to 'animism-align/frontend/app') diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js index f634faa..56bb4ab 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js @@ -48,6 +48,14 @@ export const AnnotationFormVideo = ({ annotation, media, handleSettingsSelect, h checked={annotation.settings.unmuted} onChange={handleSettingsSelect} /> + {annotation.settings.inline && ( + + )} {annotation.settings.inline && ( { + this.setState({ width }) + }).catch(error => { + }) + } handlePlay() { this.setState({ ready: true }) } @@ -68,17 +76,30 @@ export class MediaVideo extends Component { style.opacity = ready ? 1.0 : 0.0 return (
-
- +
+
+ +
+ {this.state.width && ( +
onAnnotationClick(e, paragraph, annotation)} + >{SpeakerIcon}
+ )}
diff --git a/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js b/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js index c236f81..48250c7 100644 --- a/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js +++ b/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js @@ -57,7 +57,7 @@ class VideoScrubber extends Component { // onScrub({ seek: video_seek, - seconds: video_seek, + seconds: seconds, scrubbing, }) } @@ -82,10 +82,11 @@ class VideoScrubber extends Component { this.setState({ hovering: false }) } render() { - const { playing, volume, timing, video_start_ts, duration } = this.props + const { playing, start_ts, play_ts, volume, timing, video_start_ts, duration } = this.props const { hovering, showing } = this.state // remove video start offset from timing - const player_ts = timing.seconds - video_start_ts + console.log(start_ts, play_ts) + const player_ts = play_ts - start_ts // compute percent from the length of the fullscreen element const percent = clamp(player_ts / duration, 0, 1) // display timestamp from the fullscreen element too diff --git a/animism-align/frontend/app/views/viewer/player/player.transcript.css b/animism-align/frontend/app/views/viewer/player/player.transcript.css index 3a8f61c..e5a323c 100644 --- a/animism-align/frontend/app/views/viewer/player/player.transcript.css +++ b/animism-align/frontend/app/views/viewer/player/player.transcript.css @@ -245,6 +245,10 @@ padding: 1rem 0; } +.player-transcript .media.video .videoContainer { + position: relative; +} + .player-transcript .media.video .speaker-icon, .player-transcript .media.image .speaker-icon { bottom: 0; -- cgit v1.2.3-70-g09d2