|
|
@ -28,10 +28,13 @@ const Player = () => { |
|
|
|
'Time required to seek (seconds): ', diffSecondsRequiredToSeekRunningPlayer); |
|
|
|
'Time required to seek (seconds): ', diffSecondsRequiredToSeekRunningPlayer); |
|
|
|
|
|
|
|
|
|
|
|
if (Math.abs(diff) > diffSecondsRequiredToSeekRunningPlayer) { |
|
|
|
if (Math.abs(diff) > diffSecondsRequiredToSeekRunningPlayer) { |
|
|
|
if (timesSeeked < maxTimesSeekAllow) { |
|
|
|
if (roomRunning.speedFactor != 1 || timesSeeked < maxTimesSeekAllow) { |
|
|
|
player.current.currentTime = targetTime; |
|
|
|
player.current.currentTime = targetTime; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
player.current.playbackRate = Math.max(Math.min(4.0, roomRunning.speedFactor), 0.25); |
|
|
|
|
|
|
|
|
|
|
|
setTimesSeeked(timesSeeked + 1); |
|
|
|
setTimesSeeked(timesSeeked + 1); |
|
|
|
console.log('SEEKED', 'The running player time was seeked, times seeked: ' + timesSeeked); |
|
|
|
console.log('SEEKED', 'The running player time was seeked, times seeked in total: ' + timesSeeked); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.warn('The running player is off, but we\'ve changed the time ' + |
|
|
|
console.warn('The running player is off, but we\'ve changed the time ' + |
|
|
|
'too often, skipping synchronizing the player.'); |
|
|
|
'too often, skipping synchronizing the player.'); |
|
|
|