From 886b42173c01a43cad73112ab9c4af89c91c4bae Mon Sep 17 00:00:00 2001 From: Johnnybegood90 Date: Wed, 11 Mar 2026 18:41:40 +0100 Subject: [PATCH] Correction du player. --- index.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 07e3da0..3342197 100644 --- a/index.php +++ b/index.php @@ -1247,12 +1247,20 @@ function openPip(channelName, programTitle) { } if (Hls.isSupported()) { - hlsInstance = new Hls({ enableWorker: true }); + hlsInstance = new Hls({ enableWorker: false, debug: false }); hlsInstance.loadSource(url); 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) => { - 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')) { // Safari natif HLS