mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Fix isPictureInPicture
This commit is contained in:
parent
3fad6edaad
commit
163ca0df29
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
window.__CONFIG__ = {
|
window.__CONFIG__ = {
|
||||||
// url must NOT end with a slash
|
// url must NOT end with a slash
|
||||||
VITE_CORS_PROXY_URL: "",
|
VITE_CORS_PROXY_URL: "https://rough.isra.workers.dev",
|
||||||
VITE_TMDB_API_KEY: "b030404650f279792a8d3287232358e3",
|
VITE_TMDB_API_KEY: "b030404650f279792a8d3287232358e3",
|
||||||
VITE_OMDB_API_KEY: "aa0937c0",
|
VITE_OMDB_API_KEY: "aa0937c0",
|
||||||
};
|
};
|
||||||
|
|
|
@ -214,15 +214,17 @@ export function createVideoStateProvider(
|
||||||
? "inline"
|
? "inline"
|
||||||
: "picture-in-picture"
|
: "picture-in-picture"
|
||||||
);
|
);
|
||||||
|
state.interface.isPictureInPicture =
|
||||||
|
webkitPlayer.webkitPresentationMode === "picture-in-picture";
|
||||||
}
|
}
|
||||||
if (canPictureInPicture()) {
|
if (canPictureInPicture()) {
|
||||||
if (player !== document.pictureInPictureElement) {
|
if (player !== document.pictureInPictureElement) {
|
||||||
try {
|
try {
|
||||||
player.requestPictureInPicture();
|
player.requestPictureInPicture();
|
||||||
|
state.interface.isPictureInPicture = true;
|
||||||
} catch {
|
} catch {
|
||||||
state.interface.isPictureInPicture = false;
|
state.interface.isPictureInPicture = false;
|
||||||
}
|
}
|
||||||
state.interface.isPictureInPicture = true;
|
|
||||||
} else {
|
} else {
|
||||||
document.exitPictureInPicture();
|
document.exitPictureInPicture();
|
||||||
state.interface.isPictureInPicture = false;
|
state.interface.isPictureInPicture = false;
|
||||||
|
|
Loading…
Reference in a new issue