Table of Contents

Class MediaAdapter

Namespace
OpenQA.Selenium.DevTools.V146.Media
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Media domain to simplify the command interface.

public class MediaAdapter
Inheritance
MediaAdapter
Inherited Members

Constructors

MediaAdapter(IDevToolsSession)

Initializes a new instance of the MediaAdapter class.

public MediaAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disables the Media domain.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings?, CancellationToken, int?, bool)

Enables the Media domain

public Task<EnableCommandResponse?> Enable(EnableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

Events

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.

public event EventHandler<PlayerCreatedEventArgs>? PlayerCreated

Event Type

EventHandler<PlayerCreatedEventArgs>

PlayerErrorsRaised

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

public event EventHandler<PlayerErrorsRaisedEventArgs>? PlayerErrorsRaised

Event Type

EventHandler<PlayerErrorsRaisedEventArgs>

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.

public event EventHandler<PlayerEventsAddedEventArgs>? PlayerEventsAdded

Event Type

EventHandler<PlayerEventsAddedEventArgs>

PlayerMessagesLogged

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

public event EventHandler<PlayerMessagesLoggedEventArgs>? PlayerMessagesLogged

Event Type

EventHandler<PlayerMessagesLoggedEventArgs>

PlayerPropertiesChanged

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

public event EventHandler<PlayerPropertiesChangedEventArgs>? PlayerPropertiesChanged

Event Type

EventHandler<PlayerPropertiesChangedEventArgs>