media

package
v0.158.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package media provides the Chrome DevTools Protocol commands, types, and events for the Media domain.

This domain allows detailed inspection of media elements.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandEnable  = "Media.enable"
	CommandDisable = "Media.disable"
)

Command names.

Variables

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disables the Media domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#method-disable

Enable enables the Media domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#method-enable

View Source
var PlayerCreated = cdp.Event[EventPlayerCreated]{Method: "Media.playerCreated"}

PlayerCreated 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 one event for each active player.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerCreated

View Source
var PlayerErrorsRaised = cdp.Event[EventPlayerErrorsRaised]{Method: "Media.playerErrorsRaised"}

PlayerErrorsRaised send a list of any errors that need to be delivered.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerErrorsRaised

View Source
var PlayerEventsAdded = cdp.Event[EventPlayerEventsAdded]{Method: "Media.playerEventsAdded"}

PlayerEventsAdded 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerEventsAdded

View Source
var PlayerMessagesLogged = cdp.Event[EventPlayerMessagesLogged]{Method: "Media.playerMessagesLogged"}

PlayerMessagesLogged send a list of any messages that need to be delivered.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerMessagesLogged

View Source
var PlayerPropertiesChanged = cdp.Event[EventPlayerPropertiesChanged]{Method: "Media.playerPropertiesChanged"}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerPropertiesChanged

Functions

This section is empty.

Types

type EventPlayerCreated

type EventPlayerCreated struct {
	Player *Player `json:"player"`
}

EventPlayerCreated 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 one event for each active player.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerCreated

type EventPlayerErrorsRaised

type EventPlayerErrorsRaised struct {
	PlayerID PlayerID       `json:"playerId"`
	Errors   []*PlayerError `json:"errors"`
}

EventPlayerErrorsRaised send a list of any errors that need to be delivered.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerErrorsRaised

type EventPlayerEventsAdded

type EventPlayerEventsAdded struct {
	PlayerID PlayerID       `json:"playerId"`
	Events   []*PlayerEvent `json:"events"`
}

EventPlayerEventsAdded 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerEventsAdded

type EventPlayerMessagesLogged

type EventPlayerMessagesLogged struct {
	PlayerID PlayerID         `json:"playerId"`
	Messages []*PlayerMessage `json:"messages"`
}

EventPlayerMessagesLogged send a list of any messages that need to be delivered.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerMessagesLogged

type EventPlayerPropertiesChanged

type EventPlayerPropertiesChanged struct {
	PlayerID   PlayerID          `json:"playerId"`
	Properties []*PlayerProperty `json:"properties"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerPropertiesChanged

type Player

type Player struct {
	PlayerID  PlayerID          `json:"playerId"`
	DomNodeID cdp.BackendNodeID `json:"domNodeId,omitempty,omitzero"`
}

Player [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-Player

type PlayerError

type PlayerError struct {
	ErrorType string                       `json:"errorType"`
	Code      int64                        `json:"code"`  // Code is the numeric enum entry for a specific set of error codes, such as PipelineStatusCodes in media/base/pipeline_status.h
	Stack     []*PlayerErrorSourceLocation `json:"stack"` // A trace of where this error was caused / where it passed through.
	Cause     []*PlayerError               `json:"cause"` // Errors potentially have a root cause error, ie, a DecoderError might be caused by an WindowsError
	Data      jsonv2.Value                 `json:"data"`
}

PlayerError corresponds to kMediaError.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerError

type PlayerErrorSourceLocation

type PlayerErrorSourceLocation struct {
	File string `json:"file"`
	Line int64  `json:"line"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerErrorSourceLocation

type PlayerEvent

type PlayerEvent struct {
	Timestamp Timestamp `json:"timestamp"`
	Value     string    `json:"value"`
}

PlayerEvent corresponds to kMediaEventTriggered.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerEvent

type PlayerID

type PlayerID string

PlayerID players will get an ID that is unique within the agent context.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerId

func (PlayerID) String

func (t PlayerID) String() string

String returns the PlayerID as string value.

type PlayerMessage

type PlayerMessage struct {
	Level   PlayerMessageLevel `json:"level"` // Keep in sync with MediaLogMessageLevel We are currently keeping the message level 'error' separate from the PlayerError type because right now they represent different things, this one being a DVLOG(ERROR) style log message that gets printed based on what log level is selected in the UI, and the other is a representation of a media::PipelineStatus object. Soon however we're going to be moving away from using PipelineStatus for errors and introducing a new error type which should hopefully let us integrate the error log level into the PlayerError type.
	Message string             `json:"message"`
}

PlayerMessage have one type per entry in MediaLogRecord::Type Corresponds to kMessage.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerMessage

type PlayerMessageLevel added in v0.157.1

type PlayerMessageLevel string

PlayerMessageLevel keep in sync with MediaLogMessageLevel We are currently keeping the message level 'error' separate from the PlayerError type because right now they represent different things, this one being a DVLOG(ERROR) style log message that gets printed based on what log level is selected in the UI, and the other is a representation of a media::PipelineStatus object. Soon however we're going to be moving away from using PipelineStatus for errors and introducing a new error type which should hopefully let us integrate the error log level into the PlayerError type.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerMessage

const (
	PlayerMessageLevelError   PlayerMessageLevel = "error"
	PlayerMessageLevelWarning PlayerMessageLevel = "warning"
	PlayerMessageLevelInfo    PlayerMessageLevel = "info"
	PlayerMessageLevelDebug   PlayerMessageLevel = "debug"
)

PlayerMessageLevel values.

func (PlayerMessageLevel) String added in v0.157.1

func (t PlayerMessageLevel) String() string

String returns the PlayerMessageLevel as string value.

type PlayerProperty

type PlayerProperty struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

PlayerProperty corresponds to kMediaPropertyChange.

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-PlayerProperty

type Timestamp

type Timestamp float64

Timestamp [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Media#type-Timestamp

func (Timestamp) Float64

func (t Timestamp) Float64() float64

Float64 returns the Timestamp as float64 value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL