HlsDownloader.Factory
public final class HlsDownloader.Factory extends SegmentDownloader.BaseFactory
| java.lang.Object | ||
| ↳ | androidx.media3.exoplayer.offline.SegmentDownloader.BaseFactory | |
| ↳ | androidx.media3.exoplayer.hls.offline.HlsDownloader.Factory |
A factory for HLS downloaders.
Summary
Public constructors |
|---|
Factory(CacheDataSource.Factory cacheDataSourceFactory)Creates a factory for |
Public methods |
|
|---|---|
HlsDownloader |
Creates |
HlsDownloader.Factory |
@CanIgnoreReturnValueSets the duration in microseconds from the |
abstract SegmentDownloaderFactory |
setDurationUs(long durationUs)Sets the duration in microseconds from the |
HlsDownloader.Factory |
@CanIgnoreReturnValueSets the |
abstract SegmentDownloaderFactory |
setExecutor(Executor executor)Sets the |
HlsDownloader.Factory |
@CanIgnoreReturnValueSets a parser for HLS playlists. |
HlsDownloader.Factory |
@CanIgnoreReturnValueSets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds. |
abstract SegmentDownloaderFactory |
setMaxMergedSegmentStartTimeDiffMs(Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds. |
HlsDownloader.Factory |
@CanIgnoreReturnValueSets the start position in microseconds that the download should start from. |
abstract SegmentDownloaderFactory |
setStartPositionUs(long startPositionUs)Sets the start position in microseconds that the download should start from. |
Inherited fields |
|---|
Public constructors
Factory
public Factory(CacheDataSource.Factory cacheDataSourceFactory)
Creates a factory for HlsDownloader.
| Parameters | |
|---|---|
CacheDataSource.Factory cacheDataSourceFactory |
A |
Public methods
setDurationUs
@CanIgnoreReturnValue
public HlsDownloader.Factory setDurationUs(long durationUs)
Sets the duration in microseconds from the startPositionUs to be downloaded, or TIME_UNSET if the media should be downloaded to the end.
| Returns | |
|---|---|
HlsDownloader.Factory |
This factory, for convenience. |
setDurationUs
public abstract SegmentDownloaderFactory setDurationUs(long durationUs)
Sets the duration in microseconds from the startPositionUs to be downloaded, or TIME_UNSET if the media should be downloaded to the end.
setExecutor
@CanIgnoreReturnValue
public HlsDownloader.Factory setExecutor(Executor executor)
Sets the Executor used to make requests for the media being downloaded. Providing an Executor that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.
| Returns | |
|---|---|
HlsDownloader.Factory |
This factory, for convenience. |
setExecutor
public abstract SegmentDownloaderFactory setExecutor(Executor executor)
Sets the Executor used to make requests for the media being downloaded. Providing an Executor that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.
setManifestParser
@CanIgnoreReturnValue
public HlsDownloader.Factory setManifestParser(HlsPlaylistParser manifestParser)
Sets a parser for HLS playlists.
| Returns | |
|---|---|
HlsDownloader.Factory |
This factory, for convenience. |
setMaxMergedSegmentStartTimeDiffMs
@CanIgnoreReturnValue
public HlsDownloader.Factory setMaxMergedSegmentStartTimeDiffMs(
long maxMergedSegmentStartTimeDiffMs
)
Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.
| Returns | |
|---|---|
HlsDownloader.Factory |
This factory, for convenience. |
setMaxMergedSegmentStartTimeDiffMs
public abstract SegmentDownloaderFactory setMaxMergedSegmentStartTimeDiffMs(
long maxMergedSegmentStartTimeDiffMs
)
Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.
setStartPositionUs
@CanIgnoreReturnValue
public HlsDownloader.Factory setStartPositionUs(long startPositionUs)
Sets the start position in microseconds that the download should start from.
| Returns | |
|---|---|
HlsDownloader.Factory |
This factory, for convenience. |
setStartPositionUs
public abstract SegmentDownloaderFactory setStartPositionUs(long startPositionUs)
Sets the start position in microseconds that the download should start from.