Skip to main content

Type Alias: CastHandoffEffect

type CastHandoffEffect =
| {
deviceId: string;
type: "connect";
}
| {
type: "pauseLocal";
}
| {
items: readonly CastQueueItemInput[];
startIndex: number;
startPosition: number;
type: "loadCastQueue";
}
| {
skipped: readonly SkippedCastItem[];
type: "notifySkipped";
}
| {
stopReceiver: boolean;
type: "endCastSession";
}
| {
itemIndex: number;
live: boolean;
playWhenReady: boolean;
position: number;
type: "restoreLocal";
}
| {
transfer: CastTransferEvent;
type: "emitTransfer";
}
| {
snapshot: CastReceiverSnapshot;
type: "emitReceiverState";
}
| {
error: CastError;
type: "emitError";
};

Defined in: packages/cast/src/handoff-machine.ts:242

What the reducer asks the orchestrator to do. Executed in array order.

Union Members

Type Literal

{
deviceId: string;
type: "connect";
}

Type Literal

{
type: "pauseLocal";
}

Type Literal

{
items: readonly CastQueueItemInput[];
startIndex: number;
startPosition: number;
type: "loadCastQueue";
}

Type Literal

{
skipped: readonly SkippedCastItem[];
type: "notifySkipped";
}

Type Literal

{
stopReceiver: boolean;
type: "endCastSession";
}

Type Literal

{
itemIndex: number;
live: boolean;
playWhenReady: boolean;
position: number;
type: "restoreLocal";
}

itemIndex

readonly itemIndex: number;

live

readonly live: boolean;

The restore target is a live stream: the orchestrator must NOT seek the local player to position. A receiver's live clock is a stream-timeline offset (device-observed: ~95 000 s on an HLS live master), meaningless to any other player — and mpv rejects seeks on unseekable live streams outright (Cannot seek in this stream). A live restore reopens the stream at the live edge; that IS the resume.

playWhenReady

readonly playWhenReady: boolean;

position

readonly position: number;

type

readonly type: "restoreLocal";

Type Literal

{
transfer: CastTransferEvent;
type: "emitTransfer";
}

Type Literal

{
snapshot: CastReceiverSnapshot;
type: "emitReceiverState";
}

Type Literal

{
error: CastError;
type: "emitError";
}