Skip to content

Commit

Permalink
Fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jackson-57 committed Jan 29, 2023
1 parent 4db39f3 commit ecccb74
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ async function start() {
});
source.connect(processor);
processor.connect(context.destination);

// fullscreen mode
document.addEventListener("keydown", function (e) {
if (e.key === "f") {
if (!document.fullscreenElement) {
videoElement.requestFullscreen();
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
}
}
}
}, false);

break;
} catch (e) {
console.error(e);
Expand Down
6 changes: 6 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ html, body, #root, video {
height: 100%;
width: 100%;
margin: 0;
}

/* Disable video controls in fullscreen */
/*noinspection CssInvalidPseudoSelector*/
video::-webkit-media-controls {
display:none !important;
}

0 comments on commit ecccb74

Please sign in to comment.