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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| stream_id | path | string | yes | The stream’s id, as in the address streams.playbackToken returned. |
| token | query | string | yes | The playback token from the address streams.playbackToken returned; an hour of life. |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/vnd.apple.mpegurl | The playlist, application/vnd.apple.mpegurl. |
| 401 | application/json | The token is missing, wrong or expired. Mint a new address. |
| 404 | application/json | No such stream. |
| 409 | application/json | The broadcast has no segments yet (the stream is waiting for its source); ask again in a few seconds. |