W3C home > Mailing lists > Public > public-html@w3.org > February 2013

Re: programming difficulties with addcue

From: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
Date: Sun, 10 Feb 2013 13:52:40 +1100
Message-ID: <CAHp8n2nnk491DWvFQ-yr2aBx6MRXcY2JT7+cpUm7zdSAJGtPng@mail.gmail.com>
To: GIDEON ISAAC <mad.gideon.isaac@hotmail.com>
Cc: public-html@w3.org
This is not really the right list to post this to, but since we have an
interest in inter-operable implementations, I'll indulge you.

Which IE version did you use? I just discovered that Longtail did some
analysis on what track features are supported in which browser, see
http://www.longtailvideo.com/html5/scripting/ . It seems while IE10
supports the <track> element, it does not support the JavaScript API to
create tracks.

On Chrome it worked for me perfectly. Since you didn't actually tell it to
display the track, all it does is created the list. You need to add:
        myTextTrack.mode = "showing";

HTH.

Regards,
Silvia.

On Sun, Feb 10, 2013 at 8:37 AM, GIDEON ISAAC
<mad.gideon.isaac@hotmail.com>wrote:

>  I don't know if this forum is appropriate for programming mistakes, but
> here is a problem I'm running into.  I have the following code:
>     $(document).ready(function () {
>
>          myPlayer = document.getElementById("player");
>             var myTextTrack;
>
>
>          myTextTrack = myPlayer.addTextTrack( 'subtitles','myLabel','en' );
> var cue0 = new TextTrackCue(3.400,18.190, ' One giant payback');
> cue0.id = 'cue0';
> myTextTrack.addCue(cue0);
> var cue1 = new TextTrackCue(18.190,25.260, ' How can you catch a pink
> butterfly.!');
> cue1.id = 'cue1';
> myTextTrack.addCue(cue1);
> var cue2 = new TextTrackCue(25.260,32.320, ' one last comment.');
> cue2.id = 'cue2';
> myTextTrack.addCue(cue2);
>
>      });
> The actual video html is:
>
> <center>
>  <div id="HoldPlayer" style="position:relative">
>
>  <video id='player'  controls autoplay width='783' height='587' preload
> onerror='failed(event)'>
> <source src='http://www.rateforsuccess.com/mp4s/big-buck-bunny.webm'
> type='video/webm' />
> This browser does not support this type of video
> </video>
>
>  </div>
>  </center>
> I think this should work, but in Internet Explorer I get a message that
> 'addTextTrack' is an unknown method, and in Chrome, the video plays, but I
> don't get any subtitles.
> Just scanning this - is there something I'm missing?
> Thanks,
> Gideon
>
Received on Sunday, 10 February 2013 02:53:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 10 February 2013 02:53:35 GMT