1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-30 16:17:41 +01:00

mrvjs suggested changes

This commit is contained in:
zisra 2023-03-04 10:24:56 -06:00
parent fac0a878f3
commit a3e244285c
5 changed files with 2 additions and 13 deletions

View file

@ -32,7 +32,6 @@ export function PictureInPictureAction(props: Props) {
className={props.className}
icon={Icons.PICTURE_IN_PICTURE}
onClick={handleClick}
disabled={false}
text={
isMobile ? (t("videoPlayer.buttons.pictureInPicture") as string) : ""
}

View file

@ -31,7 +31,6 @@ function initPlayer(): VideoPlayerState {
isFocused: false,
leftControlHovering: false,
popoutBounds: null,
isPictureInPicture: false,
},
mediaPlaying: {

View file

@ -84,7 +84,7 @@ export function createCastingStateProvider(
this.pause();
},
togglePictureInPicture() {
updateSource(descriptor, state);
// no picture in picture while casting
},
async setVolume(v) {
// clamp time between 0 and 1

View file

@ -214,20 +214,12 @@ export function createVideoStateProvider(
? "inline"
: "picture-in-picture"
);
state.interface.isPictureInPicture =
webkitPlayer.webkitPresentationMode === "picture-in-picture";
}
if (canPictureInPicture()) {
if (player !== document.pictureInPictureElement) {
try {
player.requestPictureInPicture();
state.interface.isPictureInPicture = true;
} catch {
state.interface.isPictureInPicture = false;
}
player.requestPictureInPicture();
} else {
document.exitPictureInPicture();
state.interface.isPictureInPicture = false;
}
}
},

View file

@ -30,7 +30,6 @@ export type VideoPlayerState = {
isFocused: boolean; // is the video player the users focus? (shortcuts only works when its focused)
leftControlHovering: boolean; // is the cursor hovered over the left side of player controls
popoutBounds: null | DOMRect; // bounding box of current popout
isPictureInPicture: boolean; // is picture in picture active
};
// state related to the playing state of the media