CastDomain

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

Official doc

Functions

Link copied to clipboard
suspend fun disable(): DisableResponse

Stops observing for sinks and issues.

Link copied to clipboard
inline suspend fun enable(optionalArgs: EnableRequest.Builder.() -> Unit = {}): EnableResponse
suspend fun enable(input: EnableRequest): EnableResponse

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.

Link copied to clipboard
fun events(): Flow<CastEvent>

Subscribes to all events related to this domain.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
suspend fun setSinkToUse(sinkName: String): SetSinkToUseResponse

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.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

Starts mirroring the desktop to the sink.

Link copied to clipboard

Starts mirroring the tab to the sink.

Link copied to clipboard
suspend fun stopCasting(sinkName: String): StopCastingResponse

Stops the active Cast session on the sink.