CmcdData.Factory
public final class CmcdData.Factory
CmcdData.Factory for CmcdData instances.
Summary
Public constructors |
|---|
Factory(Creates an instance. |
Public methods |
|
|---|---|
CmcdData |
Creates a |
CmcdData.Factory |
@CanIgnoreReturnValueSets the duration of media currently buffered from the current playback position, in microseconds. |
CmcdData.Factory |
@CanIgnoreReturnValueSets the duration of current media chunk being requested, in microseconds. |
CmcdData.Factory |
@CanIgnoreReturnValueSets whether a rebuffering event occurred between the previous request and this one. |
CmcdData.Factory |
@CanIgnoreReturnValueSets whether the queue of buffered chunks is empty. |
CmcdData.Factory |
@CanIgnoreReturnValueSets whether the media content is being streamed live. |
CmcdData.Factory |
@CanIgnoreReturnValueSets the relative path of the next object to be requested. |
CmcdData.Factory |
@CanIgnoreReturnValueSets the byte range representing the partial object request. |
CmcdData.Factory |
@CanIgnoreReturnValueSets the object type of the current object being requested. |
CmcdData.Factory |
@CanIgnoreReturnValueSets the playback rate indicating the current speed of playback. |
CmcdData.Factory |
@CanIgnoreReturnValueSets the |
Public constructors
Factory
public Factory(
CmcdConfiguration cmcdConfiguration,
@CmcdData.StreamingFormat @CmcdData.StreamingFormat String streamingFormat
)
Creates an instance.
| Parameters | |
|---|---|
CmcdConfiguration cmcdConfiguration |
The |
@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 |
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 |
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 |
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.