1 Reply Latest reply on Aug 27, 2014 4:46 AM by pede2000

    VAST issue - VAST2TrackingProxyElement fires double tracking events

    HilaKarimov Level 1

      Hello,

       

      I have run into an issue using the VASTNew library released with OSMF 1.0/1.5. This issue occurs with VAST2 ads - when the ads are played the time progress tracking events (first quartile, middle, third quartile, complete) are fired twice each.

       

      After investigating the code, I found that this happens because the VAST2TrackingProxyElement extends the class VASTTrackingProxyElement, but because the VASTTrackingProxyElement methods :

       

      private function fireEventOfType(eventType:VASTTrackingEventType):void
              {
                  var vastEvent:VASTTrackingEvent = eventsMap[eventType] as VASTTrackingEvent;
                  if (vastEvent != null)
                  {
                      for each (var vastURL:VASTUrl in vastEvent.urls)
                      {
                          if (vastURL.url != null)
                          {
                             
                              var beacon:Beacon = new Beacon(vastURL.url, httpLoader);
                              beacon.ping();
                          }
                      }
                  }
              }
             
              private function onPlayheadTimer(event:TimerEvent):void
              {
                  // Check for 25%, 50%, and 75%.
                  var percent:Number = this.percentPlayback;
                 
                  if (percent >= 25 && firstQuartileReached == false)
                  {
                      firstQuartileReached = true;
                     
                      fireEventOfType(VASTTrackingEventType.FIRST_QUARTILE);
                  }
                  else if (percent >= 50 && midpointReached == false)
                  {
                      midpointReached = true;
                     
                      fireEventOfType(VASTTrackingEventType.MIDPOINT);
                  }
                  else if (percent >= 75 && thirdQuartileReached == false)
                  {
                      thirdQuartileReached = true;
                     
                      fireEventOfType(VASTTrackingEventType.THIRD_QUARTILE);
                  }
              }
             
              private function get percentPlayback():Number
              {
                  var timeTrait:TimeTrait = getTrait(MediaTraitType.TIME) as TimeTrait;
                  if (timeTrait != null)
                  {
                      var duration:Number = timeTrait.duration;
                      return duration > 0 ? 100 * timeTrait.currentTime / duration : 0;
                  }
                 
                  return 0;
              }

       

      Are over-written, instead of overriden in the VAST2TrackingProxyElement, As a result the parent class and the child class both cause the tracking events to be fired individually.

       

      I made my own workaround for this, in which I made all 3 functions "protected" rather than private and overrode the function "fireEventOfType" in the VAST2TrackingProxyElement  and deleted the latter 2 from the VAST2TrackingProxyElement altogether (since they are obviously just copied). Also I added another input parameter for the "fireEventOfType" function.

       

      I was wondering whether this is a known issue in the VASTNew library? Is my workaround acceptable, or is there some other way to avoid this issue?