コード例 #1
0
  private long getSkipDuration() {
    if (hasSkipDuration()) {
      UnityAdsZone currentZone = UnityAdsWebData.getZoneManager().getCurrentZone();
      return currentZone.allowVideoSkipInSeconds();
    }

    return 0;
  }
コード例 #2
0
  public int getSecondsUntilBackButtonAllowed() {
    int timeUntilBackButton = 0;

    UnityAdsZone currentZone = UnityAdsWebData.getZoneManager().getCurrentZone();
    if (currentZone.disableBackButtonForSeconds() > 0 && _videoStartedPlayingMillis > 0) {
      timeUntilBackButton =
          Math.round(
              (currentZone.disableBackButtonForSeconds() * 1000)
                  - (System.currentTimeMillis() - _videoStartedPlayingMillis));
      if (timeUntilBackButton < 0) timeUntilBackButton = 0;
    } else if (currentZone.allowVideoSkipInSeconds() > 0 && _videoStartedPlayingMillis <= 0) {
      return 1;
    }

    return timeUntilBackButton;
  }
コード例 #3
0
 private boolean hasSkipDuration() {
   UnityAdsZone currentZone = UnityAdsWebData.getZoneManager().getCurrentZone();
   return currentZone.allowVideoSkipInSeconds() > 0;
 }