Skip to content

Commit

Permalink
Added full Screen Command
Browse files Browse the repository at this point in the history
Co-Authored-By: Anand Jaiswar <[email protected]>
  • Loading branch information
anand-3399 committed Jul 25, 2022
1 parent d4cfd80 commit db6afda
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<body>

<video autoplay muted id="myVideo">
<source src="img/video.webm" type="video/webm">
<!-- <source src="img/video.webm" type="video/webm"> -->
</video>

<div class="icons">
Expand All @@ -40,7 +40,7 @@
<!-- <img src="img/icons-new.png" alt=""> -->
<!-- <img class="rightTaskbar" src="img/taskbarright.png" alt=""> -->
<div class="rightTaskbar">
<img src="img\icons\up.svg" alt="">
<img src="img\icons\up.svg" alt="" onclick="Fullscreen()">
<img src="img\icons\keyboard.svg" alt="">

<div class="action-center-button" onclick="document.getElementById('acCheck').click()">
Expand Down
33 changes: 33 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,36 @@ clickanywhere.addEventListener("click", () => {
}

})

/* Get the element you want displayed in fullscreen mode (a video in this example): */
var elem = document.documentElement;

/* When the openFullscreen() function is executed, open the video in fullscreen.
Note that we must include prefixes for different browsers, as they don't support the requestFullscreen property yet */
var FCount = false;
function Fullscreen() {

if (FCount == false) {
FCount = true
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.webkitRequestFullscreen) { /* Safari */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE11 */
elem.msRequestFullscreen();
}
}
else {
FCount = false
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) { /* Safari */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) { /* IE11 */
document.msExitFullscreen();
}
}



}

0 comments on commit db6afda

Please sign in to comment.