After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 560946 - Add subtitle support to the browser plugin
Add subtitle support to the browser plugin
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Browser plugin (obsolete)
2.23.x
Other All
: Normal enhancement
: ---
Assigned To: totem-browser-maint
totem-browser-maint
Depends on:
Blocks:
 
 
Reported: 2008-11-15 17:43 UTC by Sébastien Adgnot
Modified: 2009-11-20 20:10 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
demo of the subtitles in a video played vy VLC plugin player (2.22 KB, text/html)
2008-12-12 16:17 UTC, Sébastien Adgnot
Details

Description Sébastien Adgnot 2008-11-15 17:43:38 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.
Comment 1 Bastien Nocera 2008-11-15 17:52:43 UTC
Nope. You can already load arbitrary subtitle files through right-clicking on the video file in the playlist.
Comment 2 Sébastien Adgnot 2008-11-16 08:43:38 UTC
(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.
Comment 3 Bastien Nocera 2008-11-16 10:33:56 UTC
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.
Comment 4 Sébastien Adgnot 2008-11-16 11:42:07 UTC
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.
Comment 5 Daniel Drake 2008-11-16 12:46:27 UTC
(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.
Comment 6 Bastien Nocera 2008-12-05 16:32:12 UTC
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.
Comment 7 Sébastien Adgnot 2008-12-09 09:15:48 UTC
Yes I'm gonna try to do it. It may take a while but I will keep you posted.

Thanks again for your help.
Comment 8 Sébastien Adgnot 2008-12-12 16:15:40 UTC
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
Comment 9 Sébastien Adgnot 2008-12-12 16:17:08 UTC
Created attachment 124533 [details]
demo of the subtitles in a video played vy VLC plugin player
Comment 10 Martijn van de Streek 2009-06-04 18:55:31 UTC
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&amp;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&amp;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&amp;md5Code=8d3418a07f6cf9eb390f40247d99d971" name="SAMIFileName"><param value="captions" name="captioningID"></object></object>
Comment 11 Bastien Nocera 2009-11-18 13:56:49 UTC
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
Comment 12 Bastien Nocera 2009-11-18 15:56:33 UTC
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.
Comment 13 Bastien Nocera 2009-11-18 16:04:15 UTC
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?
Comment 14 Bastien Nocera 2009-11-20 16:31:04 UTC
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?
Comment 15 Bastien Nocera 2009-11-20 17:08:37 UTC
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.
Comment 16 Sébastien Adgnot 2009-11-20 17:41:19 UTC
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
Comment 17 Bastien Nocera 2009-11-20 17:57:56 UTC
(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?
Comment 18 Sébastien Adgnot 2009-11-20 18:03:48 UTC
the site is already live but the Sugar OS which is using the Totem plugin should be updated first.
Comment 19 Bastien Nocera 2009-11-20 18:13:14 UTC
Do you have a few more examples of pages where you use subtitles?
Comment 20 Sébastien Adgnot 2009-11-20 20:10:47 UTC
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