CmcdData.Factory


class CmcdData.Factory


CmcdData.Factory for CmcdData instances.

Summary

Constants

const String!

Represents the object type for audio-only content in a media container.

const String!

Represents the object type for an initialization segment in a media container.

const String!

Represents the object type for muxed audio and video content in a media container.

const String!

Represents the object type for video-only content in a media container.

const String!

Represents the Dynamic Adaptive Streaming over HTTP (DASH) format.

const String!

Represents the HTTP Live Streaming (HLS) format.

const String!

Represents the Smooth Streaming (SS) format.

const String!

Represents the Live Streaming stream type.

const String!

Represents the Video on Demand (VOD) stream type.

Public constructors

Factory(
    cmcdConfiguration: CmcdConfiguration!,
    trackSelection: ExoTrackSelection!,
    bufferedDurationUs: Long,
    playbackRate: Float,
    @CmcdData.StreamingFormat streamingFormat: @CmcdData.StreamingFormat String!,
    isLive: Boolean,
    didRebuffer: Boolean,
    isBufferEmpty: Boolean
)

Creates an instance.

Public functions

CmcdData!
java-static @CmcdData.ObjectType String?

Retrieves the object type value from the given ExoTrackSelection.

CmcdData.Factory!

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

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.

Constants

OBJECT_TYPE_AUDIO_ONLY

const val OBJECT_TYPE_AUDIO_ONLY = "a": String!

Represents the object type for audio-only content in a media container.

OBJECT_TYPE_INIT_SEGMENT

const val OBJECT_TYPE_INIT_SEGMENT = "i": String!

Represents the object type for an initialization segment in a media container.

OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO

const val OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO = "av": String!

Represents the object type for muxed audio and video content in a media container.

OBJECT_TYPE_VIDEO_ONLY

const val OBJECT_TYPE_VIDEO_ONLY = "v": String!

Represents the object type for video-only content in a media container.

STREAMING_FORMAT_DASH

const val STREAMING_FORMAT_DASH = "d": String!

Represents the Dynamic Adaptive Streaming over HTTP (DASH) format.

STREAMING_FORMAT_HLS

const val STREAMING_FORMAT_HLS = "h": String!

Represents the HTTP Live Streaming (HLS) format.

STREAMING_FORMAT_SS

const val STREAMING_FORMAT_SS = "s": String!

Represents the Smooth Streaming (SS) format.

STREAM_TYPE_LIVE

const val STREAM_TYPE_LIVE = "l": String!

Represents the Live Streaming stream type.

STREAM_TYPE_VOD

const val STREAM_TYPE_VOD = "v": String!

Represents the Video on Demand (VOD) stream type.

Public constructors

Factory

Factory(
    cmcdConfiguration: CmcdConfiguration!,
    trackSelection: ExoTrackSelection!,
    bufferedDurationUs: Long,
    playbackRate: Float,
    @CmcdData.StreamingFormat streamingFormat: @CmcdData.StreamingFormat String!,
    isLive: Boolean,
    didRebuffer: Boolean,
    isBufferEmpty: Boolean
)

Creates an instance.

Parameters
cmcdConfiguration: CmcdConfiguration!

The CmcdConfiguration for this chunk source.

trackSelection: ExoTrackSelection!

The track selection.

bufferedDurationUs: Long

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

playbackRate: Float

The playback rate indicating the current speed of playback.

@CmcdData.StreamingFormat streamingFormat: @CmcdData.StreamingFormat String!

The streaming format of the media content. Must be one of the allowed streaming formats specified by the CmcdData.StreamingFormat annotation.

isLive: Boolean

true if the media content is being streamed live, false otherwise.

didRebuffer: Boolean

true if a rebuffering event happened between the previous request and this one, false otherwise.

isBufferEmpty: Boolean

true if the queue of buffered chunks is empty, false otherwise.

Throws
java.lang.IllegalArgumentException

If bufferedDurationUs is negative or playbackRate is non-positive.

Public functions

createCmcdData

fun createCmcdData(): CmcdData!

getObjectType

@CmcdData.ObjectType
java-static fun getObjectType(trackSelection: ExoTrackSelection!): @CmcdData.ObjectType String?

Retrieves the object type value from the given ExoTrackSelection.

Parameters
trackSelection: ExoTrackSelection!

The ExoTrackSelection from which to retrieve the object type.

Returns
@CmcdData.ObjectType String?

The object type value as a String if TrackType can be mapped to one of the object types specified by CmcdData.ObjectType annotation, or null.

Throws
java.lang.IllegalArgumentException

if the provided ExoTrackSelection is null.

setChunkDurationUs

@CanIgnoreReturnValue
fun setChunkDurationUs(chunkDurationUs: Long): CmcdData.Factory!

Sets the duration of current media chunk being requested, in microseconds. The default value is TIME_UNSET.

Throws
java.lang.IllegalArgumentException

If chunkDurationUs is negative.

setNextObjectRequest

@CanIgnoreReturnValue
fun setNextObjectRequest(nextObjectRequest: String?): CmcdData.Factory!

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
fun setNextRangeRequest(nextRangeRequest: String?): CmcdData.Factory!

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
fun setObjectType(@CmcdData.ObjectType objectType: @CmcdData.ObjectType String?): CmcdData.Factory!

Sets the object type of the current object being requested. Must be one of the allowed object types specified by the CmcdData.ObjectType annotation.

Default is null.