Correction du player.

This commit is contained in:
Johnnybegood90
2026-03-11 18:41:40 +01:00
parent df58fd88bf
commit 886b42173c
+11 -3
View File
@@ -1247,12 +1247,20 @@ function openPip(channelName, programTitle) {
} }
if (Hls.isSupported()) { if (Hls.isSupported()) {
hlsInstance = new Hls({ enableWorker: true }); hlsInstance = new Hls({ enableWorker: false, debug: false });
hlsInstance.loadSource(url); hlsInstance.loadSource(url);
hlsInstance.attachMedia(video); hlsInstance.attachMedia(video);
hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => video.play().catch(() => {})); hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => {
console.log('[PiP] Manifest parsed, lecture...');
video.play().catch(e => console.warn('[PiP] play() refusé:', e));
});
hlsInstance.on(Hls.Events.ERROR, (e, data) => { hlsInstance.on(Hls.Events.ERROR, (e, data) => {
if (data.fatal) { err.style.display = 'block'; err.textContent = '⚠ Erreur de lecture du stream'; } console.error('[PiP] HLS error:', data.type, data.details, data.fatal, data.response);
if (data.fatal) {
const detail = data.response ? ` (HTTP ${data.response.code})` : ` (${data.details})`;
err.style.display = 'block';
err.textContent = '⚠ Erreur de lecture du stream' + detail;
}
}); });
} else if (video.canPlayType('application/vnd.apple.mpegurl')) { } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
// Safari natif HLS // Safari natif HLS