Merge pull request #1812 from dsernst/scrub-preview

Adds Youtube-style Scrubbing preview
This commit is contained in:
Julen Garcia Leunda
2020-10-20 17:31:43 +02:00
committed by GitHub
3 changed files with 83 additions and 0 deletions

View File

@@ -158,6 +158,20 @@ module.exports = class PlaybackController {
else this.state.playing.jumpToTime = time
}
// Show video preview
preview (x) {
if (!Number.isFinite(x)) {
console.error('Tried to preview a non-finite position ' + x)
return console.trace()
}
this.state.playing.previewXCoord = x
}
// Hide video preview
clearPreview () {
this.state.playing.previewXCoord = null
}
// Change playback speed. 1 = faster, -1 = slower
// Playback speed ranges from 16 (fast forward) to 1 (normal playback)
// to 0.25 (quarter-speed playback), then goes to -0.25, -0.5, -1, -2, etc