views:

359

answers:

2

Hello,

Im looking into using and customizing FLVPlayback in a project. How to go about this is clear, but I noticed 1 anoying thing. When going fullscreen, first Flash player goes fullscreen and then briefly shows the FLVPlayback component in its original size, before jumping to show the video itself fullscreen.

I noticed on Youtube this doesnt happen. How can I escape this 'flicker' and have the video go fullscreen as the videos do on youtube?

Thanks a lot for any tips!

Marcel

A: 

in general FLVPlayback along with most of the components built into flash are junk. You are much better off building your own flv player using the NetConnection and NetStream class. Build it once well and generic enough to edit the control visuals and you have yourself a bullet proof flv player for all your projects.

http://actionscriptexamples.com/2008/02/26/loading-flv-files-in-actionscript-30-using-the-netconnection-and-netstream-classes/

David Morrow
@David Morrow. I agree about the component having a number of annoying bugs. I think the main cause of most of them though, is the sad fact that it's built on top of a buggy, unreliable and badly documented API (NetStream and NetConnection suck). For instance, events that are supposed to be fired never fire, or just fire on some cases, which is up to you to figure out. Consider, for one, the appalling ammount of trickery required for something as simple as detecting the end of a video. Not hard to code it to sort of work, but getting it right is not that trivial (and should be, if you ask me).
Juan Pablo Califano
youre right, i for example in my custom flv playback solution that i reuse on my projects, have all kinds of logic for when the flv loads with no metadata which happens often even when the flv has metadata, the event just sometimes doesnt fire. Im pretty sure that youtube is not using the flvplayback component...What i meant is that its better to build your on than to use a component built on top of these buggy classes, at least if its yours you can support it instead of just wondering why it doesnt work.
David Morrow
Agreed. I too had to write video players from scratch, both in AS 2 and AS 3, though I wished I could have used FLVPlayback (which is rather gready on resources and also leaks memory to add insult to injury). I'd also add to this little rant that there are annoying inconsistencies between progressive / streamed video (which you have to account for if you want to loop your video, for instance).
Juan Pablo Califano
Also, I don't know what were they thinking when they made callbacks throw if you don't have a method to handle them. A streaming server can fire a callback you don't even know it existed (and name it whatever it feels like) and blow up your player in the process. So to be safe you have to resort to extending Proxy in your NetConnection client to catch these misterious calls. Funny that video has been one of the driving forces of Flash. Truth is, it's awful to work with and quite buggy. Sigh. End of rant ;)
Juan Pablo Califano
A: 

Just to say I've used FLVPlayback on jobs many times, and sure it's buggy, but I've never seen this problem. You can definitely fix it. How are you going fullscreen? I've recently being doing something like this...

import flash.display.*;
import flash.events.*;
import fl.video.*;
import flash.geom.Rectangle;

.
.
.

myFLVPlayback.fullScreenTakeOver = false;
mc.stage.fullScreenSourceRect = new Rectangle(0,0,480,360);
myFullScreenButton.addEventListener(MouseEvent.CLICK, onFullScreenButtonClicked);

private function onFullScreenButtonClicked(e:MouseEvent):void {
  mc.stage.displayState = StageDisplayState.FULLSCREEN;
}

(though i appreciate you might be using the fullscreen button in an FLVPlayback skin, so this might not be perfect)

NOTE: I just hammered that code in so it might not be perfect/complete. Hopefully you'll find it useful.

++ i'd make sure you set the size and scale of your flvplayback too, e.g. myflvplayback.setSize(w,h)

++ how about myflvplayback.scaleMode = VideoScaleMode.NO_SCALE;

chichilatte