How to play xbmcplugin.directory's elements with subtitles?
#1
I know about
Code:
xbmc.Player().play(pl)
xbmc.Player().setSubtitles()

But how can I run this when I just create list of elements, user can play them by selecting and I don't use
Code:
xbmc.Player().play(pl)
?

Now I have something like that and it works:
Code:
results = _parsed_data_

for r in results:
    li = xbmcgui.ListItem(r.get('title'), iconImage=r.get('icon'))
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=r['files'].get('downloadURL'), listitem=li)

xbmcplugin.endOfDirectory(addon_handle)

How can I best add subtitles paths to this playlist and load them on play?
Reply
#2
http://mirrors.xbmc.org/docs/python-docs...l#ListItem scroll down to setsubtitles.
Reply
#3
Thank you! Works great.

Is there some method, that would work on XBMC 12.x (on Windows XP)?
Is it possible to create some kind of listener or delegate that would be checking if user starts playing video and then manually set proper subtitle?
Reply
#4
well it was added in helix since it was a pain to do before. but yes, you can do some trickery using a (separate) service script that monitors the player and calls player.setSubtitles() at the appropriate time (with the appropriate info - passing this between scripts will likely be fugly).
Reply

Logout Mark Read Team Forum Stats Members Help
How to play xbmcplugin.directory's elements with subtitles?0