Dons PayPal

This commit is contained in:
Paul Schneider 2026-11-02 10:40:29 +00:00
commit e3b4414ab1
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
45 changed files with 7476 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,32 @@
document.querySelectorAll("[data-podcast-player]").forEach(player => {
const warning = player.parentElement.querySelector("[data-playback-error]");
const showError = () => warning.classList.remove("d-none");
const source = player.querySelector("source");
if (player.dataset.hls === "true" && !player.canPlayType("application/vnd.apple.mpegurl")) {
if (typeof Hls === "undefined" || !Hls.isSupported()) {
showError();
return;
}
const url = source.src;
source.remove();
const start = player.parentElement.querySelector("[data-start-playback]");
start.classList.remove("d-none");
start.addEventListener("click", () => {
start.classList.add("d-none");
const hls = new Hls();
hls.on(Hls.Events.ERROR, (_event, data) => {
if (data.fatal) {
showError();
hls.destroy();
}
});
hls.loadSource(url);
hls.attachMedia(player);
player.play().catch(showError);
window.addEventListener("pagehide", () => hls.destroy(), { once: true });
}, { once: true });
} else {
source.addEventListener("error", showError);
}
player.addEventListener("error", showError);
});