diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js index 1d7d055..14aafe9 100644 --- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js +++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js @@ -6,9 +6,10 @@ import { PlayButton, PlayerTime, VolumeControl } from 'app/views/viewer/nav/view class FullscreenVideo extends Component { state = { - duration: 1.0, + duration: 0.0, percent: 0.0, seconds: 0.0, + seek: 0.0, } constructor(props) { super(props) @@ -17,6 +18,13 @@ class FullscreenVideo extends Component { this.handleTimeUpdate = this.handleTimeUpdate.bind(this) this.handleEnd = this.handleEnd.bind(this) } + componentDidUpdate(prevProps) { + if (Math.abs(this.props.play_ts - prevProps.play_ts) > 2.0) { + // handle seek + const seek = this.props.play_ts - this.props.element.start_ts + this.setState({ seek }) + } + } handlePlay() { } @@ -51,6 +59,7 @@ class FullscreenVideo extends Component { paused={!playing} autoplay={true} muted={true} + seek={this.state.seek} responsive={true} controls={false} byline={false} @@ -77,6 +86,7 @@ class FullscreenVideo extends Component { const mapStateToProps = state => ({ viewer: state.viewer, + play_ts: state.audio.play_ts, playing: state.audio.playing, volume: state.audio.volume, }) |
