diff --git a/web/css/main.css b/web/css/main.css
index d0b2058f..237fc4b6 100644
--- a/web/css/main.css
+++ b/web/css/main.css
@@ -429,9 +429,8 @@ body {
}
.game-screen {
- /*overflow: hidden;*/
width: 100%;
- /*height: 100%;*/
+ height: 100%;
background-color: #222222;
position: absolute;
display: flex;
diff --git a/web/index.html b/web/index.html
index fbd2722a..273abf4b 100644
--- a/web/index.html
+++ b/web/index.html
@@ -124,7 +124,7 @@
-
+
diff --git a/web/js/stream/stream.js b/web/js/stream/stream.js
index 8ee5f6f7..9766236c 100644
--- a/web/js/stream/stream.js
+++ b/web/js/stream/stream.js
@@ -97,6 +97,12 @@ const stream = (() => {
canvas.style['image-rendering'] = 'pixelated';
canvas.classList.add('game-screen');
+ // stretch depending on the video orientation
+ // portrait -- vertically, landscape -- horizontally
+ const isPortrait = screen.videoWidth < screen.videoHeight;
+ canvas.style.width = isPortrait ? 'auto' : canvas.style.width;
+ canvas.style.height = isPortrait ? canvas.style.height : 'auto';
+
let surface = canvas.getContext('2d');
screen.parentNode.insertBefore(canvas, screen.nextSibling);
toggle(false)