GNOME Bugzilla – Bug 560946
Add subtitle support to the browser plugin
Last modified: 2009-11-20 20:10:47 UTC
Now, Totem player supports local files as subtitle: e.g: file:///my_video.ogg#subtitle:my_video.srt Would it be possible to implement something like: http://www.myvideowebsite.com/videos/my_video.ogg#subtitle:http://www.myvideowebsite.com/subtitles/my_video.srt? Thanks.
Nope. You can already load arbitrary subtitle files through right-clicking on the video file in the playlist.
(In reply to comment #1) > Nope. You can already load arbitrary subtitle files through right-clicking on > the video file in the playlist. > I was talking about the Totem browser plugin actually. Here is an example of the way I use Totem: http://olpc.dailymotion.com/video/x75d5r_ours-polaire-2_tech Thanks for your help.
There's absolutely no support for subtitles in the browser plugin. What were you looking at doing exactly? We could probably add some API to handle that, but using a hacked up URL is out of the question.
I would like to be able to do what we've already done with a flash player like on this video: http://www.dailymotion.com/video/x6skw6. The subtitle file is here: http://ak.static.dailymotion.com/video_text/prod/x6skw6_en_subtitle.srt Thanks.
(In reply to comment #3) > There's absolutely no support for subtitles in the browser plugin. Just to clarify, this is exactly the feature being requested. We'd like the html code to be able to specify the address of a subtitle file, which would then be shown while the video is playing.
From the VLC mozilla documentation: http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC We can pass item specific options when adding MRLs to the playlist object: http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC#Playlist_object vlc.playlist.add(mrl,name,options): add a playlist item as MRL, with metaname 'name' and options 'options'. options are text arguments which can be provided either as a single string containing space separated values, akin to VLC command line, or as an array of string values. Returns a number as an item identifier in playlist (this is not a position in playlist). And the option would be "sub-file": http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC#Item-specific_options % vlc --fullscreen file1.mpg :sub-file=file1.srt :no-fullscreen file2.mpg :filter=distort Could you please create a web page that works using the VLC javascript, tested against VLC itself? Then I'll make sure Totem supports those features as well.
Yes I'm gonna try to do it. It may take a while but I will keep you posted. Thanks again for your help.
Hi Bastien, I just attached an html file. You should be able to watch a video with its subtitles in the VLC plugin player. One thing, if the video doesn't work it's maybe because of an anti-leech key. In this case go to http://olpc.dailymotion.com/video/x7ft2t_olpc-mission-video-part-1_tech to get the new link to the video in the source code. Thanks again. Sebastien
Created attachment 124533 [details] demo of the subtitles in a video played vy VLC plugin player
The Dutch TV started offering subtitles as an option today. They do this by adding a the following <param> tags to the body of the <object> tag: <param value="http://player.omroep.nl/ondertitels/?aflID=9605953&md5Code=8d3418a07f6cf9eb390f40247d99d971" name="SAMIFileName"> <param value="captions" name="captioningID"> It would be great if the browser plugin could at least support that :) The entire <object> tag looks like this: <object id="MediaPlayer" style="visibility: visible;" height="395" width="528"><param value="http://cgi.omroep.nl/legacy/player?/ceres/kro/rest/2009/KRO_1330579/bb.20090603.asf" name="url"><param value="true" name="autostart"><param value="1" name="showcontrols"><param value="1" name="stretchToFit"><param value="http://player.omroep.nl/ondertitels/?aflID=9605953&md5Code=8d3418a07f6cf9eb390f40247d99d971" name="SAMIFileName"><param value="captions" name="captioningID"><object style="visibility: visible;" type="video/x-ms-wmv" height="395" width="528"><param value="http://cgi.omroep.nl/legacy/player?/ceres/kro/rest/2009/KRO_1330579/bb.20090603.asf" name="src"><param value="true" name="autostart"><param value="true" name="ShowControls"><param value="false" name="ShowStatusBar"><param value="false" name="ShowDisplay"><param value="true" name="stretchToFit"><param value="http://player.omroep.nl/ondertitels/?aflID=9605953&md5Code=8d3418a07f6cf9eb390f40247d99d971" name="SAMIFileName"><param value="captions" name="captioningID"></object></object>
That bit won't work: vlc.playlist.clear(); The clear() function on the playlist object is deprecated in VLC and not implemented in Totem: http://wiki.videolan.org/Documentation:WebPlugin#Playlist_object
I'm using: vlc.playlist.items.clear(); now. But this weird thing happens: ** (firefox:24088): DEBUG: totemConePlaylistItems [0x7f11f75f9880] totemNPObject::HasProperty [0x7f11f75f9880] clear totemNPObject::HasProperty [0x7f11f75f9880] clear totemNPObject::HasProperty [0x7f11f75f9880] clear totemNPObject::HasMethod [0x7f11f75f9880] clear aName clear found totemNPObject::GetProperty [0x7f11f75f9880] clear ** (firefox:24088): DEBUG: NOTE: site gets property totemConePlaylistItems::clear I tried to debug it, but I can't understand why it tries to get the "clear" property instead of invoking the "clear" function. Christian, any ideas? Once this is fixed, I'll try to get the subtitle loading to be actually done in the viewer, and fix the queuing of commands when the viewer isn't ready.
I forgot to mention, Martijn, could you please file a separate bug for subtitle support in the WMP plugin, and mention a test URL as well?
Note that the support isn't quite finished, as we don't have any support for resolving URIs or subtitle files just yet. If you change your web page code in any way, could you please make sure you contact us so we can check whether there's any problems with it?
And the resolution of URIs is now in: c59b48103c1dc00bc1926c3c3a1cd7089d2bd57e Your test case works when changing the source, the playlist.clear() is simply ignored as not recognised.
Thanks a lot. not sure to understand this question however: "If you change your web page code in any way, could you please make sure you contact us so we can check whether there's any problems with it?", I don't see why would I change this test web page? Thanks again
(In reply to comment #16) > Thanks a lot. > > not sure to understand this question however: > "If you change your web page code in any way, could you please make sure > you contact us so we can check whether there's any problems with it?", I don't > see why would I change this test web page? Not the test web page, but if you implement the web page in your production environment differently, I'd like to know about it so I can test it. Is the site going to be live any time soon?
the site is already live but the Sugar OS which is using the Totem plugin should be updated first.
Do you have a few more examples of pages where you use subtitles?
I don't have other examples than the attached web page of this ticket. On Dailymotion we have videos with subtitles but that's a different story (like here http://www.dailymotion.com/video/x7f7jj_one-laptop-per-child-zimis-story-fu_school). On olpc.dailymotion.com, we don't handle subtitles yet until the Totem will support it in Sugar OS. But I will use the same way as the one in this ticket. Thanks