mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-19 00:22:04 +00:00
remove custom implementation for autoPIP, using future attribute
This commit is contained in:
parent
1b8da30b9f
commit
f4cc2c0293
1 changed files with 4 additions and 20 deletions
|
|
@ -76,7 +76,8 @@ async function buildVideo(file, nowPlaying) {
|
|||
bpip.setAttribute("disabled", "")
|
||||
} else {
|
||||
bpip.removeAttribute("disabled")
|
||||
video.setAttribute("autopictureinpicture", "")
|
||||
if (settings.player10 === "pip")
|
||||
video.setAttribute("autopictureinpicture", "") // this is not supported yet, but will be in the future
|
||||
video.addEventListener("enterpictureinpicture", () => {
|
||||
if (playerData.octopusInstance)
|
||||
btnpip()
|
||||
|
|
@ -170,25 +171,8 @@ let onProgress
|
|||
|
||||
// visibility loss
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
switch (settings.player10) {
|
||||
case "pip":
|
||||
// if (document.visibilityState === "hidden") {
|
||||
// if (!document.pictureInPictureElement)
|
||||
// btnpip()
|
||||
// } else {
|
||||
// if (document.pictureInPictureElement)
|
||||
// btnpip()
|
||||
// }
|
||||
console.log("not supported")
|
||||
break;
|
||||
case "pause":
|
||||
if (document.visibilityState === "hidden") {
|
||||
video.pause()
|
||||
} else {
|
||||
playVideo();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (settings.player10 === "pause")
|
||||
document.visibilityState === "hidden" ? video.pause() : playVideo();
|
||||
})
|
||||
|
||||
// progress bar and display
|
||||
|
|
|
|||
Loading…
Reference in a new issue