Correction du player.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user