Archipelago — open-source initial import

This commit is contained in:
Archipelago
2026-08-12 10:55:49 +00:00
commit dc80b552a1
1639 changed files with 352647 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
/** Video Picture-in-Picture helpers (Chromium/Safari; no-ops elsewhere).
* Kiosk note: PiP is skipped on the WM-less kiosk X session by callers that
* care — an unmanaged popup there is unusable (docs/tv-input-iframe-apps.md
* sibling investigation, task #18). */
export const pipSupported =
typeof document !== 'undefined' &&
'pictureInPictureEnabled' in document &&
document.pictureInPictureEnabled
export async function togglePip(video: HTMLVideoElement | null | undefined): Promise<void> {
if (!video || !pipSupported) return
try {
if (document.pictureInPictureElement === video) await document.exitPictureInPicture()
else await video.requestPictureInPicture()
} catch {
// Permission/transient failure — the button is best-effort.
}
}