Skip to content

Commit

Permalink
hls: fix delay when window is minimized (#3759)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Sep 15, 2024
1 parent 471019f commit 3a01f7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/servers/hls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@
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')) {
Expand Down

0 comments on commit 3a01f7a

Please sign in to comment.