mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
catch errors
This commit is contained in:
parent
a0225f6ea3
commit
cbc7c6b824
1 changed files with 2 additions and 3 deletions
|
|
@ -277,16 +277,15 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
}, [player.nextVideo, handleNextVideoNavigation, profile.settings]);
|
||||
|
||||
const onPipEnableRequested = React.useCallback(() => {
|
||||
console.log("Entering picture in picture");
|
||||
const videoElement = video.containerRef.current?.querySelector('video');
|
||||
if (videoElement && videoElement !== document.pictureInPictureElement) {
|
||||
videoElement.requestPictureInPicture();
|
||||
videoElement.requestPictureInPicture().catch((error) => {});
|
||||
}
|
||||
}, []);
|
||||
|
||||
const onPipDisableRequested = React.useCallback(() => {
|
||||
if (document.pictureInPictureElement) {
|
||||
document.exitPictureInPicture();
|
||||
document.exitPictureInPicture().catch((error) => {});
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue