Skip to content

Commit

Permalink
try cache added in document fullscreen toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
ChintanRajpara committed Jun 7, 2022
1 parent 26e1426 commit 1b3e981
Showing 1 changed file with 17 additions and 34 deletions.
51 changes: 17 additions & 34 deletions src/meetingContainer/MeetingContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,41 +525,24 @@ const MeetingContainer = () => {
});

const _handleToggleFullScreen = () => {
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
const elem = containerRef.current;
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen().catch((e) => {
console.log(`request to full screen is rejected due to ${e}`);
});
} else if (document.documentElement.webkitRequestFullscreen) {
/* Safari */
document.documentElement.webkitRequestFullscreen();
} else if (document.documentElement.msRequestFullscreen) {
/* IE11 */
document.documentElement.msRequestFullscreen();
try {
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
const elem = containerRef.current;
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen().catch((e) => {
console.log(`request to full screen is rejected due to ${e}`);
});
} else if (document.documentElement.webkitRequestFullscreen) {
/* Safari */
document.documentElement.webkitRequestFullscreen();
} else if (document.documentElement.msRequestFullscreen) {
/* IE11 */
document.documentElement.msRequestFullscreen();
}
}
}
// if (document.fullscreenElement) {
// document.exitFullscreen();
// } else {
// const elem = containerRef.current;
// console.log("## elem : ", elem);
// if (elem) {
// if (elem.requestFullscreen) {
// document.documentElement.requestFullscreen().catch((e) => {
// console.log(`request to full screen is rejected due to ${e}`);
// });
// } else if (elem.webkitRequestFullscreen) {
// /* Safari */
// elem.webkitRequestFullscreen();
// } else if (elem.msRequestFullscreen) {
// /* IE11 */
// elem.msRequestFullscreen();
// }
// }
// }
} catch (error) {}
};

useEffect(() => {
Expand Down

0 comments on commit 1b3e981

Please sign in to comment.