com.google.android.exoplayer2.source.ClippingMediaPeriod Java Examples

The following examples show how to use com.google.android.exoplayer2.source.ClippingMediaPeriod. 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: MediaPeriodHolder.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/** Releases the given {@code mediaPeriod}, logging and suppressing any errors. */
private static void releaseMediaPeriod(
    long endPositionUs, MediaSource mediaSource, MediaPeriod mediaPeriod) {
  try {
    if (endPositionUs != C.TIME_UNSET && endPositionUs != C.TIME_END_OF_SOURCE) {
      mediaSource.releasePeriod(((ClippingMediaPeriod) mediaPeriod).mediaPeriod);
    } else {
      mediaSource.releasePeriod(mediaPeriod);
    }
  } catch (RuntimeException e) {
    // There's nothing we can do.
    Log.e(TAG, "Period release failed.", e);
  }
}
 
Example #2
Source File: MediaPeriodHolder.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public void release() {
  updatePeriodTrackSelectorResult(null);
  try {
    if (info.id.endPositionUs != C.TIME_END_OF_SOURCE) {
      mediaSource.releasePeriod(((ClippingMediaPeriod) mediaPeriod).mediaPeriod);
    } else {
      mediaSource.releasePeriod(mediaPeriod);
    }
  } catch (RuntimeException e) {
    // There's nothing we can do.
    Log.e(TAG, "Period release failed.", e);
  }
}
 
Example #3
Source File: MediaPeriodHolder.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public void release() {
  updatePeriodTrackSelectorResult(null);
  try {
    if (info.id.endPositionUs != C.TIME_END_OF_SOURCE) {
      mediaSource.releasePeriod(((ClippingMediaPeriod) mediaPeriod).mediaPeriod);
    } else {
      mediaSource.releasePeriod(mediaPeriod);
    }
  } catch (RuntimeException e) {
    // There's nothing we can do.
    Log.e(TAG, "Period release failed.", e);
  }
}
 
Example #4
Source File: MediaPeriodHolder.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/** Releases the given {@code mediaPeriod}, logging and suppressing any errors. */
private static void releaseMediaPeriod(
    long endPositionUs, MediaSource mediaSource, MediaPeriod mediaPeriod) {
  try {
    if (endPositionUs != C.TIME_UNSET && endPositionUs != C.TIME_END_OF_SOURCE) {
      mediaSource.releasePeriod(((ClippingMediaPeriod) mediaPeriod).mediaPeriod);
    } else {
      mediaSource.releasePeriod(mediaPeriod);
    }
  } catch (RuntimeException e) {
    // There's nothing we can do.
    Log.e(TAG, "Period release failed.", e);
  }
}
 
Example #5
Source File: MediaPeriodHolder.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/** Releases the given {@code mediaPeriod}, logging and suppressing any errors. */
private static void releaseMediaPeriod(
    long endPositionUs, MediaSource mediaSource, MediaPeriod mediaPeriod) {
  try {
    if (endPositionUs != C.TIME_UNSET && endPositionUs != C.TIME_END_OF_SOURCE) {
      mediaSource.releasePeriod(((ClippingMediaPeriod) mediaPeriod).mediaPeriod);
    } else {
      mediaSource.releasePeriod(mediaPeriod);
    }
  } catch (RuntimeException e) {
    // There's nothing we can do.
    Log.e(TAG, "Period release failed.", e);
  }
}