Posts: 8
Joined: Aug 2012
Reputation:
0
I play back a live TV channel in a player and would like to receive the next and prev item events in my code. I will then handle then appropriately to switch to a different channel.
I cannot use a normal playlist functionality here because I have manually (from my code) to stop playback of the previous channel and start playback of a new one.
Is there any way to get these events in my code? Or is there any workaround that I can do to achieve the end result?
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
the xbmc.Player class is for monitoring player events.
Posts: 8
Joined: Aug 2012
Reputation:
0
Yes, this class has callbacks onPlayBackEnded, onPlayBackStarted, onPlayBackStopped, but I have not found any functions like onPlayNext, onPlayPrev that I actually need.
Posts: 793
Joined: Oct 2010
Reputation:
17
Not an easy way for sure. You need to make a python class that implements the file like object interface. Create an instance of your FLO class and pass in the uri you want to play. Pass this instance to Xbmc to be played. Inside your FLO class, you can execute whatever you need at the appropriate time since your instance I'd now sitting betweenXbmc's commands and the file it thinks it's acting on
Posts: 8
Joined: Aug 2012
Reputation:
0
xbmc.Player can play url, filename and listitem. How to make that FLO object was playing xbmc.Player?
Posts: 793
Joined: Oct 2010
Reputation:
17
The player is just calling the file like object methods on whatever you tell it to play. Ifyour object responds appropriately, Xbmc won't know the difference
This is not a light undertaking. If you've never created a file like object before, this might not be the project for you