From c21b214477cbd5f4bd3f5dbbaa7ba14d776e3b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 9 Apr 2021 18:58:12 +0200 Subject: [PATCH] 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. --- src/player.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/player.js b/src/player.js index 44e339ce..2133a00a 100644 --- a/src/player.js +++ b/src/player.js @@ -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();