2015-05-15, 19:40
A simple plugin like this works:
Now we try doing the same thing only using playlists:
The video starts playing and Kodi freezes/crashes.
Any way to make this work?
PHP Code:
ADDON_HANDLE = int(sys.argv[1])
PATH = sys.argv[0][33:-1]
QUERY = sys.argv[2][1:]
if PATH=='playvideo':
xbmc.Player().play(QUERY)
else:
listItem = xbmcgui.ListItem('My video title')
xbmcplugin.addDirectoryItem(handle=ADDON_HANDLE, url='plugin://plugin.video.myplugin/playvideo/?http://vo.fod4.com/v/8712fdfb54/v640-q2.mp4', listitem=listItem)
xbmcplugin.endOfDirectory(ADDON_HANDLE)
Now we try doing the same thing only using playlists:
PHP Code:
ADDON_HANDLE = int(sys.argv[1])
PATH = sys.argv[0][29:-1]
QUERY = sys.argv[2][1:]
if PATH=='playvideo':
xbmc.Player().play(QUERY)
else:
listItem = xbmcgui.ListItem('My video title')
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
playlist.add(url = 'plugin://plugin.video.myplugin/playvideo/?http://vo.fod4.com/v/8712fdfb54/v640-q2.mp4', listitem=listItem)
xbmc.Player().play(playlist)
The video starts playing and Kodi freezes/crashes.
Any way to make this work?