Skip to main content

Interface: CastHandoffLocalPlayer

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

The only things the handoff needs from a local player — the write side. (The read side is the WireCastHandoffOptions.snapshot provider: one atomic queue+cursor+clock read at handoff time.)

Structural on purpose: our Player behind an app adapter, any other RN player, or a test fake all satisfy it. This package must never import @afkcodes/timbre-player.

Methods​

getPosition()​

getPosition(): number;

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

Projected local position in seconds (parity with the snapshot's position).

Returns​

number


isPlaying()​

isPlaying(): boolean;

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

Whether local playback is advancing (parity with playWhenReady).

Returns​

boolean


pause()​

pause(): void | Promise<void>;

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

Silence the local player for the session (a handoff-to-cast begins with this).

Returns​

void | Promise<void>


play()​

play(): void | Promise<void>;

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

Resume local playback (a transfer-back with playWhenReady).

Returns​

void | Promise<void>


seekTo()​

seekTo(seconds: number): void | Promise<void>;

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

Seek the current entry to seconds.

Parameters​

ParameterType
secondsnumber

Returns​

void | Promise<void>


skipToIndex()​

skipToIndex(index: number): void | Promise<void>;

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

Move the local queue cursor to index without starting playback — the transfer-back sequence is skipToIndex → seekTo → play?, and a playWhenReady: false transfer must land paused.

Parameters​

ParameterType
indexnumber

Returns​

void | Promise<void>