fix: implement forced fullscreen hack for webos

This commit is contained in:
Kay Simons 2021-09-14 20:27:02 +02:00 committed by Kay Simons
parent 7f81f5b3f1
commit 59bb2f27a5
2 changed files with 9 additions and 5 deletions

View file

@ -1361,25 +1361,29 @@ function tryRemoveElement(elem) {
this.#videoDialog = dlg;
this.#mediaElement = videoElement;
delete this.forcedFullscreen;
if (options.fullscreen) {
// At this point, we must hide the scrollbar placeholder, so it's not being displayed while the item is being loaded
document.body.classList.add('hide-scroll');
}
if (options.fullscreen) {
// Enter fullscreen in the webOS browser to hide the top bar
if (!window.NativeShell && browser.web0s && Screenfull.isEnabled) {
Screenfull.request();
Screenfull.request().then(() => {
this.forcedFullscreen = true;
});
return videoElement;
}
// don't animate on smart tv's, too slow
if (!browser.slow && browser.supportsCssAnimation()) {
return zoomIn(dlg).then(function () {
return videoElement;
});
}
}
return videoElement;
});
} else {