Back to Exoplayer

ProgressiveMediaSource.Factory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/ProgressiveMediaSource.Factory.html

latest13.2 KB
Original Source

Package com.google.android.exoplayer2.source

Class ProgressiveMediaSource.Factory

  • java.lang.Object

    • com.google.android.exoplayer2.source.ProgressiveMediaSource.Factory
  • All Implemented Interfaces:MediaSource.Factory, MediaSourceFactoryEnclosing class:ProgressiveMediaSource


public static final classProgressiveMediaSource.Factoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[MediaSourceFactory](MediaSourceFactory.html "interface in com.google.android.exoplayer2.source")

Factory for ProgressiveMediaSources.

Field Summary

- 

Fields inherited from interface com.google.android.exoplayer2.source.MediaSourceFactory

UNSUPPORTED

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | Factory​(DataSource.Factory dataSourceFactory) | Creates a new factory for ProgressiveMediaSources. | | Factory​(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory) | Equivalent to new Factory(dataSourceFactory, () -> new BundledExtractorsAdapter(extractorsFactory). | | Factory​(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory) | Creates a new factory for ProgressiveMediaSources. | | Factory​(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory, DrmSessionManagerProvider drmSessionManagerProvider, LoadErrorHandlingPolicy loadErrorHandlingPolicy, int continueLoadingCheckIntervalBytes) | Creates a new factory for ProgressiveMediaSources. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | ProgressiveMediaSource | createMediaSource​(MediaItem mediaItem) | Returns a new ProgressiveMediaSource using the current parameters. | | @com.google.android.exoplayer2.C.ContentType int[] | getSupportedTypes() | Returns the content types supported by media sources created by this factory. | | ProgressiveMediaSource.Factory | setContinueLoadingCheckIntervalBytes​(int continueLoadingCheckIntervalBytes) | Sets the number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader). | | ProgressiveMediaSource.Factory | setDrmSessionManagerProvider​(DrmSessionManagerProvider drmSessionManagerProvider) | Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem. | | ProgressiveMediaSource.Factory | setLoadErrorHandlingPolicy​(LoadErrorHandlingPolicy loadErrorHandlingPolicy) | Sets an optional LoadErrorHandlingPolicy. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

- 

Methods inherited from interface com.google.android.exoplayer2.source.MediaSource.Factory

setCmcdConfigurationFactory

Constructor Detail

- 

Factory

public Factory​([DataSource.Factory](../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

  - [`DefaultExtractorsFactory`](../extractor/DefaultExtractorsFactory.html "class in com.google.android.exoplayer2.extractor")
  - [`DefaultDrmSessionManagerProvider`](../drm/DefaultDrmSessionManagerProvider.html "class in com.google.android.exoplayer2.drm")
  - [`DefaultLoadErrorHandlingPolicy`](../upstream/DefaultLoadErrorHandlingPolicy.html "class in com.google.android.exoplayer2.upstream")

Parameters:dataSourceFactory - A factory for data sources to read the media.

- 

Factory

public Factory​([DataSource.Factory](../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory,[ExtractorsFactory](../extractor/ExtractorsFactory.html "interface in com.google.android.exoplayer2.extractor")extractorsFactory)

Equivalent to new Factory(dataSourceFactory, () -> new BundledExtractorsAdapter(extractorsFactory).

The factory will use the following default components:

  - [`DefaultDrmSessionManagerProvider`](../drm/DefaultDrmSessionManagerProvider.html "class in com.google.android.exoplayer2.drm")
  - [`DefaultLoadErrorHandlingPolicy`](../upstream/DefaultLoadErrorHandlingPolicy.html "class in com.google.android.exoplayer2.upstream")

Parameters:dataSourceFactory - A factory for data sources to read the media.extractorsFactory - A factory for the extractors used to extract the media from its container.

- 

Factory

public Factory​([DataSource.Factory](../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory,[ProgressiveMediaExtractor.Factory](ProgressiveMediaExtractor.Factory.html "interface in com.google.android.exoplayer2.source")progressiveMediaExtractorFactory)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

  - [`DefaultDrmSessionManagerProvider`](../drm/DefaultDrmSessionManagerProvider.html "class in com.google.android.exoplayer2.drm")
  - [`DefaultLoadErrorHandlingPolicy`](../upstream/DefaultLoadErrorHandlingPolicy.html "class in com.google.android.exoplayer2.upstream")

Parameters:dataSourceFactory - A factory for data sources to read the media.progressiveMediaExtractorFactory - A factory for the ProgressiveMediaExtractor to extract the media from its container.

- 

Factory

public Factory​([DataSource.Factory](../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory,[ProgressiveMediaExtractor.Factory](ProgressiveMediaExtractor.Factory.html "interface in com.google.android.exoplayer2.source")progressiveMediaExtractorFactory,[DrmSessionManagerProvider](../drm/DrmSessionManagerProvider.html "interface in com.google.android.exoplayer2.drm")drmSessionManagerProvider,[LoadErrorHandlingPolicy](../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy,
               int continueLoadingCheckIntervalBytes)

Creates a new factory for ProgressiveMediaSources. Parameters:dataSourceFactory - A factory for data sources to read the media.progressiveMediaExtractorFactory - A factory for the ProgressiveMediaExtractor to extract media from its container.drmSessionManagerProvider - A provider to obtain a DrmSessionManager for a MediaItem.loadErrorHandlingPolicy - A policy to handle load error.continueLoadingCheckIntervalBytes - The number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).

Method Detail

- 

setLoadErrorHandlingPolicy

@CanIgnoreReturnValue
public[ProgressiveMediaSource.Factory](ProgressiveMediaSource.Factory.html "class in com.google.android.exoplayer2.source")setLoadErrorHandlingPolicy​([LoadErrorHandlingPolicy](../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy)

Description copied from interface: MediaSource.Factory

Sets an optional LoadErrorHandlingPolicy. Specified by:setLoadErrorHandlingPolicy in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

setContinueLoadingCheckIntervalBytes

@CanIgnoreReturnValue
public[ProgressiveMediaSource.Factory](ProgressiveMediaSource.Factory.html "class in com.google.android.exoplayer2.source")setContinueLoadingCheckIntervalBytes​(int continueLoadingCheckIntervalBytes)

Sets the number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader). The default value is ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES. Parameters:continueLoadingCheckIntervalBytes - The number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).Returns:This factory, for convenience.

- 

setDrmSessionManagerProvider

@CanIgnoreReturnValue
public[ProgressiveMediaSource.Factory](ProgressiveMediaSource.Factory.html "class in com.google.android.exoplayer2.source")setDrmSessionManagerProvider​([DrmSessionManagerProvider](../drm/DrmSessionManagerProvider.html "interface in com.google.android.exoplayer2.drm")drmSessionManagerProvider)

Description copied from interface: MediaSource.Factory

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem. Specified by:setDrmSessionManagerProvider in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

createMediaSource

public[ProgressiveMediaSource](ProgressiveMediaSource.html "class in com.google.android.exoplayer2.source")createMediaSource​([MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Returns a new ProgressiveMediaSource using the current parameters. Specified by:createMediaSource in interface MediaSource.FactoryParameters:mediaItem - The MediaItem.Returns:The new ProgressiveMediaSource.Throws:NullPointerException - if MediaItem.localConfiguration is null.

- 

getSupportedTypes

[@ContentType](../C.ContentType.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()

Description copied from interface: MediaSource.Factory

Returns the content types supported by media sources created by this factory. Specified by:getSupportedTypes in interface MediaSource.Factory