Function: getTokenLiveStreamUrl()
Gala Launchpad SDK 9.0.0-rc.5 / index / getTokenLiveStreamUrl
Function: getTokenLiveStreamUrl()
getTokenLiveStreamUrl(
tokenName,baseUrl):string
Defined in: packages/launchpad-sdk/dist/utils/assetUrls.d.ts:232
Get redirect URL for a token live stream (HLS)
HTTP Live Streaming (HLS) playlist for live token streams. Returns the master playlist (.m3u8) that references variant streams.
Backend: Redirects to Mux HLS master playlist when stream is active.
Parameters
tokenName
string
Token name (lowercase)
baseUrl
string
API base URL
Returns
string
Full redirect URL to HLS playlist
Throws
Error if token name is invalid or empty
Example
const liveUrl = getTokenLiveStreamUrl('anime', 'https://api.example.com');
// → "https://api.example.com/v1/tokens/anime/assets/live.m3u8"
// Use with HLS.js
import Hls from 'hls.js';
const video = document.querySelector('video');
if (video && Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(liveUrl);
hls.attachMedia(video);
}
Since
7.3.0