Req Fullscreen only when playing movie
#1
Would it, please, be possible to have Kodi display in windowed mode & switch to fullscreen only when playing movies using the internal player and then back to windowed mode when we exit the player (movie stops)? PatK has suggested the backslash method, which is good until (if?) a setting is implemented, but it means it has to be done at the keyboard which is not always available at the viewing position (as is my case).
I have Nexus, W10 PC, 4k, HDR movies in mkv container.

The reason I want this is because "administrative" tasks are more conveniently done if Kodi is in a smaller window, but the movie must be presented in all its glory and the display's resolution. Thank you!
Reply
#2
I suspect this would have to be something handled by an addon script of some sort and not something for the main codebase. The use case / demand for this will be minuscule.

I suspect a minority of users run Kodi on desktop hardware connected to a mouse and keyboard these days as opposed to a device using a 10ft interface with a large screen and remote and this feature would be specific to this use case only.

I'm not a developer so maybe one of our devs could comment whether there is any restriction to an addon making calls to trigger a switch in the screen mode by detecting an instruction to play a video? I wouldn't think there would be.
Always read the Wiki, FAQ and search the forum before posting.
Read/follow the forum rules.
Reply
#3
youre right on target @Dangelus

one could write an addon to monitor playback states and issue a toggle fullscreen via json rpc
Reply
#4
Video playback happens in the VideoFullScreen.xml of the skin you're using. Actions can be executed by the skin using onload and onunload of a Window, so perhaps this could be done to issue the togglefullscreen action.

So:

<onload>togglefullscreen</onload>
<onunload>togglefullscreen</onunload>

Refer to https://kodi.wiki/view/Window_Structure
Reply
#5
(2023-03-07, 02:32)jjd-uk Wrote: Video playback happens in the VideoFullScreen.xml of the skin you're using. Actions can be executed by the skin using onload and onunload of a Window, so perhaps this could be done to issue the togglefullscreen action.

So:

<onload>togglefullscreen</onload>
<onunload>togglefullscreen</onunload>

Refer to https://kodi.wiki/view/Window_Structure
right on
very elegant solution, i just tested it with v20/linux and it works exactly as OP asked for
Reply
#6
Good as it was just a thought and was completely untested.

So to do exactly as asked and only do this for movies you could do it this way:

<onload condition="VideoPlayer.Content(movies)">togglefullscreen</onload>
<onunload condition="VideoPlayer.Content(movies)">togglefullscreen</onunload>

The other thing is that this is just a toggle command, so you need to start from Kodi being in a windowed state prior to playing anything, as if you were fullscreen in the UI and started to play something it would send Kodi into windowed mode.
Reply
#7
We don't seem to have an explict fullscreen action that would:

1. If already in fullscreen then do nothing.
2. If Windowed change to fullscreen.

We only seem to have the toggle action which is not ideal for what is wanted.

So perhaps this feature request should be to add a fullscreen action (not a toggle) to go fullscreen if Kodi is not already fullscreen.
Reply
#8
Just realised there is a boolean System.IsFullscreen

So this can be done:

<onload condition="VideoPlayer.Content(movies) + !System.IsFullscreen">togglefullscreen</onload>
<onunload condition="VideoPlayer.Content(movies) + System.IsFullscreen">togglefullscreen</onunload>


So when movie playback is started (which uses onload) this will only do the togglefullscreen action if Kodi is not already fullscreen, if you happen to have Kodi already in fullscreen then this prevent to togglefullscreen action happening to send Kodi back to windowed mode.
Then when movie playback is stopped (which uses onunload) this will only do the togglefullscreen action if Kodi is already fullscreen to send it back to windowed mode, if you happen to have Kodi already in windowed mode then this prevent to togglefullscreen action happening to send Kodi back to fullscreen mode.
Reply

Logout Mark Read Team Forum Stats Members Help
Fullscreen only when playing movie0