mirror of
https://github.com/davedoesdev/streamana.git
synced 2024-08-20 23:27:41 +08:00
Only fullscreen in portrait mode
This commit is contained in:
parent
8f0cb0f54c
commit
0ae72e0bd6
@ -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
|
Loading…
Reference in New Issue
Block a user