mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-13 22:55:26 +03:00
Fix MSE playback rate logic
This commit is contained in:
parent
8c23ede683
commit
5ee5b7a5a0
@ -506,19 +506,17 @@ function MSEPlayer({
|
|||||||
|
|
||||||
// if we're above our rolling average threshold or have > 3 seconds of
|
// if we're above our rolling average threshold or have > 3 seconds of
|
||||||
// buffered data and we're playing, we may have drifted from actual live
|
// buffered data and we're playing, we may have drifted from actual live
|
||||||
// time, so increase playback rate to compensate - non safari/ios only
|
// time
|
||||||
if (
|
if (videoRef.current && isPlaying && playbackEnabled) {
|
||||||
videoRef.current &&
|
if (
|
||||||
isPlaying &&
|
(isSafari || isIOS) &&
|
||||||
playbackEnabled &&
|
bufferTime > 3 &&
|
||||||
Date.now() - lastJumpTimeRef.current > BUFFERING_COOLDOWN_TIMEOUT
|
Date.now() - lastJumpTimeRef.current > BUFFERING_COOLDOWN_TIMEOUT
|
||||||
) {
|
) {
|
||||||
// Jump to live on Safari/iOS due to a change of playback rate causing re-buffering
|
// Jump to live on Safari/iOS due to a change of playback rate causing re-buffering
|
||||||
if (isSafari || isIOS) {
|
jumpToLive();
|
||||||
if (bufferTime > 3) {
|
|
||||||
jumpToLive();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
// increase/decrease playback rate to compensate - non Safari/iOS only
|
||||||
videoRef.current.playbackRate = playbackRate;
|
videoRef.current.playbackRate = playbackRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user