5 Replies Latest reply on Nov 19, 2010 12:43 AM by Nicolas Siver

    Connection netStatus

    Nicolas Siver Level 1

      Within OSMF, Where is the best place for listening NetConnection NET_STATUS?

      I need perform some auth logic at Connnection Success handler.

        • 1. Re: Connection netStatus
          Nicolas Siver Level 1

          Is it NetNegotiator? So, for soft plugin development with my own connection logic should I create my own NetConnectionFactory that will use custom NetNegotiator? Or maybe some best practice around this task?


          Message was edited by: Nicolas Prof

          • 2. Re: Connection netStatus
            Andrian Cucu Adobe Employee

            Hi Nicolas,


            I think you should start by creating your custom NetLoader. You can do this in a plugin, but this is not necessary if you build a custom player.


            I suggest you explore the code we have for this in Strobe Media Playback. You can get the source code from here:



            You can start exploring with the StrobeMediaFactory class: player\StrobeMediaPlayback\src\org\osmf\player\media\StrobeMediaFactory.as


            There are also some other threads in this forum which provide some context.


            Let us know how it goes,


            • 3. Re: Connection netStatus
              Nicolas Siver Level 1

              Sorry, nothing interesting in Strobe Media Playback.

              StrobeMediaFactory creates Media elements with Loaderbase objects, of course I need custom LoaderBase thus I started from NetLoader, because I need connection options with various available ports/protocols.

              Only one problem, I need override huge NetConnectionFactory 'create' method for using custom NetNegotiator.

              In NetNegotiator I can listen to Success, use my logic for auth, and after responce from server, dispatch NetConnectionFactoryEvent.CREATION_COMPLETE Event.



              I propose pass INetNegotiator to factory 'create' method. Thanks.


              Message was edited by: Nicolas Prof

              • 4. Re: Connection netStatus
                bringrags Level 4

                Not sure exactly what type of auth logic you need to add, but you could look at the AkamaiBasicStreamingPlugin:


                http://opensource.adobe.com/svn/opensource/osmf/trunk/plugins/samples/AkamaiBasicStreaming Plugin/


                This plugin handles authentication for Akamai streams, by overriding specific methods in the NetLoader/NetConnectionFactory classes, perhaps you could take a similar approach.


                If you need to implement some logic after the connection has been established, then you could override NetLoader, intercept (and stop propagation of) the creationComplete event, do your logic, then redispatch the creationComplete event.

                1 person found this helpful
                • 5. Re: Connection netStatus
                  Nicolas Siver Level 1

                  I found 'processCreationComplete'. Thanks for advice.

                  I can perform any custom processing and after call 'finishLoading'