v16 Possible bug in xbmc python class Player().SetSubtitles(filename)?
#1
I am looking at a video plug-in that works Kodi 15 but not in Kodi 16 or 17. The add-on gets a URL via a provider api to an en.srt file then calls its playVideo function:

Code:
def playVideo(suburl,videoId):
        print videoId
        vidinfo = videoId.split("_")[0]
        xbmcPlayer = xbmc.Player()
        xbmcPlayer.play(videoId)
        xbmcPlayer.setSubtitles(suburl)

and Kodi 15 loads the srt file, but in Kodi 16 and 17, it doesn't load and nothing is shown in the log. Tried with suburl being a URL to the sub file, and also tried with a local path/filename, neither seem to do anything. Using the UI to get the local sub file does work.

scott s.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Matrix see: Aeon MQ5 Mod Matrix release thread
Nexus see: Aeon MQ5 Mod Nexus release thread
Aeon MQ 5 skin and addon repo 11.1.0
Reply
#2
So thanks to another user it appears the problem is that calling setSubtitles before the player starts results in the function being ignored. User added a loop to check for .isPlaying() which now works but seems inefficient. Maybe better is to use onPlaybackStarted?, though not sure how to correctly use that.

From looking at Kodi player code it does appear that the player needs to be playing before subtitle functions work. Not sure why the add-on was working in Isengard -- maybe just luck.

scott s.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Matrix see: Aeon MQ5 Mod Matrix release thread
Nexus see: Aeon MQ5 Mod Nexus release thread
Aeon MQ 5 skin and addon repo 11.1.0
Reply
#3
Known issue. You can use Listitem.setSubtitles, then setResolvedUrl, to set it before playback.
Reply
#4
Thanks. I will give it a try.

scott s.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Matrix see: Aeon MQ5 Mod Matrix release thread
Nexus see: Aeon MQ5 Mod Nexus release thread
Aeon MQ 5 skin and addon repo 11.1.0
Reply

Logout Mark Read Team Forum Stats Members Help
Possible bug in xbmc python class Player().SetSubtitles(filename)?0