How to receive the events from a player?
#1
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?
Reply
#2
the xbmc.Player class is for monitoring player events.
Reply
#3
Yes, this class has callbacks onPlayBackEnded, onPlayBackStarted, onPlayBackStopped, but I have not found any functions like onPlayNext, onPlayPrev that I actually need.
Reply
#4
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
Reply
#5
xbmc.Player can play url, filename and listitem. How to make that FLO object was playing xbmc.Player?
Reply
#6
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
Reply

Logout Mark Read Team Forum Stats Members Help
How to receive the events from a player?0