ui: remove click-to-play overlay; native play button covers autoplay-block
This commit is contained in:
1 parent
2752d49411
commit
8f57593002
3 files changed
+3
-13
No files matched your search
+1
-9
@@ -463,7 +463,7 @@ async function play(ep_id, ep_no) {
|
||||
if (currentEp && !playerBroken && !v.ended) playerOverlay("Buffering\u2026");
|
||||
});
|
||||
v.addEventListener("ended", onEnded);
|
||||
v.play().catch(() => showPlayOverlay(v)); // autoplay blocked (no user gesture) -> visible prompt
|
||||
v.play().catch(() => {}); // autoplay blocked -> user uses the native play button
|
||||
watchPos(v);
|
||||
postHistory({...meta(v), title: detail.name, slug_id: detail.slug_id, season_id: seasonId,
|
||||
ep_id, lang, ep: ep_no, pos: saved?.pos || 0});
|
||||
@@ -489,14 +489,6 @@ function watchPos(v) {
|
||||
window.addEventListener("pagehide", save);
|
||||
}
|
||||
|
||||
function showPlayOverlay(v) {
|
||||
if (playerBroken) return; // failure overlay (with Retry) takes precedence
|
||||
playerHideOverlay();
|
||||
const o = el("button", "play-overlay", "▶ click to play");
|
||||
o.onclick = () => { v.play(); o.remove(); };
|
||||
v.parentElement.append(o);
|
||||
}
|
||||
|
||||
// ---------- boot ----------
|
||||
(async () => {
|
||||
document.querySelector(".logo").href = BASE;
|
||||
|
||||
@@ -63,8 +63,6 @@ h2 { margin: 0.4rem 0; }
|
||||
|
||||
.player { position: relative; }
|
||||
.player video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; aspect-ratio: 16/9; }
|
||||
.play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
|
||||
font-size: 1.1rem; padding: 0.8rem 1.4rem; background: rgba(0, 0, 0, 0.75); }
|
||||
.controls { display: flex; align-items: center; gap: 0.4rem; margin: 0.6rem 0; flex-wrap: wrap; }
|
||||
button { background: var(--card); color: var(--fg); border: 1px solid var(--bd);
|
||||
border-radius: 8px; padding: 0.4rem 0.7rem; cursor: pointer; }
|
||||
|
||||
Reference in new issue
Block a user