[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)
(2015-10-04, 14:49)JANGER Wrote: This is displayed as version 2.

And it works fantastic in RPi OSMC !
That's what I need! Dimming lights im my cinema automatically!

I send ordinary TCP/IP GET parameters to wifi-enabled dimmer.

Next step: can I use this add-on to play some video file before the movie start playing?

I know there is Cinema Experience add-on. But I do'n want such many features. And it also has problems in RPi.

So... sould I write some python script? and use it oposite to the above ordinary GET messsage.
Inside such script: execute the selected video file, wait the end, send tcpip message, start playing the main movie.
Is it possible?

You'll need to write a python script which subclasses xbmc.Player(): http://mirrors.kodi.tv/docs/python-docs/...tml#Player
Specifically you'll need to:
1) save the current playing file using Player.getPlayingFile()
2) call Player.stop()
3) call Player.start() using the url or whatever it is you want to play. Set a flag so that .onPlayBackStopped() knows to run when this finishes and not when you called stop in step 2.
4) write a routine for Player.onPlayBackStopped() to run the original file that you saved in step 1 only when the flag from step 3 is true

If you really want user interaction to select a file to play before the main video file, then you'll need to write the UI code to display the menu as well.

Although I've outlined the elemental steps you need above, I do not have the time to code this myself. Good luck!

EDIT:
You'll also need to write a main loop that doesn't exit until the onPlayBackStopped() code that restarts the original video file has executed.
Reply


Messages In This Thread
Great! - by gnorf - 2013-02-27, 22:50
[RELEASE] Pilulli Revisited - by KenV99 - 2014-06-28, 18:18
RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - by KenV99 - 2015-10-04, 16:49
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)4