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:
- confidently launch a playlist in fullscreen from cron?
- ask the system if it is already in fullscreen so I don’t issue the command?