跳到主要内容

Cast🧪

一个用于与''Cast''、''Presentation API''和Remote Playback API功能交互的领域。

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

✅️️ Methods

🔨Cast.disable

停止观察接收器和问题。

EN
Stops observing for sinks and issues.

🔨Cast.enable

开始观察可用于标签页镜像的接收器,如果设置了,也会观察与 |presentationUrl| 兼容的接收器。当发现接收器时,会触发 |sinksUpdated| 事件。同时开始观察问题消息。当问题被添加或移除时,会触发 |issueUpdated| 事件。

EN
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.
参数必填标记类型描述原文
presentationUrlstring

🔨Cast.setSinkToUse

当网页通过Presentation API、Remote Playback API或Cast SDK请求浏览器选择接收器时,设置要使用的接收器。

EN
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.
参数必填标记类型描述原文
sinkName✔️string

🔨Cast.startDesktopMirroring

开始将桌面镜像到接收端。

EN
Starts mirroring the desktop to the sink.
参数必填标记类型描述原文
sinkName✔️string

🔨Cast.startTabMirroring

开始将标签页镜像到接收端。

EN
Starts mirroring the tab to the sink.
参数必填标记类型描述原文
sinkName✔️string

🔨Cast.stopCasting

停止接收器上的活动 Cast 会话。

EN
Stops the active Cast session on the sink.
参数必填标记类型描述原文
sinkName✔️string

✅️️ Events

👋Cast.issueUpdated

每当未解决的问题/错误信息发生变化时,此事件就会被触发。如果不存在问题,|issueMessage| 将为空。

EN
This is fired whenever the outstanding issue/error message changes. |issueMessage| is empty if there is no issue.
参数必填标记类型描述原文
issueMessage✔️string

👋Cast.sinksUpdated

每当可用接收器列表发生变化时,都会触发此事件。接收器是指您可以投射到的设备或软件界面。

EN
This is fired whenever the list of available sinks changes. A sink is a device or a software surface that you can cast to.
参数必填标记类型描述原文
sinks✔️array[Sink]

✅️️ Types

📌Cast.Sink

返回类型:object

属性必填标记类型描述原文
name✔️string
id✔️string
sessionstring描述当前会话的文本。仅在接收器上有活动会话时显示。
ENText describing the current session. Present only if there is an active session on the sink.