3 Replies Latest reply on Dec 9, 2009 7:39 AM by bringrags

    GGTrackingPlugin

    lllgy Level 1

      I want to listen to the NetStatus event using a GGTrackingPlugin.swf. Can someone help me?

      Thanks.

        • 1. Re: GGTrackingPlugin
          bringrags Level 4

          Sorry for the slow response, we've all been heads-down trying to wrap up the sprint 8 features.  I'll write a longer response later if this one doesn't suffice, but here's the quick answer.  To access the NetStatusEvents, you need to gain access to the loaded context of the wrapped VideoElement, as it's the loaded context which holds the NetStream.  One way to do this is to modify GGVideoProxyElement.onLoadStateChange (source here) so that when the LoadState property is READY, you extract the loaded context from the ILoadable of the proxied element:

           

            var loadable:ILoadable = wrappedElement.getTrait(MediaTraitType.LOADABLE) as ILoadable;

            var netLoadedContext:NetLoadedContext = loadable.loadedContext as NetLoadedContext;

            var netStream:NetStream = netLoadedContext.stream;

           

          You can then add your listener to the NetStream. Let me know if this works for you.

          • 2. Re: GGTrackingPlugin
            lllgy Level 1

            Hi,
            I have tracked successfully the NetStatus event. Thank you.

             

            How can I calculate the start up delay? How to calculate the time difference?

             

            Thanks again.

            • 3. Re: GGTrackingPlugin
              bringrags Level 4

              The time difference can probably be calcuclated as the difference between the time that IPlayable.play() gets called (which maps to GGVideoProxyElement.processPlayStateChange) and the time that you get the NetStream.Play.Start event.  So you could start your time in processPlayStateChange and stop it in processLoadStateChange.