Function: canCastMedia()
function canCastMedia(item: CanCastInput): CanCastVerdict;
Defined in: packages/cast/src/can-cast.ts:120
Can this item be handed to a Cast receiver?
Decision order (most fundamental first):
- local-file — non-HTTP(S) sources can never cast; nothing else matters.
- headers — the receiver fetches without them, so the fetch would 401.
- codec — MIME type when supplied, else the URL extension, against the
receiver table. An extension we cannot classify (or no extension at all
— live streams, signed URLs) is reported castable: this heuristic only
denies what the table denies, and the
cast-receiver-fetcherror family catches the receiver's own verdict at load time.
Ceilings the URL cannot reveal (documented, not detected): FLAC above
96 kHz/24-bit; ALAC inside a .m4a (the extension says AAC).
Parameters
| Parameter | Type |
|---|---|
item | CanCastInput |