moreginger / xbmc-plugin.video.ted.talks

GNU General Public License v2.0
18 stars 20 forks source link

Subtitles support #10

Closed cristim closed 12 years ago

cristim commented 12 years ago

The plugin should show the subtitles if available, choosing the language according to the priority set globally in XBMC.

As a plus it could have a way to override the priority inside the plugin, in case people would like to see the talks with English subtitles even if they usually watch movies subtitled in their own language.

moreginger commented 12 years ago

Thanks. I didn't know they had them - it would be a good enhancement.

Notes

Doesn't look like you can get them in a nice format (e.g. srt) without some trickery:

Also, can't see API to set it on ListItem as a property, might need to set on running video? e.g. xbmc.Player().setSubtitles('http://link-to-srt-file')

moreginger commented 12 years ago

There seems to be enthusiasm for this right now for some reason: see http://code.google.com/p/xbmc-addons/issues/detail?id=35

moreginger commented 12 years ago

Also requested here

amet commented 12 years ago

xbmc.Player().setSubtitles('link-to-srt-file') is your only option ATM. get the JSON subs, convert them to srt, save in addon_data and activate from there.

moreginger commented 12 years ago

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=f4f7af96f6a0e2b07531027b6c6e13a6ec814823

rafaelperrone commented 12 years ago

Any idea on how we are supposed to set the language when using a two variety language (such as Brazilian Portuguese or Canadian French)? Already tried pt-br, ptbr, pt-BR,br, br-pt,brpt and maybe others with no success.

Update: Tried setting global xbmc language to Brazilian Portuguese and a blank subtitle option under TED addon. A Portugal Portuguese subtitle was displayed and I am sure the video I was experimenting with has Brazilian Portuguese subtitles available.

moreginger commented 12 years ago

Thanks for the feedback.

Oh whoops. I bodged a regex and it won't spot that two part language codes are available. I'll commit the trivial fix soon and ask for a pull.

It looks like you'll need to use custom code pt-br after that. It won't be able to map from xbmc language "Brazilian Portuguese" to pt-br. If anyone knows how to get xbmc to give me the language code for the system language then please let me know :)

moreginger commented 12 years ago

Fixed in d850d4c7a2220041711ed29d7109f02c9ff8d4ed

rafaelperrone commented 12 years ago

Thanks for the quick fix! How can I make update my system?

moreginger commented 12 years ago

I've requested a pull into XBMC eden repo. They are usually pretty fast, so it should come through in the next day or two.

moreginger commented 12 years ago

http://sourceforge.net/mailarchive/forum.php?thread_name=CAJMG0Wpe6zcS2-ktXcUX3K7HiP4zeL9WqTxQ%3D1A%2BsopsOUrWXA%40mail.gmail.com&forum_name=xbmc-addons