Fixed Subtitles

j0anita

Developer
Sep 1, 2012
169
0
0
Portugal
I want to load subtitles into this video:

Code:
def play(finalurl):
        ok=xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(finalurl)
        addLink('Repetir Video',finalurl,'')
The link for example:
Code:
http://www.example.com/subtitle.srt

Nothing seems to work. I only want to load external fixed url subtitle.
Sorry for my bad english :(
Please help me ;)
 

Bstrdsmkr

New member
Mar 16, 2012
763
0
0
No need for the subtitles plugin if you already have the file, that's just for retrieving the file
If you scroll up in the documentation, you'll see that 'setSubtitles' is a method of the Player() class. You'll call it like this:
Code:
def play(finalurl):
    player = xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER)
    player.setSubtitles('mysubfile.srt')
    player.play(finalurl)
Finally, always use xbmc.PLAYER_CORE_AUTO, not xbmc.PLAYER_CORE_DVDPLAYER unless you absolutely have to. If you specify a player like that, platforms that need a different player such as Android and RasPi will play poorly
 

j0anita

Developer
Sep 1, 2012
169
0
0
Portugal
Thanks for your reply.
I had test your code and the player doesn't start. Opens a new blank dir. :(

EDIT: My mistake. :)
THANK YOU
 
Last edited: