public MoPubClientPositioning enableRepeatingPositions(int i) {
   boolean flag = true;
   if (i <= 1) {
     flag = false;
   }
   if (!com.mopub.common.Preconditions.NoThrow.checkArgument(
       flag, "Repeating interval must be greater than 1")) {
     mRepeatInterval = 0x7fffffff;
     return this;
   } else {
     mRepeatInterval = i;
     return this;
   }
 }
 public MoPubClientPositioning addFixedPosition(int i) {
   boolean flag;
   if (i >= 0) {
     flag = true;
   } else {
     flag = false;
   }
   int j;
   if (com.mopub.common.Preconditions.NoThrow.checkArgument(flag)) {
     if ((j = Collections.binarySearch(mFixedPositions, Integer.valueOf(i))) < 0) {
       mFixedPositions.add(~j, Integer.valueOf(i));
       return this;
     }
   }
   return this;
 }
Ejemplo n.º 3
0
  /**
   * Returns untriggered VAST progress trackers with a progress before the provided position.
   *
   * @param currentPositionMillis the current video position in milliseconds.
   * @param videoLengthMillis the total video length.
   */
  @NonNull
  private List<VastTracker> getUntriggeredTrackersBefore(
      int currentPositionMillis, int videoLengthMillis) {
    if (Preconditions.NoThrow.checkArgument(videoLengthMillis > 0)) {
      float progressFraction = currentPositionMillis / (float) (videoLengthMillis);
      List<VastTracker> untriggeredTrackers = new ArrayList<VastTracker>();

      final ArrayList<VastAbsoluteProgressTracker> absoluteTrackers =
          mVastVideoConfiguration.getAbsoluteTrackers();
      VastAbsoluteProgressTracker absoluteTest =
          new VastAbsoluteProgressTracker("", currentPositionMillis);
      int absoluteTrackerCount = absoluteTrackers.size();
      for (int i = 0; i < absoluteTrackerCount; i++) {
        VastAbsoluteProgressTracker tracker = absoluteTrackers.get(i);
        if (tracker.compareTo(absoluteTest) > 0) {
          break;
        }
        if (!tracker.isTracked()) {
          untriggeredTrackers.add(tracker);
        }
      }

      final ArrayList<VastFractionalProgressTracker> fractionalTrackers =
          mVastVideoConfiguration.getFractionalTrackers();
      final VastFractionalProgressTracker fractionalTest =
          new VastFractionalProgressTracker("", progressFraction);
      int fractionalTrackerCount = fractionalTrackers.size();
      for (int i = 0; i < fractionalTrackerCount; i++) {
        VastFractionalProgressTracker tracker = fractionalTrackers.get(i);
        if (tracker.compareTo(fractionalTest) > 0) {
          break;
        }
        if (!tracker.isTracked()) {
          untriggeredTrackers.add(tracker);
        }
      }

      return untriggeredTrackers;
    } else {
      return Collections.emptyList();
    }
  }