2016-04-01, 01:22
I'll apologize in advance. I'm a rank beginner at Kodi, with a question that's probably almost trivial to most readers. I'm in a bind to get a project out the door for a client, and my various searches haven't found an answer to this simple question.
I want to be able run run the PlayMedia built-in to play a video clip, and when it's done run the ScreenSaver built-in. This will be triggered via xbmc-send/kodi-send. I have two problems:
1) My current code is as follows, but the slide show doesn't wait for the video to complete.
import xbmc
xbmc.executebuiltin('XBMC.PlayMedia(some-video.mp4)', True)
xbmc.executebuiltin('XBMC.SlideShow(somedirectory/slideshow)')
If I comment out the last line the video plays, but otherwise I immediately see the slide show.
2) I'm not able to launch this via kodi-send using the following:
kodi-send "--action=XBMC.RunScript('/home/pi/.kodi/userdata/somescript.py')"
The only way I can get it to run at all (to make sure the code is OK) is to rename it to "autoexec.py" and watch it at start-up.
Background detail:
- I'm running on a Raspberry Pi under Raspian
- I need Raspian rather than, say OSMC, so I can run other applications like a custom web server
- I'm running Kodi version 14.2, because that's what was in the Raspian repository
- The regular screen-saver plug-ins don't seen to work well for my network environment (NFS directories automounted on demand -- they keep thinking it's empty because they didn't try to access a file or directory to trigger the automount), whereas using the ScreenSaver built-in works perfectly every time.
Can someone take pity on a rank beginner and set me on the right track? Do I need to dive into callbacks or whatever Kodi offers for a notification system, or is there a simple solution?
Thanks in advance for any help you can provide.
I want to be able run run the PlayMedia built-in to play a video clip, and when it's done run the ScreenSaver built-in. This will be triggered via xbmc-send/kodi-send. I have two problems:
1) My current code is as follows, but the slide show doesn't wait for the video to complete.
import xbmc
xbmc.executebuiltin('XBMC.PlayMedia(some-video.mp4)', True)
xbmc.executebuiltin('XBMC.SlideShow(somedirectory/slideshow)')
If I comment out the last line the video plays, but otherwise I immediately see the slide show.
2) I'm not able to launch this via kodi-send using the following:
kodi-send "--action=XBMC.RunScript('/home/pi/.kodi/userdata/somescript.py')"
The only way I can get it to run at all (to make sure the code is OK) is to rename it to "autoexec.py" and watch it at start-up.
Background detail:
- I'm running on a Raspberry Pi under Raspian
- I need Raspian rather than, say OSMC, so I can run other applications like a custom web server
- I'm running Kodi version 14.2, because that's what was in the Raspian repository
- The regular screen-saver plug-ins don't seen to work well for my network environment (NFS directories automounted on demand -- they keep thinking it's empty because they didn't try to access a file or directory to trigger the automount), whereas using the ScreenSaver built-in works perfectly every time.
Can someone take pity on a rank beginner and set me on the right track? Do I need to dive into callbacks or whatever Kodi offers for a notification system, or is there a simple solution?
Thanks in advance for any help you can provide.