From 948da5caeff1a0ae9990e6ddb2fbc37f8d0d04ae Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 5 Nov 2020 15:16:33 +0100 Subject: fixing scrubber --- .../player/components.inline/inline.video.js | 43 ++++++++++++++++------ 1 file changed, 32 insertions(+), 11 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/player/components.inline') diff --git a/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js b/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js index f831078..d6de779 100644 --- a/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js +++ b/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js @@ -8,12 +8,20 @@ import { posterURL } from 'app/utils/annotation.utils' export class MediaVideo extends Component { state = { + width: 0, ready: false, } constructor(props) { super(props) + this.handleReady = this.handleReady.bind(this) this.handlePlay = this.handlePlay.bind(this) } + handleReady(player) { + player.getVideoWidth().then(width => { + 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}
+ )}
-- cgit v1.2.3-70-g09d2