Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Controling of captioning (subtitling)

10 replies [Last post]

I'am looking for a possibility to control subtitelingvia JS.

1. start the movie with caption as default
2. switchto an other XML things (TT)

Any ideas?

from the [url=http://www.jeroenwijering.com/embed/readme.html]readme[/url]:

usecaptions (true,false): Set this to false to force the captions to hide by default.

captions (url): You can set this flashvar to the location of an external textfile with captions. The players support SMIL's TimedText format (example) and the SRT format (example) used with ripped DVD's. Set this flashvar to "captionate" if your FLV file has Captionate captions embedded. If you use multitrack Captionate captions, you can set this flashvar to "captionate0", "captionate3" etc. to display a certain track. A live example of different captions can be found here. You can also assign captions for every item in a playlist.

to change the captions file you must recreate the player - please see the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/linkplaylist.htm]linkplaylist[/url] demo from the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url] for simple example code for recreating a player from a link...

at this [url=http://www.jeroenwijering.com/extras/readme.html#customization]Customization[/url] it shows loadFile(file,title,link,id,image,author,captions,cat,start,type) cannot i load captions with loadFile({captions:'captions.xml'}) ?what is 'cat' ?is same as category/album for advertizing

hmm - you might be right! there is no captions demo up at the moment, so JeroenW might be working at it at the moment -
but if you do some experiments please let the forum know the result!

yes add caption works for loadFile() and addItem()

remember, captions is not main file, only auxiliary file

this is loading or adding complete file NOT replacing some caption file

  <a href="#" onclick="javascript:loadFile({author:'Author', title:'Title', file:'File.flv', captions:'Captions.xml'}); return false;">Load File Test</a>
  <a href="#" onclick="javascript:addItem({author:'Author', title:'Title', file:'File.flv', captions:'Captions.xml'}, 3); return false;">Add Item Test</a>

and item 0 bug shows too!

Thanx for your help. I think only with embedded captions (flvtools2 ? I can change the caption at run time without reloading the movie. Is it correct?
Here the playing ground:
http://tools.webmasterei.com/subtitlemaker/

Rainer

several option

jw playlist
Ranier - My Champion (German subtitle)
Ranier - My Champion (English subtitle)
Ranier - My Champion (French subtitle)

or outside of jw player and load choice with javascript
Ranier - My Champion (German subtitle)
Ranier - My Champion (English subtitle)
Ranier - My Champion (French subtitle)

once movie starts, you can only change subtitle by loading new movie with new subtitle auxiliary file

Good idea!

Now I cal via click

loadFile({
autostart:true,
author:'',
title:'Stalker',
file:'http://mm.webmasterei.com/stalkeromu.flv', captions:'./ut/srt2xml.php'});

But the movie will not start automaticly after loadFile and there is no request of caption file (I see it in firebug) and no captions appears ;-((
Is there a free version of integrating of captions like Captionate?

Rainer

you can't call autostart in loadFile()

use a small javascript function to simplify things and avoid having to make object notation in the links

function loadLang(authorLang, titleLang, fileLang, captionLang)
{
  loadFile({author:authorLang, title:titleLang, file:fileLang, caption:captionLang});
  setTimeout("sendEvent('playpause')", 250);
}

example image:
<input type=image onclick="javascript:loadLang('Ranier', 'My Champion', 'My Champion.flv', 'caption_German.xml'); return false;" src="german.gif" alt="German" />

example button:
<button onClick="javascript:loadLang('Ranier', 'My Champion', 'My Champion.flv', 'caption_German.xml'); return false;">Ranier - My Champion (German subtitle)</button>

example link:
<a href="#" onclick="javascript:loadLang('Ranier', 'My Champion', 'My Champion.flv', 'caption_German.xml'); return false;">Ranier - My Champion (German subtitle)</a>

more complex, but better is to:

(1) set a flag newLoad = true; instead of using setTimeout("sendEvent('playpause')", 250);

(2) in getUpdate()
(2a) check for player state and newLoad flag if((typ == 'state') && (pr1 == 0) && (newLoad == 'true'))
(2b) start the player sendEvent('playpause');
(2c) reset the flag set newLoad = false;

Thanx for your ideas.
[url=http://tools.webmasterei.com/subtitlemaker/]Here it runs a little bit[/url]

In a part of captions are pipes (|). I think it is for linebreaks.
I tried \n and <br>: Both doesnt work.

Is it a bug?

Now it is running wih realtime switch. It works without caption functionality of player:
[url=http://tools.webmasterei.com/test]here is a demo[/url]

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic).

More information about formatting options