Back to Exoplayer

CmcdHeadersFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/CmcdHeadersFactory.html

latest13.2 KB
Original Source

Package com.google.android.exoplayer2.upstream

Class CmcdHeadersFactory


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classCmcdHeadersFactoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

This class serves as a factory for generating Common Media Client Data (CMCD) HTTP request headers in adaptive streaming formats, DASH, HLS, and SmoothStreaming.

It encapsulates the necessary attributes and information relevant to media content playback, following the guidelines specified in the CMCD standard document CTA-5004.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static interface | CmcdHeadersFactory.ObjectType | Deprecated.

Indicates the media type of current object being requested. | | static interface | CmcdHeadersFactory.StreamingFormat | Deprecated.

Indicates the streaming format used for media content. | | static interface | CmcdHeadersFactory.StreamType | Deprecated.

Indicates the type of streaming for media content. |

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static String | OBJECT_TYPE_AUDIO_ONLY | Deprecated.

Represents the object type for audio-only content in a media container. | | static String | OBJECT_TYPE_INIT_SEGMENT | Deprecated.

Represents the object type for an initialization segment in a media container. | | static String | OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO | Deprecated.

Represents the object type for muxed audio and video content in a media container. | | static String | OBJECT_TYPE_VIDEO_ONLY | Deprecated.

Represents the object type for video-only content in a media container. | | static String | STREAM_TYPE_LIVE | Deprecated.

Represents the Live Streaming stream type. | | static String | STREAM_TYPE_VOD | Deprecated.

Represents the Video on Demand (VOD) stream type. | | static String | STREAMING_FORMAT_DASH | Deprecated.

Represents the Dynamic Adaptive Streaming over HTTP (DASH) format. | | static String | STREAMING_FORMAT_HLS | Deprecated.

Represents the HTTP Live Streaming (HLS) format. | | static String | STREAMING_FORMAT_SS | Deprecated.

Represents the Smooth Streaming (SS) format. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | CmcdHeadersFactory​(CmcdConfiguration cmcdConfiguration, ExoTrackSelection trackSelection, long bufferedDurationUs, @StreamingFormat String streamingFormat, boolean isLive) | Deprecated.

Creates an instance. |

Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | ImmutableMap<@HeaderKey String,​String> | createHttpRequestHeaders() | Deprecated.

Creates and returns a new ImmutableMap containing the CMCD HTTP request headers. | | static @ObjectType String | getObjectType​(ExoTrackSelection trackSelection) | Deprecated.

Retrieves the object type value from the given ExoTrackSelection. | | CmcdHeadersFactory | setChunkDurationUs​(long chunkDurationUs) | Deprecated.

Sets the duration of current media chunk being requested, in microseconds. | | CmcdHeadersFactory | setObjectType​(@ObjectType String objectType) | Deprecated.

Sets the object type of the current object being requested. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

STREAMING_FORMAT_DASH

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")STREAMING_FORMAT_DASH

Deprecated.

Represents the Dynamic Adaptive Streaming over HTTP (DASH) format. See Also:Constant Field Values

- 

STREAMING_FORMAT_HLS

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")STREAMING_FORMAT_HLS

Deprecated.

Represents the HTTP Live Streaming (HLS) format. See Also:Constant Field Values

- 

STREAMING_FORMAT_SS

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")STREAMING_FORMAT_SS

Deprecated.

Represents the Smooth Streaming (SS) format. See Also:Constant Field Values

- 

STREAM_TYPE_VOD

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")STREAM_TYPE_VOD

Deprecated.

Represents the Video on Demand (VOD) stream type. See Also:Constant Field Values

- 

STREAM_TYPE_LIVE

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")STREAM_TYPE_LIVE

Deprecated.

Represents the Live Streaming stream type. See Also:Constant Field Values

- 

OBJECT_TYPE_INIT_SEGMENT

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")OBJECT_TYPE_INIT_SEGMENT

Deprecated.

Represents the object type for an initialization segment in a media container. See Also:Constant Field Values

- 

OBJECT_TYPE_AUDIO_ONLY

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")OBJECT_TYPE_AUDIO_ONLY

Deprecated.

Represents the object type for audio-only content in a media container. See Also:Constant Field Values

- 

OBJECT_TYPE_VIDEO_ONLY

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")OBJECT_TYPE_VIDEO_ONLY

Deprecated.

Represents the object type for video-only content in a media container. See Also:Constant Field Values

- 

OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO

Deprecated.

Represents the object type for muxed audio and video content in a media container. See Also:Constant Field Values

Constructor Detail

- 

CmcdHeadersFactory

public CmcdHeadersFactory​([CmcdConfiguration](CmcdConfiguration.html "class in com.google.android.exoplayer2.upstream")cmcdConfiguration,[ExoTrackSelection](../trackselection/ExoTrackSelection.html "interface in com.google.android.exoplayer2.trackselection")trackSelection,
                          long bufferedDurationUs,[@StreamingFormat](CmcdHeadersFactory.StreamingFormat.html "annotation in com.google.android.exoplayer2.upstream")[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")streamingFormat,
                          boolean isLive)

Deprecated.

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.streamingFormat - The streaming format of the media content. Must be one of the allowed streaming formats specified by the CmcdHeadersFactory.StreamingFormat annotation.isLive - true if the media content is being streamed live, false otherwise.Throws:IllegalArgumentException - If bufferedDurationUs is negative.

Method Detail

- 

getObjectType

@Nullable
public static[@ObjectType](CmcdHeadersFactory.ObjectType.html "annotation in com.google.android.exoplayer2.upstream")[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getObjectType​([ExoTrackSelection](../trackselection/ExoTrackSelection.html "interface in com.google.android.exoplayer2.trackselection")trackSelection)

Deprecated.

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 CmcdHeadersFactory.ObjectType annotation, or null.Throws:IllegalArgumentException - if the provided ExoTrackSelection is null.

- 

setChunkDurationUs

@CanIgnoreReturnValue
public[CmcdHeadersFactory](CmcdHeadersFactory.html "class in com.google.android.exoplayer2.upstream")setChunkDurationUs​(long chunkDurationUs)

Deprecated.

Sets the duration of current media chunk being requested, in microseconds. The default value is C.TIME_UNSET. Throws:IllegalArgumentException - If chunkDurationUs is negative.

- 

setObjectType

@CanIgnoreReturnValue
public[CmcdHeadersFactory](CmcdHeadersFactory.html "class in com.google.android.exoplayer2.upstream")setObjectType​(@Nullable[@ObjectType](CmcdHeadersFactory.ObjectType.html "annotation in com.google.android.exoplayer2.upstream")[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")objectType)

Deprecated.

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

Default is null.

- 

createHttpRequestHeaders

public[ImmutableMap](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableMap.html?is-external=true "class or interface in com.google.common.collect")<[@HeaderKey](CmcdConfiguration.HeaderKey.html "annotation in com.google.android.exoplayer2.upstream")[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang"),​[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> createHttpRequestHeaders()

Deprecated.

Creates and returns a new ImmutableMap containing the CMCD HTTP request headers.