Cast

class Cast(cdp: CDP) : Domain

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

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class EnableParameter(val presentationUrl: String? = null)
Link copied to clipboard
@Serializable
data class IssueUpdatedParameter(val issueMessage: String)

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

Link copied to clipboard
@Serializable
data class SetSinkToUseParameter(val sinkName: String)
Link copied to clipboard
@Serializable
data class Sink(val name: String, val id: String, val session: String? = null)
Link copied to clipboard
@Serializable
data class SinksUpdatedParameter(val sinks: List<Cast.Sink>)

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
@Serializable
data class StartDesktopMirroringParameter(val sinkName: String)
Link copied to clipboard
@Serializable
data class StartTabMirroringParameter(val sinkName: String)
Link copied to clipboard
@Serializable
data class StopCastingParameter(val sinkName: String)

Properties

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

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

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Stops observing for sinks and issues.

Link copied to clipboard
suspend fun enable(presentationUrl: String? = null)
suspend fun enable(args: Cast.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)

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
suspend fun setSinkToUse(sinkName: String)
suspend fun setSinkToUse(args: Cast.SetSinkToUseParameter, mode: CommandMode = CommandMode.DEFAULT)

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
suspend fun startDesktopMirroring(sinkName: String)
suspend fun startDesktopMirroring(args: Cast.StartDesktopMirroringParameter, mode: CommandMode = CommandMode.DEFAULT)

Starts mirroring the desktop to the sink.

Link copied to clipboard
suspend fun startTabMirroring(sinkName: String)
suspend fun startTabMirroring(args: Cast.StartTabMirroringParameter, mode: CommandMode = CommandMode.DEFAULT)

Starts mirroring the tab to the sink.

Link copied to clipboard
suspend fun stopCasting(sinkName: String)
suspend fun stopCasting(args: Cast.StopCastingParameter, mode: CommandMode = CommandMode.DEFAULT)

Stops the active Cast session on the sink.