FlashComGuru Home InfluxisCDNImediaseeUvault
                                                                                       Forum Index | Active Topics | Register
                                                                                                          List Overview | List Archives
                                                                                                                           About this site | Advertise
 

home

Adobe AIR (11)
Applications (40)
Books & Training (11)
Collaboration (18)
Components (10)
Events (80)
Flash Player (35)
Flex (39)
FMS (110)
General (123)
Hosting (6)
Jobs (17)
Off topic (36)
OSMF (3)
Press Releases (23)
Site Check (11)
Tools (53)
Videos & Players (74)

Follow me on Twitter

 
Alongside the recently released Flash Media Server 3.5 and its Dynamic Streaming and DVR capabilities Adobe have also pushed out an updated version of their FLVPlayback component. As Andrew Shorten explains, this component can be used in both Flash or Flex since it is not based on UIComponent. In short, FLVPlayback brings a more fully featured video component to Flex (dare I say finally), and while most of us have a love-hate relationship with this baby it's certainly good news for the platform, and you no longer have to 'port' your Flash based FLVPlayback component to Flex now (as I did here).

I gave the component a quick test drive and wrapped it into a Flex project that you can download and try yourself. The demo below uses FMS for streaming, the downloadable project uses a progressive download. Note that I'm using Oleg's excellent Swfobject 2.1 Flex template and I added the allowFullScreen parameter for this example and removed the history management (not really needed for a plain video player). Sources here.

Comments
[Add Comment]
It seems there is a bug in the sourcecode of the NCManager class, I noticed that when I copied the NCManager class in order to create a custom NCManager class for one of my applications.
A call to onconnected is missing in the netStatusHandler (line 1439 in the version I downloaded 2 days ago from the Adobe website)

Just add the following line in the source after the call to cleanConns() when the "NetConnection.Connect.Success" status code has been received:
onConnected(_nc, 0);

Besides that the 2.5 FLVPlayback component seems to be just a minor update to the flvPlayback component you ported earlier, mainly adding the DVR functionality.
Including the flvPlayback sources in Flex projects is pretty cool because its easy to extend or change some of it's behaviour.
# Posted By Jan Pies | 1/16/09 10:29 PM
That's not a bug in NCManager.as, it's actually that way by design. The NCManager class is designed to work with a special sever-side application that when a client connects, the server initiates bandwidth detection. The sever-side app will then call onBWDone on the NetConnection's client object, which will then call onConnected. Also, if you wish to use the new Dynamic Streaming features in the component, you will need to base your custom NCManager off of NCManagerDynamicStream so that you get the correct properties and methods.
# Posted By Brad | 1/16/09 11:22 PM
I'm getting following error in Flex:
1046: Type was not found or was not a compile-time constant: NetStreamPlayOptions.   

Any idea what might be wrong?
# Posted By Tuomas | 1/22/09 9:15 AM
Tuomas, are you sure you are using the Flex 3.2 SDK?
also make sure you change your project properties to target Flash Player 10.
# Posted By Stefan Richter | 1/22/09 9:21 AM
Like Stefan said, you'll need to make sure you set the target player for 10.0.0 inside of the project settings and have the 3.2 SDK. Flash Player 9 and 10 have different namespaces for AS3, so in order to get all the classes in the new namespace it has to use the compiler for FP10.
# Posted By Brad | 1/22/09 9:33 AM
I was using Flex 3.2 but with Flash Player 9 so that was the problem.

Thanks!
# Posted By Tuomas | 1/26/09 8:39 AM
Hey Stefan, great timing for me thanks for pointing this out.

Have you tried this in the latest Gumbo SDK? I've gone back to 3.2 now and it works well but if I remember rightly there was an error about "illegal override on method play2()". Just checking in with you to see if you've tried it on in 4.0?
# Posted By Richard Leggett | 2/12/09 3:53 PM
hi Richard,
sorry but I haven't tried in Gumbo yet.

Cheers

Stefan
# Posted By Stefan Richter | 2/12/09 4:08 PM
Thanks for this Stefan, that helped me a lot on my latest project :)
# Posted By Tiago | 2/13/09 1:37 PM
I am getting the 'illegal override on method play2().

I have the 3.2 and am using 10.0.0. How do I get around this problem?
# Posted By jimmy | 4/14/09 11:12 PM
Hello, everything its working fine and I'd like to expand this functionallities, I've created a function to add the FLVPlayback component according to the parameters:

private function addFLVPlayback(xpos:Number,ypos:Number):void
{...}

but i'd like to know how to put this componet inside a Panel or another container.

is that possible?
# Posted By Arthur Magno | 6/2/09 1:11 AM
Hi Arthur,

One way is to call rawChildren.addChild(flvPlayback) in the parent container.
# Posted By Richard Leggett | 6/2/09 8:33 AM
Sorry Richard Leggett, I did not get the idea.. I'm very newbie to Flex, here is it:

...
         private function addFLVPlayback(xpos:Number,ypos:Number):void
         {
             var vid:FLVPlayback = new FLVPlayback();
             var ui:UIComponent = new UIComponent();
             ui.x = xpos; ui.y = ypos;
             this.addChild( ui );
             rawChildren.addChild( vid );
             
             vid.width = 424;             
             vid.height = 240;
             vid.autoPlay = false;
             vid.source = "fuel.mp4";
             vid.skinBackgroundColor = 0x990000;
             vid.skin = "skins/SkinUnderPlayStopSeekFullVol.swf";
             vid.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
             vid.skinAutoHide = false;
          }
      ]]>
   </mx:Script>
   <mx:Panel id="main" x="10" y="10" width="780" height="581" layout="absolute" title="DMTV Station">
      <mx:Button x="10" y="287" label="Load DMTV" click="addFLVPlayback(20,20)"/>
   </mx:Panel>


how can I add the FLVPlayback component into this Panel ?

Sorry for being redundant. I tried using rawChildren but i don't know where can I call the video.
# Posted By Arthur Magno | 6/2/09 1:35 PM