Media#
This domain allows detailed inspection of media elements.
This CDP domain is experimental.
Types#
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
- class PlayerMessage(level, message)[source]#
Have one type per entry in MediaLogRecord::Type Corresponds to kMessage
-
level:
str# 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.
-
level:
- class PlayerErrorSourceLocation(file, line)[source]#
Represents logged source line numbers reported in an error. NOTE: file and line are from chromium c++ implementation code, not js.
- class PlayerError(error_type, code, stack, cause, data)[source]#
Corresponds to kMediaError
-
code:
int# Code is the numeric enum entry for a specific set of error codes, such as PipelineStatusCodes in media/base/pipeline_status.h
-
stack:
List[PlayerErrorSourceLocation]# A trace of where this error was caused / where it passed through.
-
cause:
List[PlayerError]# Errors potentially have a root cause error, ie, a DecoderError might be caused by an WindowsError
-
code:
Commands#
Each command is a generator function. The return
type Generator[x, y, z] indicates that the generator
yields arguments of type x, it must be resumed with
an argument of type y, and it returns type z. In
this library, types x and y are the same for all
commands, and z is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
Events#
Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.
- class PlayerPropertiesChanged(player_id, properties)[source]#
This can be called multiple times, and can be used to set / override / remove player properties. A null propValue indicates removal.
-
properties:
List[PlayerProperty]#
-
properties:
- class PlayerEventsAdded(player_id, events)[source]#
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.
-
events:
List[PlayerEvent]#
-
events:
- class PlayerMessagesLogged(player_id, messages)[source]#
Send a list of any messages that need to be delivered.
-
messages:
List[PlayerMessage]#
-
messages:
- class PlayerErrorsRaised(player_id, errors)[source]#
Send a list of any errors that need to be delivered.
-
errors:
List[PlayerError]#
-
errors: