fix: fixing hls videos

This commit is contained in:
Chubby Granny Chaser
2025-11-30 03:43:22 +00:00
parent e9de8264e2
commit 0ad1ebd6a2

View File

@@ -23,7 +23,7 @@ export function useHlsVideo(
const isHls = videoType === "application/x-mpegURL"; const isHls = videoType === "application/x-mpegURL";
if (!isHls) { if (!isHls) {
return; return undefined;
} }
if (Hls.isSupported()) { if (Hls.isSupported()) {
@@ -45,7 +45,7 @@ export function useHlsVideo(
} }
}); });
hls.on(Hls.Events.ERROR, (event, data) => { hls.on(Hls.Events.ERROR, (_event, data) => {
if (data.fatal) { if (data.fatal) {
switch (data.type) { switch (data.type) {
case Hls.ErrorTypes.NETWORK_ERROR: case Hls.ErrorTypes.NETWORK_ERROR:
@@ -82,6 +82,7 @@ export function useHlsVideo(
}; };
} else { } else {
logger.warn("HLS playback is not supported in this browser"); logger.warn("HLS playback is not supported in this browser");
return undefined;
} }
}, [videoRef, videoSrc, videoType, autoplay, muted, loop]); }, [videoRef, videoSrc, videoType, autoplay, muted, loop]);