public final class SsDownloader.Factory extends SegmentDownloader.BaseFactory


A factory for SmoothStreaming downloaders.

Summary

Public constructors

Factory(CacheDataSource.Factory cacheDataSourceFactory)

Creates a factory for SsDownloader.

Public methods

SsDownloader
create(MediaItem mediaItem)

Creates SmoothStreaming downloaders.

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

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

SsDownloader.Factory

Sets a parser for SmoothStreaming manifests.

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

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

Parameters
CacheDataSource.Factory cacheDataSourceFactory

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

Public methods

create

public SsDownloader create(MediaItem mediaItem)

Creates SmoothStreaming downloaders.

setDurationUs

@CanIgnoreReturnValue
public SsDownloader.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
SsDownloader.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 SsDownloader.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
SsDownloader.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 SsDownloader.Factory setManifestParser(SsManifestParser manifestParser)

Sets a parser for SmoothStreaming manifests.

Returns
SsDownloader.Factory

This factory, for convenience.

setMaxMergedSegmentStartTimeDiffMs

@CanIgnoreReturnValue
public SsDownloader.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
SsDownloader.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 SsDownloader.Factory setStartPositionUs(long startPositionUs)

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

Returns
SsDownloader.Factory

This factory, for convenience.

setStartPositionUs

public abstract SegmentDownloaderFactory setStartPositionUs(long startPositionUs)

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