Tweak how auto fullscreen option works

When auto fullscreen is enabled, enter fullscreen on each media load
unless player is in floating mode in which probably user wants it to remain.
This commit is contained in:
Rafał Dzięgiel
2021-04-09 18:58:12 +02:00
parent d9939a94c2
commit c21b214477

View File

@@ -18,7 +18,6 @@ class ClapperPlayer extends PlayerBase
super._init();
this.seek_done = true;
this.doneStartup = false;
this.needsFastSeekRestore = false;
this.customVideoTitle = null;
@@ -429,18 +428,19 @@ class ClapperPlayer extends PlayerBase
debug(`URI loaded: ${uri}`);
this.needsTocUpdate = true;
if(!this.doneStartup) {
this.doneStartup = true;
if(settings.get_boolean('fullscreen-auto')) {
const root = player.widget.get_root();
const clapperWidget = root.get_child();
/* Do not enter fullscreen when already in it
* or when in floating mode */
if(
!clapperWidget.isFullscreenMode
&& clapperWidget.controlsRevealer.reveal_child
) {
this.playOnFullscreen = true;
root.fullscreen();
if(settings.get_boolean('fullscreen-auto')) {
const root = player.widget.get_root();
const clapperWidget = root.get_child();
if(!clapperWidget.isFullscreenMode) {
this.playOnFullscreen = true;
root.fullscreen();
return;
}
return;
}
}
this.play();