HlsDownloader.Factory


public final class HlsDownloader.Factory extends SegmentDownloader.BaseFactory


A factory for HLS downloaders.

Summary

Public constructors

Factory(CacheDataSource.Factory cacheDataSourceFactory)

Creates a factory for HlsDownloader.

Public methods

HlsDownloader
create(MediaItem mediaItem)

Creates HLS downloaders.

HlsDownloader.Factory

Sets the duration in microseconds from the startPositionUs to be downloaded, or TIME_UNSET if the media should be downloaded to the end.

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.

HlsDownloader.Factory

Sets the Executor used to make requests for the media being downloaded.

abstract SegmentDownloaderFactory

Sets the Executor used to make requests for the media being downloaded.

HlsDownloader.Factory

Sets a parser for HLS playlists.

HlsDownloader.Factory
@CanIgnoreReturnValue
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.

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.

HlsDownloader.Factory

Sets 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.

Public constructors

Factory

public Factory(CacheDataSource.Factory cacheDataSourceFactory)

Creates a factory for HlsDownloader.

Parameters
CacheDataSource.Factory cacheDataSourceFactory

A CacheDataSource.Factory for the cache into which the download will be written.

Public methods

create

public HlsDownloader create(MediaItem mediaItem)

Creates HLS downloaders.

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.