Codetip: Using xbmc's playerevents
#1
Smile 
hi. i have seen a lot of scripts, attempting to detect media playing and media change.

most code i have seen does this:
loop:
  sleep
  check media
  if media changed do stuff
  goto loop

but there is a better way:
the loop in this code, is just because we don't want our script to end.

you can get the code from here, because xbmc forum is sensoring some code:
onplayback.py



Reply
#2
hi there,

thanks for posting this script. unfortunately it does not work for me - the video plays once but does not loop.

also, woud it be possible to get this script to trigger a playlist instead of a single video?

thanks,

bdot
Reply
#3
push the white button in scripts window.
on every playchange (music,video... or whatever is played) will print
'playback started'

in my example there is one media that is started.
but you can remove that, and still you will see what i'm talking about.

trigger playlist? don't understand you. the onplayback event is called on every media change. it does not matter if it is played from a playlist, or is started on it's own.
check out the python manual in my signatur.

if your looking on a method to loop video, or add stuff to the playlist, this example will not help you.
check out xbmcscripts.com. there are a ton of stuff there, that you can learn from.



Reply

Logout Mark Read Team Forum Stats Members Help
Codetip: Using xbmc's playerevents0