Media

class Media(cdp: CDP) : Domain

This domain allows detailed inspection of media elements

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class PlayerError(val errorType: String, val code: Int, val stack: List<Media.PlayerErrorSourceLocation>, val cause: List<Media.PlayerError>, val data: Map<String, JsonElement>)

Corresponds to kMediaError

Link copied to clipboard
@Serializable
data class PlayerErrorSourceLocation(val file: String, val line: Int)

Represents logged source line numbers reported in an error. NOTE: file and line are from chromium c++ implementation code, not js.

Link copied to clipboard
@Serializable
data class PlayerErrorsRaisedParameter(val playerId: String, val errors: List<Media.PlayerError>)

Send a list of any errors that need to be delivered.

Link copied to clipboard
@Serializable
data class PlayerEvent(val timestamp: Double, val value: String)

Corresponds to kMediaEventTriggered

Link copied to clipboard
@Serializable
data class PlayerEventsAddedParameter(val playerId: String, val events: List<Media.PlayerEvent>)

Send events as a list, allowing them to be batched on the browser for less congestion. If batched, events must ALWAYS be in chronological order.

Link copied to clipboard
@Serializable
data class PlayerMessage(val level: String, val message: String)

Have one type per entry in MediaLogRecord::Type Corresponds to kMessage

Link copied to clipboard
@Serializable
data class PlayerMessagesLoggedParameter(val playerId: String, val messages: List<Media.PlayerMessage>)

Send a list of any messages that need to be delivered.

Link copied to clipboard
@Serializable
data class PlayerPropertiesChangedParameter(val playerId: String, val properties: List<Media.PlayerProperty>)

This can be called multiple times, and can be used to set / override / remove player properties. A null propValue indicates removal.

Link copied to clipboard
@Serializable
data class PlayerProperty(val name: String, val value: String)

Corresponds to kMediaPropertyChange

Link copied to clipboard
@Serializable
data class PlayersCreatedParameter(val players: List<String>)

Called whenever a player is created, or when a new agent joins and receives a list of active players. If an agent is restored, it will receive the full list of player ids and all events again.

Properties

Link copied to clipboard

Send a list of any errors that need to be delivered.

Link copied to clipboard

Send events as a list, allowing them to be batched on the browser for less congestion. If batched, events must ALWAYS be in chronological order.

Link copied to clipboard

Send a list of any messages that need to be delivered.

Link copied to clipboard

This can be called multiple times, and can be used to set / override / remove player properties. A null propValue indicates removal.

Link copied to clipboard

Called whenever a player is created, or when a new agent joins and receives a list of active players. If an agent is restored, it will receive the full list of player ids and all events again.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables the Media domain.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

Enables the Media domain