Only fullscreen in portrait mode

This commit is contained in:
David Halls 2021-07-18 20:47:09 +01:00
parent 8f0cb0f54c
commit 0ae72e0bd6
2 changed files with 4 additions and 5 deletions

View File

@ -146,16 +146,15 @@ async function start() {
// registers a loadeddata handler which then registers a play handler)
video_el.addEventListener('loadeddata', async function () {
try {
if (!document.fullscreenElement) {
await document.documentElement.requestFullscreen();
}
// make canvas same size as native video dimensions so every pixel is seen
const portrait = this.videoHeight > this.videoWidth;
if (portrait) {
canvas_el.width = this.videoHeight;
canvas_el.height = this.videoWidth;
canvas_el.classList.add('portrait');
if (!document.fullscreenElement) {
await document.documentElement.requestFullscreen();
}
screen.orientation.lock('portrait');
} else {
canvas_el.width = this.videoWidth;

@ -1 +1 @@
Subproject commit 27a41fd9dae55440219820dc5523fbf4a41da81f
Subproject commit 69f1c29358a2d993683d8bd53772d0971de5493f