@UnstableApi
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

CmcdData.Factory for CmcdData instances.

@Retention(value = RetentionPolicy.SOURCE)
@StringDef(value = )
@Documented
@Target(value = TYPE_USE)
annotation CmcdData.ObjectType

Indicates the media type of current object being requested.

@Retention(value = RetentionPolicy.SOURCE)
@StringDef(value = )
@Documented
@Target(value = TYPE_USE)
annotation CmcdData.StreamType

Indicates the type of streaming for media content.

@Retention(value = RetentionPolicy.SOURCE)
@StringDef(value = )
@Documented
@Target(value = TYPE_USE)
annotation CmcdData.StreamingFormat

Indicates the streaming format used for media content.

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 a manifest or playlist file, 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 functions

DataSpec!
addToDataSpec(dataSpec: DataSpec!)

Adds Common Media Client Data (CMCD) related information to the provided DataSpec object.

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_MANIFEST

const val OBJECT_TYPE_MANIFEST = "m": String!

Represents the object type for a manifest or playlist file, 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 functions

addToDataSpec

fun addToDataSpec(dataSpec: DataSpec!): DataSpec!

Adds Common Media Client Data (CMCD) related information to the provided DataSpec object.