Java Code Examples for com.google.android.exoplayer2.Player#DiscontinuityReason

The following examples show how to use com.google.android.exoplayer2.Player#DiscontinuityReason . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventLogger.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
private static String getDiscontinuityReasonString(@Player.DiscontinuityReason int reason) {
  switch (reason) {
    case Player.DISCONTINUITY_REASON_PERIOD_TRANSITION:
      return "PERIOD_TRANSITION";
    case Player.DISCONTINUITY_REASON_SEEK:
      return "SEEK";
    case Player.DISCONTINUITY_REASON_SEEK_ADJUSTMENT:
      return "SEEK_ADJUSTMENT";
    case Player.DISCONTINUITY_REASON_AD_INSERTION:
      return "AD_INSERTION";
    case Player.DISCONTINUITY_REASON_INTERNAL:
      return "INTERNAL";
    default:
      return "?";
  }
}
 
Example 2
Source File: EventLogger.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private static String getDiscontinuityReasonString(@Player.DiscontinuityReason int reason) {
  switch (reason) {
    case Player.DISCONTINUITY_REASON_PERIOD_TRANSITION:
      return "PERIOD_TRANSITION";
    case Player.DISCONTINUITY_REASON_SEEK:
      return "SEEK";
    case Player.DISCONTINUITY_REASON_SEEK_ADJUSTMENT:
      return "SEEK_ADJUSTMENT";
    case Player.DISCONTINUITY_REASON_AD_INSERTION:
      return "AD_INSERTION";
    case Player.DISCONTINUITY_REASON_INTERNAL:
      return "INTERNAL";
    default:
      return "?";
  }
}
 
Example 3
Source File: AnalyticsCollector.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Override
public final void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  mediaPeriodQueueTracker.onPositionDiscontinuity(reason);
  EventTime eventTime = generatePlayingMediaPeriodEventTime();
  for (AnalyticsListener listener : listeners) {
    listener.onPositionDiscontinuity(eventTime, reason);
  }
}
 
Example 4
Source File: EventLogger.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
private static String getDiscontinuityReasonString(@Player.DiscontinuityReason int reason) {
    switch (reason) {
        case Player.DISCONTINUITY_REASON_PERIOD_TRANSITION:
            return "PERIOD_TRANSITION";
        case Player.DISCONTINUITY_REASON_SEEK:
            return "SEEK";
        case Player.DISCONTINUITY_REASON_SEEK_ADJUSTMENT:
            return "SEEK_ADJUSTMENT";
        case Player.DISCONTINUITY_REASON_INTERNAL:
            return "INTERNAL";
        default:
            return "?";
    }
}
 
Example 5
Source File: PlayerActivity.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
    if (inErrorState) {
        // This will only occur if the user has performed a seek whilst in the error state. Update
        // the resume position so that if the user then retries, playback will resume from the
        // position to which they seeked.
        updateResumePosition();
    }
}
 
Example 6
Source File: AnalyticsCollector.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  mediaPeriodQueueTracker.onPositionDiscontinuity(reason);
  EventTime eventTime = generatePlayingMediaPeriodEventTime();
  for (AnalyticsListener listener : listeners) {
    listener.onPositionDiscontinuity(eventTime, reason);
  }
}
 
Example 7
Source File: AnalyticsCollector.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  mediaPeriodQueueTracker.onPositionDiscontinuity(reason);
  EventTime eventTime = generatePlayingMediaPeriodEventTime();
  for (AnalyticsListener listener : listeners) {
    listener.onPositionDiscontinuity(eventTime, reason);
  }
}
 
Example 8
Source File: AnalyticsCollector.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
/** Updates the queue with a reported position discontinuity . */
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  updateLastReportedPlayingMediaPeriod();
}
 
Example 9
Source File: EventLogger.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(EventTime eventTime, @Player.DiscontinuityReason int reason) {
  logd(eventTime, "positionDiscontinuity", getDiscontinuityReasonString(reason));
}
 
Example 10
Source File: EventLogger.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
    Log.d(TAG, "positionDiscontinuity [" + getDiscontinuityReasonString(reason) + "]");
}
 
Example 11
Source File: ExoVideoPlaybackControlView.java    From ExoVideoView with Apache License 2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
    updateNavigation();
    updateProgress();
}
 
Example 12
Source File: ExoVideoView.java    From ExoVideoView with Apache License 2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
    if (isPlayingAd()) {
        hideController();
    }
}
 
Example 13
Source File: EventLogger.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(EventTime eventTime, @Player.DiscontinuityReason int reason) {
  logd(eventTime, "positionDiscontinuity", getDiscontinuityReasonString(reason));
}
 
Example 14
Source File: AnalyticsCollector.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
/** Updates the queue with a reported position discontinuity . */
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  updateLastReportedPlayingMediaPeriod();
}
 
Example 15
Source File: AnalyticsCollector.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/** Updates the queue with a reported position discontinuity . */
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  updateLastReportedPlayingMediaPeriod();
}
 
Example 16
Source File: EventLogger.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(EventTime eventTime, @Player.DiscontinuityReason int reason) {
  logd(eventTime, "positionDiscontinuity", getDiscontinuityReasonString(reason));
}
 
Example 17
Source File: AnalyticsCollector.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/** Updates the queue with a reported position discontinuity . */
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  updateLastReportedPlayingMediaPeriod();
}
 
Example 18
Source File: CustomizeControlView.java    From bcm-android with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
    updateNavigation();
    updateProgress();
}
 
Example 19
Source File: EventLogger.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public void onPositionDiscontinuity(EventTime eventTime, @Player.DiscontinuityReason int reason) {
  logd(eventTime, "positionDiscontinuity", getDiscontinuityReasonString(reason));
}
 
Example 20
Source File: AnalyticsCollector.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
/** Updates the queue with a reported position discontinuity . */
public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) {
  lastReportedPlayingMediaPeriod = lastPlayingMediaPeriod;
}