CmcdData.Factory


public final class CmcdData.Factory


CmcdData.Factory for CmcdData instances.

Summary

Public constructors

Factory(
    CmcdConfiguration cmcdConfiguration,
    @CmcdData.StreamingFormat @CmcdData.StreamingFormat String streamingFormat
)

Creates an instance.

Public methods

CmcdData

Creates a CmcdData instance.

CmcdData.Factory

Sets the duration of media currently buffered from the current playback position, in microseconds.

CmcdData.Factory

Sets the duration of current media chunk being requested, in microseconds.

CmcdData.Factory
@CanIgnoreReturnValue
setDidRebuffer(boolean didRebuffer)

Sets whether a rebuffering event occurred between the previous request and this one.

CmcdData.Factory
@CanIgnoreReturnValue
setIsBufferEmpty(boolean isBufferEmpty)

Sets whether the queue of buffered chunks is empty.

CmcdData.Factory

Sets whether the media content is being streamed live.

CmcdData.Factory

Sets the relative path of the next object to be requested.

CmcdData.Factory

Sets the byte range representing the partial object request.

CmcdData.Factory

Sets the object type of the current object being requested.

CmcdData.Factory

Sets the playback rate indicating the current speed of playback.

CmcdData.Factory

Sets the track selection for the media being played.

Public constructors

Factory

public Factory(
    CmcdConfiguration cmcdConfiguration,
    @CmcdData.StreamingFormat @CmcdData.StreamingFormat String streamingFormat
)

Creates an instance.

Parameters
CmcdConfiguration cmcdConfiguration

The CmcdConfiguration for this source.

@CmcdData.StreamingFormat @CmcdData.StreamingFormat String streamingFormat

The streaming format of the media content.

Public methods

createCmcdData

public CmcdData createCmcdData()

Creates a CmcdData instance.

Throws
java.lang.IllegalStateException

If any required parameters have not been set.

setBufferedDurationUs

@CanIgnoreReturnValue
public CmcdData.Factory setBufferedDurationUs(long bufferedDurationUs)

Sets the duration of media currently buffered from the current playback position, in microseconds.

Must be set to a non-negative value if the object type is set and one of OBJECT_TYPE_AUDIO_ONLY, OBJECT_TYPE_VIDEO_ONLY or OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO.

Default value is TIME_UNSET.

Throws
java.lang.IllegalArgumentException

If bufferedDurationUs is negative.

setChunkDurationUs

@CanIgnoreReturnValue
public CmcdData.Factory setChunkDurationUs(long chunkDurationUs)

Sets the duration of current media chunk being requested, in microseconds.

Must be set to a non-negative value if the object type is set and one of OBJECT_TYPE_AUDIO_ONLY, OBJECT_TYPE_VIDEO_ONLY or OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO.

Default value is TIME_UNSET.

Throws
java.lang.IllegalArgumentException

If chunkDurationUs is negative.

setDidRebuffer

@CanIgnoreReturnValue
public CmcdData.Factory setDidRebuffer(boolean didRebuffer)

Sets whether a rebuffering event occurred between the previous request and this one.

Default value is false.

setIsBufferEmpty

@CanIgnoreReturnValue
public CmcdData.Factory setIsBufferEmpty(boolean isBufferEmpty)

Sets whether the queue of buffered chunks is empty.

Default value is false.

setIsLive

@CanIgnoreReturnValue
public CmcdData.Factory setIsLive(boolean isLive)

Sets whether the media content is being streamed live.

Default value is false.

setNextObjectRequest

@CanIgnoreReturnValue
public CmcdData.Factory setNextObjectRequest(@Nullable String nextObjectRequest)

Sets the relative path of the next object to be requested. This can be used to trigger pre-fetching by the CDN.

Default is null.

setNextRangeRequest

@CanIgnoreReturnValue
public CmcdData.Factory setNextRangeRequest(@Nullable String nextRangeRequest)

Sets the byte range representing the partial object request. This can be used to trigger pre-fetching by the CDN.

Default is null.

setObjectType

@CanIgnoreReturnValue
public CmcdData.Factory setObjectType(
    @CmcdData.ObjectType @Nullable @CmcdData.ObjectType String objectType
)

Sets the object type of the current object being requested.

Must be set if track selection is not provided. If unset and a track selection is provided, the object type is derived from it.

Default is null.

setPlaybackRate

@CanIgnoreReturnValue
public CmcdData.Factory setPlaybackRate(float playbackRate)

Sets the playback rate indicating the current speed of playback.

Default value is RATE_UNSET.

Throws
java.lang.IllegalArgumentException

If playbackRate is non-positive and not RATE_UNSET.

setTrackSelection

@CanIgnoreReturnValue
public CmcdData.Factory setTrackSelection(ExoTrackSelection trackSelection)

Sets the track selection for the media being played.

Must be set to a non-null value if the setObjectType is not OBJECT_TYPE_MANIFEST

Default is null.