public final class

CmcdData.Factory

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.upstream.CmcdData.Factory

Overview

CmcdData.Factory for CmcdData instances.

Summary

Fields
public static final java.lang.StringOBJECT_TYPE_AUDIO_ONLY

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

public static final java.lang.StringOBJECT_TYPE_INIT_SEGMENT

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

public static final java.lang.StringOBJECT_TYPE_MUXED_AUDIO_AND_VIDEO

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

public static final java.lang.StringOBJECT_TYPE_VIDEO_ONLY

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

public static final java.lang.StringSTREAM_TYPE_LIVE

Represents the Live Streaming stream type.

public static final java.lang.StringSTREAM_TYPE_VOD

Represents the Video on Demand (VOD) stream type.

public static final java.lang.StringSTREAMING_FORMAT_DASH

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

public static final java.lang.StringSTREAMING_FORMAT_HLS

Represents the HTTP Live Streaming (HLS) format.

public static final java.lang.StringSTREAMING_FORMAT_SS

Represents the Smooth Streaming (SS) format.

Constructors
publicFactory(CmcdConfiguration cmcdConfiguration, ExoTrackSelection trackSelection, long bufferedDurationUs, float playbackRate, java.lang.String streamingFormat, boolean isLive, boolean didRebuffer, boolean isBufferEmpty)

Creates an instance.

Methods
public CmcdDatacreateCmcdData()

public static java.lang.StringgetObjectType(ExoTrackSelection trackSelection)

Retrieves the object type value from the given ExoTrackSelection.

public CmcdData.FactorysetChunkDurationUs(long chunkDurationUs)

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

public CmcdData.FactorysetNextObjectRequest(java.lang.String nextObjectRequest)

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

public CmcdData.FactorysetNextRangeRequest(java.lang.String nextRangeRequest)

Sets the byte range representing the partial object request.

public CmcdData.FactorysetObjectType(java.lang.String objectType)

Sets the object type of the current object being requested.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final java.lang.String STREAMING_FORMAT_DASH

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

public static final java.lang.String STREAMING_FORMAT_HLS

Represents the HTTP Live Streaming (HLS) format.

public static final java.lang.String STREAMING_FORMAT_SS

Represents the Smooth Streaming (SS) format.

public static final java.lang.String STREAM_TYPE_VOD

Represents the Video on Demand (VOD) stream type.

public static final java.lang.String STREAM_TYPE_LIVE

Represents the Live Streaming stream type.

public static final java.lang.String OBJECT_TYPE_INIT_SEGMENT

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

public static final java.lang.String OBJECT_TYPE_AUDIO_ONLY

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

public static final java.lang.String OBJECT_TYPE_VIDEO_ONLY

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

public static final java.lang.String OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO

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

Constructors

public Factory(CmcdConfiguration cmcdConfiguration, ExoTrackSelection trackSelection, long bufferedDurationUs, float playbackRate, java.lang.String streamingFormat, boolean isLive, boolean didRebuffer, boolean isBufferEmpty)

Creates an instance.

Parameters:

cmcdConfiguration: The CmcdConfiguration for this chunk source.
trackSelection: The track selection.
bufferedDurationUs: The duration of media currently buffered from the current playback position, in microseconds.
playbackRate: The playback rate indicating the current speed of playback.
streamingFormat: The streaming format of the media content. Must be one of the allowed streaming formats specified by the CmcdData.StreamingFormat annotation.
isLive: true if the media content is being streamed live, false otherwise.
didRebuffer: true if a rebuffering event happened between the previous request and this one, false otherwise.
isBufferEmpty: true if the queue of buffered chunks is empty, false otherwise.

Methods

public static java.lang.String getObjectType(ExoTrackSelection trackSelection)

Retrieves the object type value from the given ExoTrackSelection.

Parameters:

trackSelection: The ExoTrackSelection from which to retrieve the object type.

Returns:

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

public CmcdData.Factory setChunkDurationUs(long chunkDurationUs)

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

public CmcdData.Factory setObjectType(java.lang.String objectType)

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.

public CmcdData.Factory setNextObjectRequest(java.lang.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.

public CmcdData.Factory setNextRangeRequest(java.lang.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.

public CmcdData createCmcdData()