Current Position:Home > FLVPlayback / Custom NCManager Problems

FLVPlayback / Custom NCManager Problems

Update:11-30Source: network consolidation
Advertisement
I have been trying for days to write my own custom NCManager
class that allows us to connect to a Limelight stream. We have to
issue a NetCOnnect.call() that has the command "FCSubscribe" and
the stream name. I've written a 100% custom player
(www.god.tv/stream) (have to register!) but what I want to to
resolve that player with the video-on-demand player
(www.god.tv/god) into a single Flash project.
I want to allow our Graphics guys (aka Flash developers) to
be able to use the standard Adobe FLVPlayback components and skins
and also be able to p lay back files, streaming content and
Limelight content. To this end I thought that writing a custom
NCManager class would be the way to go.
I have 99.9% succeeded: my class gets the connectToURL(),
connects to Limelight, subscribes and all is well but I am really
really stuck now on how to tell the FLVPlayback component that it
can start playing back now that the stream is connected.
What really is stumping me is that my project is AS3 yet the
FLVPlayback and VideoPlayer parts appear to be AS2 and I cannot
call the rtmpStatusInfo() function on the VideoPlayer part to tell
it that it is good to go.
I am so close I can taste it: If I create a NetStream object
and play() it, I can hear the content to I know that if I could
only get the FLVPlayback / VideoPlayer dynamic duo to playback then
the job would be done.
I have attached the code, warts and all in the hope that
either somebody has done this before or can tell me what I have
misunderstood about the internal state-machine / FSM logistics that
VideoPlayer et al implement.
By reading the source code and my debugging statements I can
see that I have maneuvered it towards the ultimate goal of playback
but I don't know how to make that final step.
Thanks in advance,
Sean Charles.
PS: I *know* that reconnect() is non-functional but if I
uncomment the call all it does is go around the loop again; the
real problem is I cannot tell the VideoPlayer that it can play (via
rtmpStatusInfo) the data etc
PPS: The meta-data related stuff *only* gets called if I
uncomment the NetStream code; this was to check that I had a valid
playback stream, which I do at that point.

The Best Answer

Advertisement
I was able to successfully make this work for our company's Adobe Flash video player using Flex Builder 3 running the Flex 3.3 SDK with the latest version of FLVPlayback 2.5.
Here is the custom NCManager class I created:
package com.companyname {
    use namespace flvplayback_internal;
    import fl.video.*;
    import flash.net.NetConnection;
    public class NCManagerLimelight extends NCManager {
        public function NCManagerLimelight() {
            super();
        override flvplayback_internal function onConnected(p_nc:NetConnection, p_bw:Number):void {
            super.onConnected(p_nc, p_bw);
            this.netConnection.client = com.companyname.ConnectClientLimelight;
            this.netConnection.call("FCSubscribe", null, this.streamName);
As you can see, it references a custom ConnectClient class I extended, which follows:
package com.companyname {
    use namespace flvplayback_internal;
    import fl.video.*;
    import flash.net.NetConnection;
    public class ConnectClientLimelight extends ConnectClient {
        public function ConnectClientLimelight(owner:NCManager, nc:NetConnection, connIndex:uint=0) {
            super(owner, nc);
        public function onFCSubscribe(info:Object):void {
            // do nothing
        public function onFCUnsubscribe(info:Object):void {
            // do nothing
The above class really does nothing except prevent the debug errors it would throw if onFCSubscribe was not defined.  Finally, you put it all together by placing those two files (named NCManagerLimelight.as and ConnectClientLimelight.as respectively) in a folder structure that matches your package namespace off of the src folder for your Flex project.  In the above code, I used com.companyname, so you would want to place the two files in a folder located at src/com/companyname in your Flex project.
Be sure to import the NCManagerLimelight class in your own source code by doing the following:
import com.companyname.NCManagerLimelight;
Then, right before you instantiate your FLVPlayback (where isLive is set to true for a live show) do the following to make your new NCManager class the default class for all video players:
VideoPlayer.iNCManagerClass = NCManagerLimelight;
Lastly, after you instantiate your FLVPlayback instance, you need to make sure it's isLive and autoPlay properties are both true.  For example:
flvPlaybackInstance.autoPlay = true;
flvPlaybackInstance.isLive = true;
I hope this helps!
Regards,
Sean Smith
  • FLVPlayback / Custom NCManager Problems Update:11-30

    I have been trying for days to write my own custom NCManager class that allows us to connect to a Limelight stream. We have to issue a NetCOnnect.call() that has the command "FCSubscribe" and the stream name. I've written a 100% custom player (w

  • Customer Service Problems Update:10-11

    After fighting with Verizon customer service over two service issues without any possibility of resolution I am canceling my account.  I’m doing this reluctantly because as a long-term shareholder of Verizon I would like to see the company succeed an

  • Combo of T61 and customer support problems Update:11-30

    My main problem is that my T61 freezes up.  It came with a 2 gig ram, sbbb Intel core 2 duo t7500 processor, 1 gig turbo memory window's ultimate 32 bit os and an 80 gig hard drive. This problem has been going on intermittently (odd) since I  receive

  • Custom Rule - Problem in passin values From Rule Container to WF Container? Update:10-11

    Hi Guys, I am having hard time passing values back from my custom rule. I have created a custom rule to determine the agents in PFAC which takes in the Person number as import element of container. It determines the Manager as agent and I am passing

  • Customer Replication problem from R/3 to CRM Update:10-11

    The scenario is: We have upgraded R/3 to 4.7 and the logical system names have changed. CRM is still the same one ( 4.0 ). Everything works fine. If I create an order it goes to R/3 and If I change an existing customer in CRM or R/3 it get replicated

  • Apple customer support problem 1st gen Time Capsule Update:10-11

    Not sure there is any real point to this since Apple doesnt seem to really engage in these forums.  However, I recently had a 1st gen. Time Capsule die per the well-documented power supply failure problem.  After some prodding I was able to get Apple

  • Custom command problems on Mac OS X Update:10-11

    I am seeing a problem with custom context commands in our custom connector that is also reproducible with the sample FTP connector shipped with the SDK.  I am using Adobe Drive 3.2.0.41 on Mac OS X 10.8.2 For my test I am connecting to a FTP server a

  • Mac OS / classpath / custom event problem Update:10-11

    I'm having a bit of trouble with a particular classpath anomaly, and I have a feeling that it might be a Mac thing. Not sure if anyone else can reproduce this, but I managed to make a custom event and a class that extends the EventDispatcher once. Si

  • CUSTOM REPORT PROBLEM - REP-1213 Update:10-11

    I am a student trying to complete a project. I developed a "custom" report form which uses 5 tables to generate the report. I have entered the 'fields' at various locations on the report form and when I run the report I get the following error m

  • Customized KeyboardFocusManager problems with JOptionPane-Dialogs Update:10-11

    Hi, I have a problem I'm not able to solve: With Java 1.4.2 unter Linux, as well as all newer Java Versions (1.4, 1.5, 1.6) under Windows, dialogs created by JOptionPane.showXXXDialog do not react to keyboard events like <Tab> any more when using a