Vizible’s Blog

XBMC – Playing Video Stream

Posted in Python by wearetherock on June 19, 2009

Input : Video stream path

xbhttp.py

/dos/implement/xbmc/xbhttp.py
 1 import xbmc

 2 import xbmcgui
 3 import os
 4 
 5 class StreammingWindow(xbmcgui.Window):

 6     def __init__(self):
 7         self.rootDir = os.getcwd().replace(";", "");
 8         self.imageDir = self.rootDir + "/image/"

 9 
10         self.button = xbmcgui.ControlButton(30, 400, 80, 30, "Start")
11         self.background = xbmcgui.ControlImage(0,0,720,780, self.imageDir+"storm.jpg")
12 
13         self.radiobutton = xbmcgui.ControlRadioButton(100, 250, 200, 50, 'Status', font='font14')

14 
15         self.addControl(self.background)
16         self.addControl(self.button)
17         #self.addControl(self.radiobutton)
18         pass
19 

20     def onAction(self,action):
21         if(action == 10):
22             dialog = xbmcgui.Dialog()
23             ret = dialog.yesno('XBMC', 'Do you want to exit XBMC?')

24             if(ret == True):
25                 xbmc.executebuiltin("XBMC.Credits")
26                 xbmc.executebuiltin("XBMC.Quit()")
27                 pass

28             pass
29         
30     def onControl(self,control):
31         if control == self.button :
32             url = "http://192.168.1.104:4444/getres"

33             kb = xbmc.Keyboard()
34             kb.doModal()
35             path = kb.getText()
36             dp = xbmcgui.DialogProgress()
37         
38             xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(url+path)

39             pass
40 
41 def main():
42 
43     window = StreammingWindow()
44     window.doModal()

45    
46 
47 if __name__ == '__main__' :
48     pass
49     main()

50 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: