1 Reply Latest reply on Jun 1, 2010 9:06 AM by bringrags

    DualThresholdBufferingProxyElement in OSMF 0.95

    HilaKarimov Level 1

      Hello,

      I've downloaded the latest version of OSMF, and while running a program using DualThresholdBufferingProxyElement I've come across this code:

       

      public function DualThresholdBufferingProxyElement(initialBufferTime:Number, expandedBufferTime:Number, wrappedElement:MediaElement)
              {
                  super(wrappedElement);
                 
                  this.initialBufferTime = initialBufferTime;
                  this.expandedBufferTime = expandedBufferTime;
                 
                  var dispatcher:TraitEventDispatcher = new TraitEventDispatcher();
                  dispatcher.media = wrappedElement;
                 
                  wrappedElement.addEventListener(MediaElementEvent.TRAIT_ADD, processTraitAdd);
                  dispatcher.addEventListener(BufferEvent.BUFFERING_CHANGE, processBufferingChange);
                  dispatcher.addEventListener(SeekEvent.SEEKING_CHANGE, processSeekingChange);
                  dispatcher.addEventListener(PlayEvent.PLAY_STATE_CHANGE, processPlayStateChange);
                             

       

              private function processTraitAdd(traitType:String):void
              {
                  if (traitType == MediaTraitType.BUFFER)
                  {
                      // As soon as we can buffer, set the initial buffer time.
                      var bufferTrait:BufferTrait = getTrait(MediaTraitType.BUFFER) as BufferTrait;
                      bufferTrait.bufferTime = initialBufferTime;
                  }
              }

       

      Shouldn't processTraitAdd receive a MediaElementEvent as a parameter?