Not having any luck at the kodi or android forums

cscott1

New member
Jul 7, 2016
341
0
0
Hi guys I recently bought a Xiaomi Mi box. I tried setting up the preinstalled daydream (screensaver) Backdrop but it doesn't work not sure why then I got to thinking why not turn my 50 inch HD tv into a 100 gallon fishtank. I found a few screensavers in the google playstore but they are cartoonish looking even the supposedly HD ones. Then I found a website that sells 4k and full HD mp4 files 20 min videos for like 7 bucks. I tried the the video screensaver app in the playstore and although it does work. It doesn't recognize Kodi as activity and starts the screensaver 5 minutes into watching a show. Kodi is my primary source for using my android tv box so this wont work surely I'm not the only one who has wanted to do this. Any help would be greatly appreciated.

I searched and posted that in both the Android and Official Kodi forums and seems like it should be a simple fix however I have come to dead end. I figured I would just tuck my tail and admit defeat and just use a kodi video screensaver addon but to my surprise there doesn't seem to be one. surely my friends here can help?
 

Stoofer

Moderator
Staff member
Apr 18, 2015
674
0
0
Wales
You can implement your own Kodi Video File Screensaver through a simple Callback function triggered through the 'On Screensaver Activated' event. Let me know if you're comfortable doing this yourself (it really is as easy as spending 5 mins reading the through the Kodi Builtin functions in the Wiki) otherwise I'll post a quick step by step guide.
 
Last edited:

cscott1

New member
Jul 7, 2016
341
0
0
yeah stoofer if you don't mind a quick how to would be great I have changed the advancedsettingsxml. before to disable the SPMC splash but that's about as far as I have dabbled in code. Let me know if there is anything you need to know about my setup thanks
 

Stoofer

Moderator
Staff member
Apr 18, 2015
674
0
0
Wales
Some intro stuff. Kodi triggers 'events' at certain times that can be intercepted and control passed over to the user to do something different instead. One of these events is when the Screensaver is activated, the add-on to handle all this comes with Kodi as standard and you have to do a bit of a fiddle to get the video to loop once it's finished playing. But you do get an added bonus as part of all that.

Before doing anything else put the Video you want to use as the Screensaver somewhere convenient, make a note of the location. e.g. I would put it somewhere like /storage/emulated/0/Movies/video.mp4

The following code will only play the video once so to cheat that you can create a Playlist with the same file locaction repeated over and over again. You can then play the Playlist instead of the video and you get the impression that the video is looping. Because this is a Playlist you have the bonus of being able to play as many different video files as you can list, in case you get tired of seeing the same thing all the time!

So, if you use one of those 20 minute video files and want the Screensaver to keep going for an hour your Playlist would look like:

/storage/emulated/0/Movies/video.mp4
/storage/emulated/0/Movies/video.mp4
/storage/emulated/0/Movies/video.mp4

Save the Playlist off next to the Video(s) and then -

1) Set up a simple Kodi Screensaver like Dim with whatever time you want to use. Preview it to see it works OK.
2) Install the add-on 'Kodi Callbacks' from the main Kodi Repo.
3) Since Kodi Callbacks is running at System Level you'll find it under \System\Running in the add-ons.
4) Make sure Kodi Callbacks is running and Click on it to get to the Configuration screens.
5) On the 'Tasks' Tab Click on Task 1 and change 'Task' so it reads 'builtin'
6) Click on 'Kodi Builtin Function' and enter the following, replacing my Playlist location and filename with yours.... Playmedia(/storage/emulated/0/Movies/playlist.m3u)
7) On the 'Events' Tab Click on 'Choose Event (click here)' and from the list select 'On Screensaver Activated'
8) The Task assigned to this Event should say 'Task 1' , change it to that if it doesn't.
9) Click OK at the bottom of the screen and ignore the message.
10) Go back to Screensaver in your Kodi Settings and Preview it again, if all is working then instead of the screen dimming your video should start running instead.

You now have your own custom Video Screensaver :) To stop the Screensaver you have to stop it just as you would any other video file (The X key for example) since you've passed control to the Player rather than use the logic associated with the usual Screensavers. Since it's a Playlist you can FF to the next entry if you want and if the videos run out everything will just return to Kodi where, after the interval you've set, the whole thing will start up again.

Any problems let me know.
 

cscott1

New member
Jul 7, 2016
341
0
0
this looks like a fun project Im excited to work on it when I get home from work... thanks a ton Stoofer I knew My TV Addons pals wouldnt let me down.
 

Stoofer

Moderator
Staff member
Apr 18, 2015
674
0
0
Wales
Glad to help. I haven't played around with this much but it should be possible to embed a live feed into the playlist rather than a local video file so you could stream from an aquarium in real time like the ones in the Animal TV add-on rather than loop a video.
 

cscott1

New member
Jul 7, 2016
341
0
0
It worked the path wasn't quite right but I figured it out. Playmedia(/storage/emulated/0/Movies/fishtank.mp4). Is mine.
If anyone else follows the instructions stoofer graciously posted for us make sure you put the colon at the end of the path and there is no period. This part took me the longest I had the path wrong a couple times but other than that this was a simple thing to do thanks again stoofer.
 

cscott1

New member
Jul 7, 2016
341
0
0
I just noticed the colon didn't show up in my path above either odd must be something to do with embedding code into web pages or something.
 

cscott1

New member
Jul 7, 2016
341
0
0
To add to get this to work perfectly because it was going to a resume play prompt instead of starting from the beginning I had to add the following code in the advancedsettings.xml
<advancedsettings>
<video>
<playcountminimumpercent>101</playcountminimumpercent>
<ignorepercentatend>101</ignorepercentatend>
</video>
</advancedsettings>
Not sure why there isn't just an option to turn off the resume prompt in the video playback setting but there isn't.
 

Stoofer

Moderator
Staff member
Apr 18, 2015
674
0
0
Wales
I was wondering why I didn't see any resume play prompts when I was testing this out and then realized it was because I was using a video clip that was so short it fell beneath the time needed to register one!

The additions you made to advancedsettings.xml will of course affect every video you play, no more restarting a movie halfway through. What do you reckon to using <ignoresecondsatstart> instead and setting the value to a few seconds more than the video clip(s) you want to play? You'll still have some sort of resume capabilty for larger video files.
 

cscott1

New member
Jul 7, 2016
341
0
0
That's an option but to be honest I'm not the type of person that stops a movie or show half way through anyway. 99% of the time I watch it straight through so I'll probably keep the setting as I have it but thanks for the recommendation.
 

cscott1

New member
Jul 7, 2016
341
0
0
Im bumping this so i can find it easier I have to redo this for krypton.
 
Last edited: