0 Replies Latest reply on Mar 17, 2011 8:07 AM by DJDonovanNYC

    OSMF 1.5 - Buffering UI - SerialElement with PreloadingProxyElement

    DJDonovanNYC

      Hoping someone can help me with a few issues that I am seeing. I'm starting to think there is a bug with the buffering and using PreloadingProxyElement, but it's possible that I am using it in the wrong way.

       

      The first question, is there a concise and self contained example that explains the method for monitoring the buffering of a video? I know how to determine if the player is buffering using the buffer traits, but trying to get some sort of progress and percentage is eluding me.

       

      That being said I have a video player that supports SerialElement videos if there is more then one and I am using the LightweightVideoElement along with PreloadingProxyElement and I am getting this error when there is a slow connection:

       

      TypeError: Error #2007: Parameter listener must be non-null.

      at flash.events::EventDispatcher/addEventListener()

      at MethodInfo-2070()

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at org.osmf.media::MediaElement/setLocalTrait()

      at org.osmf.media::MediaElement/addTrait()

      at MethodInfo-1688()

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at org.osmf.traits::TimeTrait/durationChangeEnd()

      at org.osmf.traits::TimeTrait/setDuration()

      at org.osmf.net::NetStreamTimeTrait/onMetaData()

      at Function/http://adobe.com/AS3/2006/builtin::apply()

      at org.osmf.net::NetClient/invokeHandlers()

      at MethodInfo-767()

       

      Here's the code I am using to create the videos from an XML list of videos (keep in mind I was using only one video but I doubt that would be an issue):

       

      _videoElements = new Vector.<LightweightVideoElement>();

       

      _serialElement = new SerialElement();

       

      for (var i : int = 0; i < videoList.length(); i++) {

      _videoElements[i] = new LightweightVideoElement();

      _videoElements[i].resource = new URLResource(videoList[i].src);

      _serialElement.addChild(new PreloadingProxyElement(_videoElements[i]));

      _videoElements[i].addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layoutMetadata);

      _videoElements[i].addEventListener(MediaElementEvent.TRAIT_ADD, onMediaElementTraitsChange);

      //_videoElements[i].addEventListener(BufferEvent.BUFFERING_CHANGE, onBufferUpdated);

      _videoElements[i].smoothing = true;

      }

       

       

      It seems like the traits are not properly being inited and depending on how slow the connection is, it's creating an issue. I moved to a single video configuration just as a quick fix and it seems to be fine using this code:

       

      var media:VideoElement = new VideoElement( new URLResource(videoList[0].src));

      media.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layoutMetadata);

      media.addEventListener(MediaElementEvent.TRAIT_ADD, onMediaElementTraitsChange);

      media.smoothing = true;

       

       

      Wondering if this is a bug when using buffering with the proxy element and Serial playback?

       

      Any insight into any of my questions would be greatly appreciated.

       

      Cheers,

      Donovan