CmcdData
@UnstableApi
public final class CmcdData
This class provides functionality for generating and adding Common Media Client Data (CMCD) data to 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.
Summary
Nested types |
|---|
public final class CmcdData.Factory
|
@Retention(value = RetentionPolicy.SOURCE)Indicates the media type of current object being requested. |
@Retention(value = RetentionPolicy.SOURCE)Indicates the type of streaming for media content. |
@Retention(value = RetentionPolicy.SOURCE)Indicates the streaming format used for media content. |
Constants |
|
|---|---|
static final String |
OBJECT_TYPE_AUDIO_ONLY = "a"Represents the object type for audio-only content in a media container. |
static final String |
OBJECT_TYPE_INIT_SEGMENT = "i"Represents the object type for an initialization segment in a media container. |
static final String |
OBJECT_TYPE_MANIFEST = "m"Represents the object type for a manifest or playlist file, in a media container. |
static final String |
Represents the object type for muxed audio and video content in a media container. |
static final String |
OBJECT_TYPE_VIDEO_ONLY = "v"Represents the object type for video-only content in a media container. |
static final String |
STREAMING_FORMAT_DASH = "d"Represents the Dynamic Adaptive Streaming over HTTP (DASH) format. |
static final String |
STREAMING_FORMAT_HLS = "h"Represents the HTTP Live Streaming (HLS) format. |
static final String |
STREAMING_FORMAT_SS = "s"Represents the Smooth Streaming (SS) format. |
static final String |
STREAM_TYPE_LIVE = "l"Represents the Live Streaming stream type. |
static final String |
STREAM_TYPE_VOD = "v"Represents the Video on Demand (VOD) stream type. |
Public methods |
|
|---|---|
DataSpec |
addToDataSpec(DataSpec dataSpec)Adds Common Media Client Data (CMCD) related information to the provided |
static DataSpec |
removeFromDataSpec(DataSpec dataSpec)Removes Common Media Client Data (CMCD) related information from the provided |
static Uri |
removeFromUri(Uri uri)Removes Common Media Client Data (CMCD) related information from the provided |
Constants
OBJECT_TYPE_AUDIO_ONLY
public static final String OBJECT_TYPE_AUDIO_ONLY = "a"
Represents the object type for audio-only content in a media container.
OBJECT_TYPE_INIT_SEGMENT
public static final String OBJECT_TYPE_INIT_SEGMENT = "i"
Represents the object type for an initialization segment in a media container.
OBJECT_TYPE_MANIFEST
public static final String OBJECT_TYPE_MANIFEST = "m"
Represents the object type for a manifest or playlist file, in a media container.
OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO
public static final String OBJECT_TYPE_MUXED_AUDIO_AND_VIDEO = "av"
Represents the object type for muxed audio and video content in a media container.
OBJECT_TYPE_VIDEO_ONLY
public static final String OBJECT_TYPE_VIDEO_ONLY = "v"
Represents the object type for video-only content in a media container.
STREAMING_FORMAT_DASH
public static final String STREAMING_FORMAT_DASH = "d"
Represents the Dynamic Adaptive Streaming over HTTP (DASH) format.
STREAMING_FORMAT_HLS
public static final String STREAMING_FORMAT_HLS = "h"
Represents the HTTP Live Streaming (HLS) format.
STREAMING_FORMAT_SS
public static final String STREAMING_FORMAT_SS = "s"
Represents the Smooth Streaming (SS) format.
STREAM_TYPE_LIVE
public static final String STREAM_TYPE_LIVE = "l"
Represents the Live Streaming stream type.
STREAM_TYPE_VOD
public static final String STREAM_TYPE_VOD = "v"
Represents the Video on Demand (VOD) stream type.
Public methods
addToDataSpec
public DataSpec addToDataSpec(DataSpec dataSpec)
Adds Common Media Client Data (CMCD) related information to the provided DataSpec object.
removeFromDataSpec
public static DataSpec removeFromDataSpec(DataSpec dataSpec)
Removes Common Media Client Data (CMCD) related information from the provided DataSpec object.
removeFromUri
public static Uri removeFromUri(Uri uri)
Removes Common Media Client Data (CMCD) related information from the provided Uri.