Class CmcdHeadersFactory
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.CmcdHeadersFactory
-
@Deprecated public final class CmcdHeadersFactory extends Object
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 newImmutableMap
containing the CMCD HTTP request headers.static @ObjectType String
getObjectType(ExoTrackSelection trackSelection)
Deprecated.Retrieves the object type value from the givenExoTrackSelection
.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.
-
-
-
Field Detail
-
STREAMING_FORMAT_DASH
public static final String 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 STREAMING_FORMAT_HLS
Deprecated.Represents the HTTP Live Streaming (HLS) format.- See Also:
- Constant Field Values
-
STREAMING_FORMAT_SS
public static final String STREAMING_FORMAT_SS
Deprecated.Represents the Smooth Streaming (SS) format.- See Also:
- Constant Field Values
-
STREAM_TYPE_VOD
public static final String STREAM_TYPE_VOD
Deprecated.Represents the Video on Demand (VOD) stream type.- See Also:
- Constant Field Values
-
STREAM_TYPE_LIVE
public static final String STREAM_TYPE_LIVE
Deprecated.Represents the Live Streaming stream type.- See Also:
- Constant Field Values
-
OBJECT_TYPE_INIT_SEGMENT
public static final String 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 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 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 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, ExoTrackSelection trackSelection, long bufferedDurationUs, @StreamingFormat String streamingFormat, boolean isLive)
Deprecated.Creates an instance.- Parameters:
cmcdConfiguration
- TheCmcdConfiguration
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 theCmcdHeadersFactory.StreamingFormat
annotation.isLive
-true
if the media content is being streamed live,false
otherwise.- Throws:
IllegalArgumentException
- IfbufferedDurationUs
is negative.
-
-
Method Detail
-
getObjectType
@Nullable public static @ObjectType String getObjectType(ExoTrackSelection trackSelection)
Deprecated.Retrieves the object type value from the givenExoTrackSelection
.- Parameters:
trackSelection
- TheExoTrackSelection
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 byCmcdHeadersFactory.ObjectType
annotation, ornull
. - Throws:
IllegalArgumentException
- if the providedExoTrackSelection
isnull
.
-
setChunkDurationUs
@CanIgnoreReturnValue public CmcdHeadersFactory setChunkDurationUs(long chunkDurationUs)
Deprecated.Sets the duration of current media chunk being requested, in microseconds. The default value isC.TIME_UNSET
.- Throws:
IllegalArgumentException
- IfchunkDurationUs
is negative.
-
setObjectType
@CanIgnoreReturnValue public CmcdHeadersFactory setObjectType(@Nullable @ObjectType String objectType)
Deprecated.Sets the object type of the current object being requested. Must be one of the allowed object types specified by theCmcdHeadersFactory.ObjectType
annotation.Default is
null
.
-
createHttpRequestHeaders
public ImmutableMap<@HeaderKey String,String> createHttpRequestHeaders()
Deprecated.Creates and returns a newImmutableMap
containing the CMCD HTTP request headers.
-
-