jump to navigation

FLVPlayback with FLVPlaybackCaptioning October 29, 2007

Posted by headwinds in Actionscript.
trackback

By configuring the FLVPlayback and FLYPlaybackCaption components, you can quickly assemble a highly accessible video solution without writing a single line of code. The FLVPlayback components come with more than 20 skin configurations; except the one I needed under+play+rewind+progress+mute+ caption+fullscreen combo.

FLVPlayback

No worries. Instead of using one of the provided skins, I used the individual player control components and built the required combination. It was very easy to skin by drilling into each movie clip and changing the states like one would edit any movie clip.

This YouTube-like design also required a custom time display and 2 large buttons that doubled up the play and rewind functionality, and thus I decided to class out the components and see how they behave as part of a class [download my YouTubeLikeComponentPlayer.as ].

When placing and naming movie clips on the stage, it is important to turn off the “Automatically declare stage instances” setting:

setting

Declare them in your document class as public variables. For instance, my rewind component would be declared like “public var rewind_cp:MovieClip;”

I did not need to code any of the FLVPlayback functionality such as play, stop, or progress; all I had to do was listen to enter and hijack some of the activity to get the desired results.

I discovered a strange issue with the captioning text. If you use the example provided with Flash CS3 to reposition the text field outside of the embedded Flash Player, when the user changes to fullscreen mode, the text will appear in the centre of the screen and not the bottom! You need to listen to Event.ENTER_FRAME event to position the caption not the CaptionChangeEvent.CAPTION_CHANGE which may happen well after the user has escaped fullscreen.

In the end, I actually decided to abandon the caption-outside-video feature [I was trying to squeeze it in too late in the game and simply ran out of time as it also impacted on the player design ] and left it in the default position, but its good to know that I could send the text to a custom captioning display. In the future, I’ll definitely recommend that solution so that the player could react and slide out a slick captioning panel.

Comments»

1. Caption timing for FLVs « Carlo Alducente - November 6, 2007

[...] can use the FLVPlaybackCaptioning component that Brandon Flowers mentioned in his blog post to do the rest if you [...]

2. Carlo Alducente » Blog Archive » Caption timing for FLVs - December 3, 2007

[...] can use the FLVPlaybackCaptioning component that Brandon Flowers mentioned in his blog post to do the rest if you [...]

3. Lance - January 29, 2008

I need help in keeping the control components of FLVPlayback from resizing in FULLSCREEN mode.

Example: http://asilance.com/web/PETE_03.html

Thanks in advance.

4. headwinds - January 31, 2008

the components do not resize if scale made is set N0_scale… are you sure you have the scale mode set to:

stage.scaleMode = StageScaleMode.NO_SCALE;

there is a well-documented full screen event that you can listen for, and then set the components to whatever size you wish… but I’d recommend not resizing them at all.

5. TM - November 10, 2008

Hi There,

I was wondering if you could please post the Fla you implement the above mentioned class with? I’m just getting my head around AS3 and this player configuration is almost exactly what I’m trying to implement. The videos I have to display use Captionate injected captions, so my old AS2 captioning method is no good in this instance.
Many thanks, Tom

6. headwinds - November 10, 2008

I recreated the fla and included the caurina tweener package in this zip:

download new source

there are also a couple custom buttons and movieclips that you can easily skin by finding them in the library.

7. TM - November 10, 2008

Many thanks,T

8. Julian Calzada - January 26, 2010

Has anyone corrected the captions from jumping around in fullscreen? I tried the code above, but it simply makes the jump worse and more noticeable. Any help would be appreciated.

Flash Player 10, CS4