Skip to content
中文

Read the live HLS playlist of a stream

Code Mode: praxis.media.streams.retrievePlaylist

HTTP: GET /media/v1/streams/{stream_id}/live.m3u8

The live HLS playlist of the broadcast in progress: a sliding window of the newest six segments, each with EXT-X-PROGRAM-DATE-TIME (the wall clock of its first frame) and the address of its media, signed for ten minutes. Players read it again every few seconds. It carries no media itself and takes no API key: the token in the address (minted by streams.playbackToken) is the credential, and the answer is open to any browser origin. Use the address as given; do not build it by hand. The playlist ends with EXT-X-ENDLIST once the stream is idle or disabled. Example: GET /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/live.m3u8?token=Qm9v.

Signature

praxis.media.streams.retrievePlaylist(args:{path:{/** e.g. "mst_zpnqd7a2kxwg3vhr5tj4bfm6ec" */ stream_id:string};query:{/** e.g. "Qm9vdC1jYXAtdG9rZW4tZXhhbXBsZS0wMDAwMDAwMDAwMDA" */ token:string}}):Promise<string>;

Parameters

NameInTypeRequiredDescription
stream_idpathstringyesThe stream’s id, as in the address streams.playbackToken returned.
tokenquerystringyesThe playback token from the address streams.playbackToken returned; an hour of life.

Responses

StatusContent typesDescription
200application/vnd.apple.mpegurlThe playlist, application/vnd.apple.mpegurl.
401application/jsonThe token is missing, wrong or expired. Mint a new address.
404application/jsonNo such stream.
409application/jsonThe broadcast has no segments yet (the stream is waiting for its source); ask again in a few seconds.