2 Replies Latest reply on Mar 9, 2011 1:00 PM by turbidity

    Still trying to get to the NetStream Object

    jgsacirs

      Hi, I am trying to get to the NetStream object so that I can listen to the NetStatusEvents. Unfortunately the code listed on:

       

      http://forums.adobe.com/message/2725207

       

      no longer works. Is there another way? Thanks.

        • 1. Re: Still trying to get to the NetStream Object
          jgsacirs Level 1

          I didn't thought this would be so hard. More to the point, if this is so hard maybe there is something wrong with the framework architecture. One would think that being able to register to the NetStream event should be rather important.

          • 2. Re: Still trying to get to the NetStream Object
            turbidity

            It can be frustrating, especially when the workflow is so different from what we are used to with video. The idea behind the structure is to let OSMF manage the stream and expose needed events on the MediaPlayer. It definitely is a different way of doing things, but most events you need can be gotten from there.

             

            That being said, somethings require the NetStream object. You can extend the VideoElement, which is passed a NetLoader in its constructor. You can get the NetStream off the loader, though it is a good idea to check if it is there, since loader can be one of many classes that may not have the netStream property.:

             

            if( elementLoader.hasOwnProperty( 'netStream' ) )

            {

              var netStream:NetStream = elementLoader[ 'netStream' ];

            }

             

            Of course, if you're using a MediaFactory, you may need to customize it to use your custom VideoElement.

             

            Hope that helps.