You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Caption Formatting options Created Nov 17, 2009

This thread is solved

Views: 466     Replies: 5     Last reply Nov 20, 2009  
You must login first before you can use this feature

mikebrant

Posts: 5

Registered:
Nov 17, 2009

Caption Formatting options

Posted: Nov 17, 2009

I have been playing around with the captions plugin for use with timed text files, and have been running into what seem to be limitations in regards to text formatting.

I was hoping to be able to use different font styles within a single caption p element via use of span tags (an allowable XML node type per W3C). Unfortunately, it seems as if the XML parser will not handle these tags, as when added, the text within the span node fails to display.

Similarly, I was hoping to be able to add line breaks using a br node (another allowable node type per W3C), however the line breaks are not rendered.

My main goal here is to be able to display some text content in a content plugin that will display alongside my video and be able to be automatically changed as the video is played. I should also note that my flowplayer instance works in conjunction with a playlist, so it is not really feasible to use onCuePoint configuration with just the content plugin, as the cuepoints and text content will vary between videos.

I am wondering if I am attempting to do this improperly or whether the parser being used simply does not handle all allowable element types as specified in W3C for timed text.

I have not yet investigated working with Subrip files, but would certainly be willing to so if they allow better formatting options.

Any other advice on how this might be achieved would be welcome.

gmccomb

Posts: 673

Registered:
Apr 9, 2009

» Caption Formatting options

Posted: Nov 17, 2009

Reply to: Caption Formatting options, from mikebrant
I haven't looked at the parser Flowplayer users, but it's not a simple task to render text that's been formatted in "runs" as you describe.

There has been some third party work along these lines to enhance what Flowplayer has, like this one:

http://www.hirodev.com/flowplayer/Caption.as.txt

but I don't think it does anything more with TT XML than what you have already. Worth a look, though.

mikebrant

Posts: 5

Registered:
Nov 17, 2009

» » Caption Formatting options

Posted: Nov 17, 2009

Reply to: » Caption Formatting options, from gmccomb
I believe that is just the source actionscript file associated with the flowplayer caption plug-in. I had actually pulled down the source and glanced through it yesterday to see if I could gain any additional insight as to how the caption plug-in actually works.

Thanks for your help.

blacktrash
underdogma: free videos at http://www.blacktrash.org/

Posts: 863

Registered:
May 27, 2008

» Caption Formatting options

Posted: Nov 17, 2009

Reply to: Caption Formatting options, from mikebrant
You say "alongside" the video? Do you know the texts for each clip in the playlist in advance? If yes, you could work with cuepoints and in JavaScript only. This player displays the lyrics of the songs it is playing simultaneously. I'm telling you it's at the bottom of the page (nevermind the terse aesthetics), otherwise gmccomb will tell me again that no one can find the player ;-)

You could do the same with a video.

mikebrant

Posts: 5

Registered:
Nov 17, 2009

» » Caption Formatting options

Posted: Nov 17, 2009

Reply to: » Caption Formatting options, from blacktrash
I should clarify my setup.

I have a single flowplayer instance, which has within its canvas both the screen where the video plays and a area created with the content plug-in where I am putting text commentary populated via the caption plug-in.

The video to be played is selected from an external playlist which utilizes the javascript playlist plug-in. When a video is selected from the playlist, an onStart event fires which loads the appropriate timed text file into the player to present the commentary along with the video.

I am not really using the captions for the purpose of captioning the voice track of the video. Rather I was intending it to show commentary related to the video. As such, the commentary will not be refreshing as often as caption of the voice track would. So, in order to present the information clearly, I would like to be able to use line breaks/paragraphs as well as different text formatting within a single caption.

It seems that using the captions plug-in, however, that I am limited to only providing a single style for any given caption (i.e. each 'p' node in the timed text file can only have one defined style). I would be happy just to be able to insert line breaks if this is possible, so that at least I could format the commentary into paragraphs, but I have not found out how to create a line break.

I would consider using cuepoints, at which I would update the content container, however I don't think the API supports all the functionality I would need to do this. I can't add cuepoints in the flowplayer configuration, as the cuepoints will vary for each video. So I would need to programmatically add cuepoints when loading each video. This would be some work to achieve but is feasible, however, I do not believe there is a way to actually remove cuepoints once they had been added. This would prevent me from being able to use such an approach.

dherbst

Posts: 69

Registered:
Apr 20, 2009

» » » Caption Formatting options

Posted: Nov 20, 2009

Reply to: » » Caption Formatting options, from mikebrant
If you did the cuepoints yourself you would be essentially rewriting the captions plugin, since all it does is create cuepoints for the captions and then display them.

To your original question, I am able to insert line breaks with the br tag in subrip files:


1
00:00:03,114 --> 00:00:13,255
This has<br>
three<br>
lines of text