Fullscreen mode from command prompt

I use my OSMC on a Raspberry Pi to play a playlist of videos non-stop. I have a cron job that refreshes the playlist nightly, and then relaunches the playlist. Sometimes, the videos will then play in the background and I have to manually tell it go into fullscreen.

I found that I can issue these commands in my script after launching the playlist:
kodi-send --action=PlayMedia"(/home/osmc/playlists/today.m3u)"
kodi-send --action=FullScreen

However, in the case that the playlist launched in fullscreen, the next command exits full screen. But if it doesn’t launch in full screen, then the second command puts it into fullscreen.

Does anyone know how to either:

  1. confidently launch a playlist in fullscreen from cron?
  2. ask the system if it is already in fullscreen so I don’t issue the command?

You should be able to tell it to play full screen within the playmedia builtin

kodi-send --action=“PlayMedia(/some/path/to/a/file/music_file.mp3,1)”

the “,1” tells it to play in full screen, without you having to set it so

Hmmm, I tried that and it didn’t work.

kodi-send --action=PlayMedia"(/home/osmc/playlists/today.m3u,1)"

The action works, but it doesn’t bring it to full screen. According to this:
https://kodi.wiki/view/List_of_built-in_functions

“,1” will start a video in a preview window, instead of fullscreen.

But that doesn’t seem to be happening either.

Good news is it seems that running it with the ,1 and the kodi-send --action=FullScreen seems to work.

1 Like