cast

package
v0.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cast provides the Chrome DevTools Protocol commands, types, and events for the Cast domain.

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

Generated by the cdproto-gen command.

Index

Constants

View Source
const (
	CommandEnable                = "Cast.enable"
	CommandDisable               = "Cast.disable"
	CommandSetSinkToUse          = "Cast.setSinkToUse"
	CommandStartDesktopMirroring = "Cast.startDesktopMirroring"
	CommandStartTabMirroring     = "Cast.startTabMirroring"
	CommandStopCasting           = "Cast.stopCasting"
)

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type DisableParams

type DisableParams struct{}

DisableParams stops observing for sinks and issues.

func Disable

func Disable() *DisableParams

Disable stops observing for sinks and issues.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-disable

func (*DisableParams) Do

func (p *DisableParams) Do(ctx context.Context) (err error)

Do executes Cast.disable against the provided context.

type EnableParams

type EnableParams struct {
	PresentationURL string `json:"presentationUrl,omitempty"`
}

EnableParams 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.

func Enable

func Enable() *EnableParams

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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-enable

parameters:

func (*EnableParams) Do

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes Cast.enable against the provided context.

func (EnableParams) WithPresentationURL

func (p EnableParams) WithPresentationURL(presentationURL string) *EnableParams

WithPresentationURL [no description].

type EventIssueUpdated

type EventIssueUpdated struct {
	IssueMessage string `json:"issueMessage"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#event-issueUpdated

type EventSinksUpdated

type EventSinksUpdated struct {
	Sinks []*Sink `json:"sinks"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#event-sinksUpdated

type SetSinkToUseParams

type SetSinkToUseParams struct {
	SinkName string `json:"sinkName"`
}

SetSinkToUseParams 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.

func SetSinkToUse

func SetSinkToUse(sinkName string) *SetSinkToUseParams

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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-setSinkToUse

parameters:

sinkName

func (*SetSinkToUseParams) Do

func (p *SetSinkToUseParams) Do(ctx context.Context) (err error)

Do executes Cast.setSinkToUse against the provided context.

type Sink

type Sink struct {
	Name    string `json:"name"`
	ID      string `json:"id"`
	Session string `json:"session,omitempty"` // Text describing the current session. Present only if there is an active session on the sink.
}

Sink [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#type-Sink

type StartDesktopMirroringParams

type StartDesktopMirroringParams struct {
	SinkName string `json:"sinkName"`
}

StartDesktopMirroringParams starts mirroring the desktop to the sink.

func StartDesktopMirroring

func StartDesktopMirroring(sinkName string) *StartDesktopMirroringParams

StartDesktopMirroring starts mirroring the desktop to the sink.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-startDesktopMirroring

parameters:

sinkName

func (*StartDesktopMirroringParams) Do

Do executes Cast.startDesktopMirroring against the provided context.

type StartTabMirroringParams

type StartTabMirroringParams struct {
	SinkName string `json:"sinkName"`
}

StartTabMirroringParams starts mirroring the tab to the sink.

func StartTabMirroring

func StartTabMirroring(sinkName string) *StartTabMirroringParams

StartTabMirroring starts mirroring the tab to the sink.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-startTabMirroring

parameters:

sinkName

func (*StartTabMirroringParams) Do

func (p *StartTabMirroringParams) Do(ctx context.Context) (err error)

Do executes Cast.startTabMirroring against the provided context.

type StopCastingParams

type StopCastingParams struct {
	SinkName string `json:"sinkName"`
}

StopCastingParams stops the active Cast session on the sink.

func StopCasting

func StopCasting(sinkName string) *StopCastingParams

StopCasting stops the active Cast session on the sink.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-stopCasting

parameters:

sinkName

func (*StopCastingParams) Do

func (p *StopCastingParams) Do(ctx context.Context) (err error)

Do executes Cast.stopCasting against the provided context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL