DownloadHelper.Factory


public final class DownloadHelper.Factory


A factory of DownloadHelper.

Summary

Public constructors

Creates a Factory.

Public methods

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
@CanIgnoreReturnValue
setDebugLoggingEnabled(boolean debugLoggingEnabled)

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

public Factory()

Creates a Factory.

Public methods

create

public DownloadHelper create(MediaItem mediaItem)

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

public DownloadHelper create(MediaSource mediaSource)

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
public DownloadHelper.Factory setDataSourceFactory(@Nullable DataSource.Factory dataSourceFactory)

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
public DownloadHelper.Factory setDebugLoggingEnabled(boolean debugLoggingEnabled)

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

Returns
DownloadHelper.Factory

This factory, for convenience.

setDrmSessionManager

@CanIgnoreReturnValue
public DownloadHelper.Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager)

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
public DownloadHelper.Factory setRenderersFactory(@Nullable RenderersFactory renderersFactory)

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
public DownloadHelper.Factory setTrackSelectionParameters(
    TrackSelectionParameters trackSelectionParameters
)

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.