fix: playlist short path not rewritten

This commit is contained in:
Ante Brähler
2024-12-23 00:57:25 +01:00
parent b151a406b3
commit edcbbd8789
2 changed files with 25 additions and 15 deletions

View File

@@ -125,13 +125,25 @@ function VideoPlayer({ channel, syncEnabled }: VideoPlayerProps) {
});
let timeMissingErrorShown = false;
hls.on(Hls.Events.FRAG_LOADED, (_event, data) => {
const now = new Date().getTime();
const newFrag = data.frag;
if(!newFrag.programDateTime) return;
if(!newFrag.programDateTime) {
if(!timeMissingErrorShown) {
addToast({
type: 'error',
title: 'Synchronization Error',
message: `Playback can't be synchonized for this channel in ${channel.mode}. Change this channel to restream mode and try again.`,
duration: 5000,
});
console.warn("No program date time found in fragment. Cannot synchronize.");
timeMissingErrorShown = true;
}
return;
}
const timeDiff = (now - newFrag.programDateTime) / 1000;
const videoDiff = newFrag.end - video.currentTime;
//console.log("Time Diff: ", timeDiff, "Video Diff: ", videoDiff);