Fix jumpToTime

Fixes #801
This commit is contained in:
DC
2016-08-22 00:20:15 -07:00
parent 0ee92fb632
commit 24ac5af5b4
2 changed files with 7 additions and 1 deletions

View File

@@ -93,6 +93,10 @@ module.exports = class PlaybackController {
// Skip (aka seek) to a specific point, in seconds // Skip (aka seek) to a specific point, in seconds
skipTo (time) { skipTo (time) {
if (!Number.isFinite(time)) {
console.error('Tried to skip to a non-finite time ' + time)
return console.trace()
}
if (isCasting(this.state)) Cast.seek(time) if (isCasting(this.state)) Cast.seek(time)
else this.state.playing.jumpToTime = time else this.state.playing.jumpToTime = time
} }

View File

@@ -396,7 +396,9 @@ function stop () {
function stoppedCasting () { function stoppedCasting () {
state.playing.location = 'local' state.playing.location = 'local'
state.playing.jumpToTime = state.playing.currentTime state.playing.jumpToTime = Number.isFinite(state.playing.currentTime)
? state.playing.currentTime
: 0
update() update()
} }