跳到主要内容

Media🧪

该域允许对''和``内的媒体元素进行详细检查。

EN
This domain allows detailed inspection of media elements.

✅️️ Methods

🔨Media.disable

禁用媒体域。

EN
Disables the Media domain.

🔨Media.enable

启用媒体域

EN
Enables the Media domain

✅️️ Events

👋Media.playerCreated

每当玩家被创建时,或新代理加入并接收到活跃玩家列表时调用。如果代理被恢复,它将为每个活跃玩家收到一个事件。

EN
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.
参数必填标记类型描述原文
player✔️Player

👋Media.playerErrorsRaised

发送任何需要交付的错误列表。

EN
Send a list of any errors that need to be delivered.
参数必填标记类型描述原文
playerId✔️PlayerId
errors✔️array[PlayerError]

👋Media.playerEventsAdded

将事件以列表形式发送,允许浏览器对其进行批处理以减少拥塞。如果进行批处理,事件必须始终按时间顺序排列。

EN
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.
参数必填标记类型描述原文
playerId✔️PlayerId
events✔️array[PlayerEvent]

👋Media.playerMessagesLogged

发送需要传递的任何消息列表。

EN
Send a list of any messages that need to be delivered.
参数必填标记类型描述原文
playerId✔️PlayerId
messages✔️array[PlayerMessage]

👋Media.playerPropertiesChanged

这可以被多次调用,用于设置、覆盖或移除播放器属性。nullpropValue 表示移除操作。

EN
This can be called multiple times, and can be used to set / override / remove player properties. A null propValue indicates removal.
参数必填标记类型描述原文
playerId✔️PlayerId
properties✔️array[PlayerProperty]

✅️️ Types

📌Media.Player

返回类型:object

属性必填标记类型描述原文
playerId✔️PlayerId
domNodeIdDOM.BackendNodeId

📌Media.PlayerError

对应 kMediaError

EN
Corresponds to kMediaError

返回类型:object

属性必填标记类型描述原文
errorType✔️string
code✔️integer代码是特定错误代码集合的数字枚举条目,例如 media/base/pipeline_status.h 中的 PipelineStatusCodes。
ENCode is the numeric enum entry for a specific set of error codes, such as PipelineStatusCodes in media/base/pipeline_status.h
stack✔️array[PlayerErrorSourceLocation]此错误的引发/传递路径追踪。
ENA trace of where this error was caused / where it passed through.
cause✔️array[PlayerError]错误可能有一个根本原因错误,例如,DecoderError 可能由 WindowsError 引起。
ENErrors potentially have a root cause error, ie, a DecoderError might be caused by an WindowsError
data✔️object附加到错误的额外数据,例如HRESULT、Video Codec等。
ENExtra data attached to an error, such as an HRESULT, Video Codec, etc.

📌Media.PlayerErrorSourceLocation

表示错误中报告记录的源代码行号。注意:file 和 line 来自 Chromium C++ 实现代码,而非 JavaScript。

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

返回类型:object

属性必填标记类型描述原文
file✔️string
line✔️integer

📌Media.PlayerEvent

对应 kMediaEventTriggered

EN
Corresponds to kMediaEventTriggered

返回类型:object

属性必填标记类型描述原文
timestamp✔️Timestamp
value✔️string

📌Media.PlayerId

玩家将获得一个在代理上下文中唯一的ID。

EN
Players will get an ID that is unique within the agent context.

返回类型:string


📌Media.PlayerMessage

每个条目在MediaLogRecord::Type中对应一种类型,对应于kMessage

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

返回类型:object

属性必填标记类型描述原文
level✔️string与MediaLogMessageLevel保持同步。目前我们将消息级别“error”与PlayerError类型分开处理,因为它们目前代表不同的事物:一个是基于用户界面中选择的日志级别打印的DVLOG(ERROR)风格日志消息,另一个则是media::PipelineStatus对象的表示形式。不过很快我们将不再使用PipelineStatus处理错误,并引入新的错误类型,这将有望让我们将错误日志级别整合到PlayerError类型中。

允许取值:errorwarninginfodebug
ENKeep 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.
Allowed Values: error, warning, info, debug
message✔️string

📌Media.PlayerProperty

对应 kMediaPropertyChange

EN
Corresponds to kMediaPropertyChange

返回类型:object

属性必填标记类型描述原文
name✔️string
value✔️string

📌Media.Timestamp

返回类型:number