chrome-devtools-kotlin / org.hildan.chrome.devtools.domains.cast / CastDomain

CastDomain

class CastDomain

A domain for interacting with Cast, Presentation API, and Remote Playback API functionalities.

Official doc

Functions

disable

Stops observing for sinks and issues.

suspend fun disable(): Unit

enable

Starts observing for sinks that can be used for tab mirroring, and if set, sinks compatible with |presentationUrl| as well. When sinks are found, a |sinksUpdated| event is fired. Also starts observing for issue messages. When an issue is added or removed, an |issueUpdated| event is fired.

suspend fun enable(input: EnableRequest): Unit

events

Subscribes to all events related to this domain.

fun events(): Flow<CastEvent>

issueUpdated

This is fired whenever the outstanding issue/error message changes. |issueMessage| is empty if there is no issue.

fun issueUpdated(): Flow<IssueUpdatedEvent>

setSinkToUse

Sets a sink to be used when the web page requests the browser to choose a sink via Presentation API, Remote Playback API, or Cast SDK.

suspend fun setSinkToUse(input: SetSinkToUseRequest): Unit

sinksUpdated

This is fired whenever the list of available sinks changes. A sink is a device or a software surface that you can cast to.

fun sinksUpdated(): Flow<SinksUpdatedEvent>

startTabMirroring

Starts mirroring the tab to the sink.

suspend fun startTabMirroring(input: StartTabMirroringRequest): Unit

stopCasting

Stops the active Cast session on the sink.

suspend fun stopCasting(input: StopCastingRequest): Unit