mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-17 07:39:21 +08:00
rudimentary fix for picture-in-picture: just use the last-joined connection
This commit is contained in:
parent
5bda1245ec
commit
624c9ee94f
@ -914,21 +914,21 @@ function toggleChat() {
|
|||||||
function togglePictureInPicture() {
|
function togglePictureInPicture() {
|
||||||
if (
|
if (
|
||||||
"pictureInPictureEnabled" in document ||
|
"pictureInPictureEnabled" in document ||
|
||||||
remoteVideoVanilla.webkitSetPresentationMode
|
VideoChat.remoteVideoWrapper.lastChild.webkitSetPresentationMode
|
||||||
) {
|
) {
|
||||||
if (document.pictureInPictureElement) {
|
if (document.pictureInPictureElement) {
|
||||||
document.exitPictureInPicture().catch((error) => {
|
document.exitPictureInPicture().catch((error) => {
|
||||||
logIt("Error exiting pip.");
|
logIt("Error exiting pip.");
|
||||||
logIt(error);
|
logIt(error);
|
||||||
});
|
});
|
||||||
} else if (remoteVideoVanilla.webkitPresentationMode === "inline") {
|
} else if (VideoChat.remoteVideoWrapper.lastChild.webkitPresentationMode === "inline") {
|
||||||
remoteVideoVanilla.webkitSetPresentationMode("picture-in-picture");
|
VideoChat.remoteVideoWrapper.lastChild.webkitSetPresentationMode("picture-in-picture");
|
||||||
} else if (
|
} else if (
|
||||||
remoteVideoVanilla.webkitPresentationMode === "picture-in-picture"
|
VideoChat.remoteVideoWrapper.lastChild.webkitPresentationMode === "picture-in-picture"
|
||||||
) {
|
) {
|
||||||
remoteVideoVanilla.webkitSetPresentationMode("inline");
|
VideoChat.remoteVideoWrapper.lastChild.webkitSetPresentationMode("inline");
|
||||||
} else {
|
} else {
|
||||||
remoteVideoVanilla.requestPictureInPicture().catch((error) => {
|
VideoChat.remoteVideoWrapper.lastChild.requestPictureInPicture().catch((error) => {
|
||||||
alert(
|
alert(
|
||||||
"You must be connected to another person to enter picture in picture."
|
"You must be connected to another person to enter picture in picture."
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user