Playback & embedding
Three ways to show the stream
| Way | Use it when | What you do |
|---|---|---|
Viewer link player_url |
You just want to send people a link | Share it (chat, email, LMS) |
Embed embed_html |
The stream should appear inside your own website or app | Paste the <iframe> into your page |
HLS hls_url |
You have your own player (video.js, Shaka, ExoPlayer, AVPlayer, VLC) | Load master.m3u8 |
The viewer page and the embed offer: a sound menu (each dubbed language and "Original"), subtitles (translated / English / off), and the subtitle text size. They work in current Chrome, Edge, Firefox and Safari (also iPhone/iPad), with hls.js or Safari's built-in HLS.
What is inside the HLS stream
master.m3u8
├── video.m3u8 H.264, your resolution (2-second segments)
├── audio_hi.m3u8 AAC, Hindi dub (one per language; the first language is the default)
├── audio_ta.m3u8 AAC, Tamil dub
├── audio_orig.m3u8 AAC, original sound (if original_audio = true)
├── subs_hi.m3u8 WebVTT, Hindi (one per language)
└── subs_en.m3u8 WebVTT, English (if subtitles = source or both)
lang_hi.m3u8, lang_ta.m3u8 single-language masters (for players or targets that take only one audio track)
All tracks carry the same timestamps, so any standards-following player keeps them together. Subtitle segments use
X-TIMESTAMP-MAP as the HLS specification requires.
Latency: viewers are about delay_s + 6 s behind the live speaker (12 s delay → about 18 s). The delay is what lets the
translated voice start exactly with the speaker's sentence.
Public or signed playback
"playback": "public"(default): anyone with the link can watch. Good for open events."playback": "signed": every viewer link needs a token. Create one per viewer or per session:
curl -X POST https://api.example.com/v1/streams/str_.../playback-tokens \
-H "Authorization: Bearer $FDS_KEY" -H "Content-Type: application/json" -d '{"ttl_s": 7200, "viewer": "viewer-1042"}'
You get player_url, embed_html and hls_url that work until expires_at. A typical setup: your website checks that the
viewer is logged in, asks our API for a token (server to server, your key never reaches the browser) and puts the returned
embed_html into the page.
Embedding only on your own websites
Ask us to set your account's allowed origins (e.g. https://school.example.com). Browsers then refuse to load the stream's
files on other websites (CORS). Combine with signed playback for real protection; CORS alone does not stop non-browser downloads.
Re-streaming to YouTube, Facebook or your CDN
Add up to three targets when you create the stream; each gets one dubbed language (picture + that voice):
"restream": [{"language": "hi", "rtmp_url": "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx"}]
The target URL (it contains that platform's stream key) is stored encrypted and shown masked. Subtitles are not part of RTMP;
upload the SRT from /captions afterwards if the platform supports it.
Large audiences
The output is plain HTTP files, so it can sit behind any CDN (Cloudflare, Bunny, CloudFront, Akamai): playlists are sent with
Cache-Control: no-cache, max-age=1, segments with max-age=86400, immutable. Set FDS_PLAYBACK_BASE_URL to the CDN address
so the API hands out CDN links. See Self-hosting.