improvements

This commit is contained in:
2025-12-21 11:02:31 +01:00
parent acc819015f
commit b683938975
14 changed files with 835 additions and 132 deletions

View File

@@ -308,10 +308,35 @@ export default function StreamingPlayer({
errorMsg = 'Network error while loading video';
break;
case error.MEDIA_ERR_DECODE:
errorMsg = 'Video decoding error';
errorMsg = 'Video decoding error - codec not supported';
// If HLS is available, try switching to it
if (hlsUrl && !hlsRef.current) {
console.log('[Video] Decode error detected, switching to HLS transcoding...');
// Force HLS playback
const hls = new Hls({
enableWorker: true,
lowLatencyMode: false,
});
hls.loadSource(hlsUrl);
hls.attachMedia(video);
hlsRef.current = hls;
video.play().catch(console.error);
}
break;
case error.MEDIA_ERR_SRC_NOT_SUPPORTED:
errorMsg = 'Video format not supported';
// If HLS is available, try switching to it
if (hlsUrl && !hlsRef.current) {
console.log('[Video] Format not supported, switching to HLS transcoding...');
const hls = new Hls({
enableWorker: true,
lowLatencyMode: false,
});
hls.loadSource(hlsUrl);
hls.attachMedia(video);
hlsRef.current = hls;
video.play().catch(console.error);
}
break;
}
console.error('[Video] Error:', errorMsg, error);