2010-10-14, 09:24
Hi,
I'm trying to create a playlist of plugin:// urls so that the plugin can generate the actual urls for the playlist. The current code that doesn't work is:
This code just hangs on "opening stream" and I'm not sure if the playVideo part is even executed, let alone if that's the correct code to play the file is. What is the correct way of doing this?
I'm trying to create a playlist of plugin:// urls so that the plugin can generate the actual urls for the playlist. The current code that doesn't work is:
Code:
"""
Plugin for testing stack support
"""
import xbmc, xbmcgui, xbmcplugin
if ( __name__ == "__main__" ):
if ( not sys.argv[ 2 ] ):
print 'default executed!'
xbmcplugin.addDirectoryItem(handle=int( sys.argv[ 1 ] ),listitem=xbmcgui.ListItem('stack test'),url="plugin://plugin.video.stacktest/?playlist", isFolder=False)
xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=1 )
elif ( sys.argv[2].startswith('?playVideo') ):
print 'playVideo executed!'
listitem = xbmcgui.ListItem("video test", path="rtmpe://ten-flashope-e.vx.kitd.com/ondemand/19056/1395/geo/ausonly/2010/Q1/glee-201-220910-sg1_300.flv")
xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=listitem)
if ( sys.argv[2].startswith('?playlist') ):
print 'playlist executed!'
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
listitem = xbmcgui.ListItem('test2')
playlist.add(url="plugin://plugin.video.stacktest/?playVideo&1", listitem=listitem, index=1)
playlist.add(url="plugin://plugin.video.stacktest/?playVideo&2", listitem=listitem, index=2)
xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(playlist, xbmcgui.ListItem("test"))
This code just hangs on "opening stream" and I'm not sure if the playVideo part is even executed, let alone if that's the correct code to play the file is. What is the correct way of doing this?