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;
|
||||
|
||||
Reference in new issue
Block a user