2007-08-06, 22:31
I am trying to write a script that will play music from a custom server on my PC. My server maintains the active playlist, and sends the next song in response to an HTTP request. I am trying to use onPlayBackEnded() to cue up the next song, but it is not getting called.
Any help would be greatly appreciated. Here's the script:
Any help would be greatly appreciated. Here's the script:
Code:
import xbmc, urllib, time
class MyPlayer(xbmc.Player):
def __init__ ( self ):
xbmc.Player.__init__( self )
def startPlaying(self):
self.source = 'http://192.168.1.207:80/song.mp3'
self.dest = 'Q:\\UserData\\Music\song.mp3'
self.loc = urllib.URLopener()
self.loc.retrieve(self.source, self.dest)
self.play(self.dest)
def onPlayBackEnded(self):
xbmc.log("My Function Called")
self.startPlaying()
p = MyPlayer()
p.startPlaying()
while(1):
time.sleep(500)