com.google.android.exoplayer2.source.hls.playlist.DefaultHlsPlaylistTracker Java Examples

The following examples show how to use com.google.android.exoplayer2.source.hls.playlist.DefaultHlsPlaylistTracker. 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: HlsMediaSource.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link HlsMediaSource}s.
 *
 * @param hlsDataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for
 *     manifests, segments and keys.
 */
public Factory(HlsDataSourceFactory hlsDataSourceFactory) {
  this.hlsDataSourceFactory = Assertions.checkNotNull(hlsDataSourceFactory);
  playlistParserFactory = new DefaultHlsPlaylistParserFactory();
  playlistTrackerFactory = DefaultHlsPlaylistTracker.FACTORY;
  extractorFactory = HlsExtractorFactory.DEFAULT;
  drmSessionManager = DrmSessionManager.getDummyDrmSessionManager();
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
  metadataType = METADATA_TYPE_ID3;
}
 
Example #2
Source File: HlsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param manifestUri The {@link Uri} of the HLS manifest.
 * @param dataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for manifests,
 *     segments and keys.
 * @param extractorFactory An {@link HlsExtractorFactory} for {@link Extractor}s for the segments.
 * @param minLoadableRetryCount The minimum number of times loads must be retried before errors
 *     are propagated.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A {@link MediaSourceEventListener}. May be null if delivery of events is
 *     not required.
 * @param playlistParser A {@link ParsingLoadable.Parser} for HLS playlists.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public HlsMediaSource(
    Uri manifestUri,
    HlsDataSourceFactory dataSourceFactory,
    HlsExtractorFactory extractorFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener,
    ParsingLoadable.Parser<HlsPlaylist> playlistParser) {
  this(
      manifestUri,
      dataSourceFactory,
      extractorFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      LoadErrorHandlingPolicy.getDefault(),
      minLoadableRetryCount,
      new DefaultHlsPlaylistTracker(
          dataSourceFactory,
          LoadErrorHandlingPolicy.getDefault(),
          minLoadableRetryCount,
          playlistParser),
      /* allowChunklessPreparation= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #3
Source File: HlsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param manifestUri The {@link Uri} of the HLS manifest.
 * @param dataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for manifests,
 *     segments and keys.
 * @param extractorFactory An {@link HlsExtractorFactory} for {@link Extractor}s for the segments.
 * @param minLoadableRetryCount The minimum number of times loads must be retried before errors
 *     are propagated.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A {@link MediaSourceEventListener}. May be null if delivery of events is
 *     not required.
 * @param playlistParser A {@link ParsingLoadable.Parser} for HLS playlists.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public HlsMediaSource(
    Uri manifestUri,
    HlsDataSourceFactory dataSourceFactory,
    HlsExtractorFactory extractorFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener,
    ParsingLoadable.Parser<HlsPlaylist> playlistParser) {
  this(
      manifestUri,
      dataSourceFactory,
      extractorFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      LoadErrorHandlingPolicy.getDefault(),
      minLoadableRetryCount,
      new DefaultHlsPlaylistTracker(
          dataSourceFactory,
          LoadErrorHandlingPolicy.getDefault(),
          minLoadableRetryCount,
          playlistParser),
      /* allowChunklessPreparation= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #4
Source File: HlsMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link HlsMediaSource}s.
 *
 * @param hlsDataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for
 *     manifests, segments and keys.
 */
public Factory(HlsDataSourceFactory hlsDataSourceFactory) {
  this.hlsDataSourceFactory = Assertions.checkNotNull(hlsDataSourceFactory);
  playlistParserFactory = new DefaultHlsPlaylistParserFactory();
  playlistTrackerFactory = DefaultHlsPlaylistTracker.FACTORY;
  extractorFactory = HlsExtractorFactory.DEFAULT;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
  metadataType = HlsMetadataType.ID3;
}
 
Example #5
Source File: HlsMediaSource.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link HlsMediaSource}s.
 *
 * @param hlsDataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for
 *     manifests, segments and keys.
 */
public Factory(HlsDataSourceFactory hlsDataSourceFactory) {
  this.hlsDataSourceFactory = Assertions.checkNotNull(hlsDataSourceFactory);
  playlistParserFactory = new DefaultHlsPlaylistParserFactory();
  playlistTrackerFactory = DefaultHlsPlaylistTracker.FACTORY;
  extractorFactory = HlsExtractorFactory.DEFAULT;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
  metadataType = HlsMetadataType.ID3;
}