Skip to main content

Function: wireCastHandoff()

function wireCastHandoff(local: CastHandoffLocalPlayer, options: WireCastHandoffOptions): CastHandoff;

Defined in: packages/cast/src/handoff.ts:162

Wire the handoff between a local player and the cast surface.

Idle until a session appears: castTo() (in-app picker), or the platform doing it — requestSession()/<CastButton/>'s dialog, or Android's system output switcher — all funnel into the same machine, so a switcher-initiated session pauses local playback and loads the receiver queue exactly like an in-app one. A session that already existed before wiring is deliberately left alone (auto-casting over whatever the receiver is doing at app launch would be destructive); castTo reuses it on the next user gesture.

Parameters

ParameterType
localCastHandoffLocalPlayer
optionsWireCastHandoffOptions

Returns

CastHandoff