Correction du player.

This commit is contained in:
Johnnybegood90
2026-03-11 18:19:24 +01:00
parent 34ff10ecf4
commit ed6892a8ae
2 changed files with 178 additions and 5 deletions
+94 -5
View File
@@ -631,6 +631,86 @@ $m3u_url = htmlspecialchars($config["m3u_url"] ?? "");
#navBtns { display: none !important; }
}
</style>
/* ═══════════════════════════════════════════
PLAYER PiP
═══════════════════════════════════════════ */
.pip {
position: fixed;
bottom: 24px;
right: 24px;
width: 380px;
background: #000;
border: 1px solid var(--border-bright);
box-shadow: 0 8px 32px rgba(0,0,0,0.8);
z-index: 2000;
display: none;
flex-direction: column;
}
.pip.visible { display: flex; }
.pip-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 10px;
background: var(--surface);
border-bottom: 1px solid var(--border);
gap: 8px;
flex-shrink: 0;
}
.pip-channel {
font-family: var(--font-mono);
font-size: 11px;
color: var(--accent);
letter-spacing: 0.08em;
text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
}
.pip-program {
font-size: 11px;
color: var(--text-dim);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 2;
text-align: center;
}
.pip-close {
background: none;
border: none;
color: var(--text-dim);
font-size: 18px;
cursor: pointer;
padding: 0 4px;
line-height: 1;
flex-shrink: 0;
transition: color 0.15s;
}
.pip-close:hover { color: var(--accent-live); }
.pip video {
width: 100%;
aspect-ratio: 16/9;
display: block;
background: #000;
}
.pip-error {
padding: 20px;
text-align: center;
font-family: var(--font-mono);
font-size: 11px;
color: var(--accent-live);
letter-spacing: 0.06em;
}
.channel-cell { cursor: pointer; }
.channel-cell:hover { background: var(--surface2); }
.program-block.is-live { cursor: pointer; }
@media (max-width: 600px) {
.pip { width: calc(100vw - 16px); bottom: 8px; right: 8px; left: 8px; }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.4.12/hls.min.js"></script>
<link id="themeStylesheet" rel="stylesheet" href="themes/default.css">
</head>
@@ -1125,12 +1205,21 @@ function parseM3U(text) {
function getStreamUrl(channelName) {
const slug = slugify(channelName);
if (m3uStreams[slug]) return m3uStreams[slug];
// Fallback : chercher une clé qui contient le slug ou l'inverse
for (const [key, url] of Object.entries(m3uStreams)) {
if (key.includes(slug) || slug.includes(key)) return url;
let url = null;
if (m3uStreams[slug]) {
url = m3uStreams[slug];
} else {
// Fallback : chercher une clé qui contient le slug ou l'inverse
for (const [key, u] of Object.entries(m3uStreams)) {
if (key.includes(slug) || slug.includes(key)) { url = u; break; }
}
}
return null;
if (!url) return null;
// Passer par proxy.php pour éviter le mixed content HTTP/HTTPS
if (url.startsWith('http://')) {
return 'proxy.php?url=' + encodeURIComponent(url);
}
return url;
}
// ── PLAYER PiP ────────────────────────────────────────────────────────────────