DownloadHelper.Factory


class DownloadHelper.Factory


A factory of DownloadHelper.

Summary

Public constructors

Creates a Factory.

Public functions

DownloadHelper!
create(mediaItem: MediaItem!)

Creates a new DownloadHelper.

DownloadHelper!
create(mediaSource: MediaSource!)

Creates a new DownloadHelper.

DownloadHelper.Factory!

Sets a DataSource.Factory used to load the manifest for adaptive streams or the SeekMap for progressive streams.

DownloadHelper.Factory!

Sets whether to log debug information.

DownloadHelper.Factory!

Sets a DrmSessionManager.

DownloadHelper.Factory!

Sets a RenderersFactory creating the renderers for which tracks are selected.

DownloadHelper.Factory!

Sets a TrackSelectionParameters for selecting tracks for downloading.

Public constructors

Factory

Factory()

Creates a Factory.

Public functions

create

fun create(mediaItem: MediaItem!): DownloadHelper!

Creates a new DownloadHelper.

Parameters
mediaItem: MediaItem!

The MediaItem to download.

Throws
java.lang.IllegalStateException

If the corresponding module is missing for DASH, HLS or SmoothStreaming media items.

java.lang.IllegalArgumentException

If the dataSourceFactory is null for adaptive streams.

create

fun create(mediaSource: MediaSource!): DownloadHelper!

Creates a new DownloadHelper.

Parameters
mediaSource: MediaSource!

A MediaSource to be prepared.

Throws
java.lang.IllegalStateException

If the corresponding module is missing for DASH, HLS or SmoothStreaming media items.

java.lang.IllegalArgumentException

If the dataSourceFactory is null for adaptive streams.

setDataSourceFactory

@CanIgnoreReturnValue
fun setDataSourceFactory(dataSourceFactory: DataSource.Factory?): DownloadHelper.Factory!

Sets a DataSource.Factory used to load the manifest for adaptive streams or the SeekMap for progressive streams. The default is null.

A DataSource.Factory is required for adaptive streams or when requesting partial downloads for progressive streams. In the latter case, this has to be a for the Cache into which downloads will be written.

Returns
DownloadHelper.Factory!

This factory, for convenience.

setDebugLoggingEnabled

@CanIgnoreReturnValue
fun setDebugLoggingEnabled(debugLoggingEnabled: Boolean): DownloadHelper.Factory!

Sets whether to log debug information. The default is false.

Returns
DownloadHelper.Factory!

This factory, for convenience.

setDrmSessionManager

@CanIgnoreReturnValue
fun setDrmSessionManager(drmSessionManager: DrmSessionManager?): DownloadHelper.Factory!

Sets a DrmSessionManager. Used to help determine which tracks can be selected. The default is null.

Returns
DownloadHelper.Factory!

This factory, for convenience.

setRenderersFactory

@CanIgnoreReturnValue
fun setRenderersFactory(renderersFactory: RenderersFactory?): DownloadHelper.Factory!

Sets a RenderersFactory creating the renderers for which tracks are selected. The default is null.

This is only used for adaptive streams.

Returns
DownloadHelper.Factory!

This factory, for convenience.

setTrackSelectionParameters

@CanIgnoreReturnValue
fun setTrackSelectionParameters(
    trackSelectionParameters: TrackSelectionParameters!
): DownloadHelper.Factory!

Sets a TrackSelectionParameters for selecting tracks for downloading. The default is DEFAULT_TRACK_SELECTOR_PARAMETERS.

This is only used for adaptive streams.

Returns
DownloadHelper.Factory!

This factory, for convenience.