fix stuff + add stuff
This commit is contained in:
parent
436a96eea9
commit
6e095bbe30
@ -37,7 +37,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
const audio = document.getElementById('aud');
|
const audio = document.getElementById('aud');
|
||||||
const audioEl = document.getElementById('aud');
|
const audioEl = document.getElementById('aud');
|
||||||
|
|
||||||
const createTitleBar = () => {
|
const initTitleBar = () => {
|
||||||
const metaTitle = document.querySelector('meta[name="title"]')?.content || "";
|
const metaTitle = document.querySelector('meta[name="title"]')?.content || "";
|
||||||
const metaAuthor = document.querySelector('meta[name="twitter:author"]')?.content || "";
|
const metaAuthor = document.querySelector('meta[name="twitter:author"]')?.content || "";
|
||||||
const existing = video.getChild("TitleBar");
|
const existing = video.getChild("TitleBar");
|
||||||
@ -47,15 +47,22 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const destroyTitleBar = () => {
|
const removeTitleBar = () => {
|
||||||
const existing = video.getChild("TitleBar");
|
const existing = video.getChild("TitleBar");
|
||||||
if (existing) video.removeChild(existing);
|
if (existing) video.removeChild(existing);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener("fullscreenchange", () => {
|
const handleFullscreen = () => {
|
||||||
if (document.fullscreenElement || document.webkitFullscreenElement) createTitleBar();
|
const fs = document.fullscreenElement || document.webkitFullscreenElement;
|
||||||
else destroyTitleBar();
|
if (fs) {
|
||||||
});
|
video.ready(() => initTitleBar());
|
||||||
|
} else {
|
||||||
|
removeTitleBar();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("fullscreenchange", handleFullscreen);
|
||||||
|
document.addEventListener("webkitfullscreenchange", handleFullscreen);
|
||||||
|
|
||||||
// inline playback works on iOS/Safari
|
// inline playback works on iOS/Safari
|
||||||
try { videoEl.setAttribute('playsinline', ''); videoEl.setAttribute('webkit-playsinline', ''); } catch {}
|
try { videoEl.setAttribute('playsinline', ''); videoEl.setAttribute('webkit-playsinline', ''); } catch {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user