summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js')
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js10
1 files changed, 5 insertions, 5 deletions
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 884b5e2..01255f6 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
@@ -43,13 +43,13 @@ class VideoScrubber extends Component {
this.setState({ showing: false })
}
scrub(x, scrubbing) {
- const { timing, start_ts, onScrub } = this.props
+ const { timing, start_ts, onScrub, duration } = this.props
const bounds = this.scrubberRef.current.getBoundingClientRect()
const percent = clamp((x - bounds.left) / bounds.width, 0, 1)
- const seconds = percent * timing.duration
+ const seconds = percent * duration
actions.audio.seek(start_ts + seconds)
onScrub({
- seek: seconds,
+ seek: seconds % timing.duration,
percent, seconds, scrubbing
})
}
@@ -74,9 +74,9 @@ class VideoScrubber extends Component {
this.setState({ hovering: false })
}
render() {
- const { playing, volume, timing } = this.props
+ const { playing, volume, timing, duration } = this.props
const { hovering, showing } = this.state
- const timestampText = timestamp(clamp(timing.seconds, 0, timing.duration))
+ const timestampText = timestamp(clamp(timing.seconds, 0, duration))
const className = (hovering || showing) ? 'video-scrubber show' : 'video-scrubber'
return (
<div className={className}>