SegmentDownloader.BaseFactory


protected abstract class SegmentDownloader.BaseFactory<M : FilterableManifest<M!>?>


A base class of the factory of the concrete extension of SegmentDownloader.

Summary

Public constructors

BaseFactory(
    cacheDataSourceFactory: CacheDataSource.Factory!,
    manifestParser: ParsingLoadable.Parser<M!>!
)

Public functions

abstract SegmentDownloader<Any!>!
create(mediaItem: MediaItem!)

Creates the segment downloader.

SegmentDownloader.BaseFactory<M!>!

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

SegmentDownloader.BaseFactory<M!>!

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

SegmentDownloader.BaseFactory<M!>!
@CanIgnoreReturnValue
setMaxMergedSegmentStartTimeDiffMs(
    maxMergedSegmentStartTimeDiffMs: Long
)

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.

SegmentDownloader.BaseFactory<M!>!

Sets the start position in microseconds that the download should start from.

Public constructors

BaseFactory

BaseFactory(
    cacheDataSourceFactory: CacheDataSource.Factory!,
    manifestParser: ParsingLoadable.Parser<M!>!
)

Public functions

create

abstract fun create(mediaItem: MediaItem!): SegmentDownloader<Any!>!

Creates the segment downloader.

Parameters
mediaItem: MediaItem!

The MediaItem to be downloaded.

setDurationUs

@CanIgnoreReturnValue
fun setDurationUs(durationUs: Long): SegmentDownloader.BaseFactory<M!>!

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
fun setExecutor(executor: Executor!): SegmentDownloader.BaseFactory<M!>!

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.

setMaxMergedSegmentStartTimeDiffMs

@CanIgnoreReturnValue
fun setMaxMergedSegmentStartTimeDiffMs(
    maxMergedSegmentStartTimeDiffMs: Long
): SegmentDownloader.BaseFactory<M!>!

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
fun setStartPositionUs(startPositionUs: Long): SegmentDownloader.BaseFactory<M!>!

Sets the start position in microseconds that the download should start from.

Protected properties

cacheDataSourceFactory

protected val cacheDataSourceFactoryCacheDataSource.Factory!

durationUs

protected val durationUsLong

executor

protected val executorExecutor!

manifestParser

protected val manifestParserParsingLoadable.Parser<M!>!

maxMergedSegmentStartTimeDiffMs

protected val maxMergedSegmentStartTimeDiffMsLong

startPositionUs

protected val startPositionUsLong