hls: fix delay when window is minimized (#3759) (#3772)

This commit is contained in:
Alessandro Ros 2024-09-15 22:53:04 +02:00 committed by GitHub
parent 783fede2cb
commit 337d3d04ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,6 +104,12 @@ const loadStream = () => {
video.play();
});
// when the video is resumed after a manual or forced pause
// (i.e. when the window is minimized), restore live streaming.
video.onplay = () => {
video.currentTime = hls.liveSyncPosition;
};
hls.attachMedia(video);
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {