beatmasterRS / skin.arctic.zephyr.mod

Welcome to Arctic: Zephyr - Reloaded. A clean, minimal, elegant, simple, light skin, based on the original Arctic: Zephyr skin by jurialmunkey.
Other
164 stars 54 forks source link

Adding "random splashscreen" startup video to skin #1045

Open evinjaff opened 10 months ago

evinjaff commented 10 months ago

Hi there,

First off, have really been enjoying this Kodi skin- think it's easily the best one out there in terms of feature richness and a modern-looking UI. I was tickled by the fact that Arctic Zephyr let you play a video on startup, kind of like on the Steam Deck. On the Steam Deck, there was a nice third-party tool that let you randomly select a boot video and it would be awesome if I could do that with the skin so I could cycle between random splash screens on first launch.

It seems like Kodi/the skin lacks some functionality to do this depending on if you work around this by implementing it as a video or a single file. I found the chunk of xml where the startup movie happens, but to be honest this is just super out of my comfort zone. Can anyone think of a way to implement this?

<control type="button" id="9000">
    <include>HiddenButton</include>
    <onfocus>AlarmClock(Check1,SetFocus(9002),00:01,silent)</onfocus>
    <onfocus condition="!String.IsEmpty(Skin.String(StartupPlaylist)) + !Player.HasMedia">AlarmClock(PlayStartupVideo,PlayMedia($ESCINFO[Skin.String(StartupPlaylist)],1),00:00,silent,false)</onfocus>
    <onback>ReplaceWindow($INFO[System.StartupWindow])</onback>
    <onback>Stop</onback>
</control>

What I see is basically two ways to do it based on whether from Arctic Zephyr's perspective, it's being fed a playlist or a single video.

The playlist way:

The main issue with just cooking up a smart playlist is that if you pass Artctic Zephyr a Kodi smart playlist that can be randomized, it will keep playing all the videos instead of stopping after the first one. This makes sense because the intention is to function kind of like a kiosk, but there's no way to limit this to playing only one video without writing some sort of external integration/script that might break playlists.

I read the docs for the Kodi PlayMedia command and it seems like there's no way to set a play limit on a playlist, so either Kodi would need to add support to this function and then a toggle in Arctic Zephyr could to run the PlayMedia command two different ways so it would have to be on Kodi to fix playlists to make this work.

The single file way

To implement it using a single-file method, it feels a lot easier but requires more off-Kodi logic. You'd need to find a path string of a valid media file from a directory provided and feed it to the PlayMedia command. I have no idea how much non-Kodi python/shell commands can be run from a skin xml like this so this does feel like you'd need more permissions to do this.

To simulate a hacky version of this, I hacked together a super janky autoexec to do it for me just by overwrite-copying video files over a single mp4 that Arctic Zephyr points to (I know, I know, this is really unsafe).

So that's basically my findings and thoughts. Any suggestions from the community how to proceed? I can clean up my code, maybe move towards using atomic symlinks to make it actually safe to use and make a repo, or if people think that this could be feasibly done inside the skin I can try and read up on skin scripting to help make a PR.