dodocastDevelopersPlayer SDK
Player SDKfor your site and your server.
@dodocast/player puts the dodocast player on your pages, builds direct HLS links, reads what a 24/7 channel airs now and next, and signs links to private video on your backend. Zero dependencies, TypeScript types included, MIT license.
Four jobs, plain functions.
| Job | Functions | Works with |
|---|---|---|
| Links and embeds | watchUrl(), embedUrl(), embedHtml(), mount() — responsive or fixed size, start time, playlist item, private-link secret | videos, playlists, broadcasts, 24/7 channels |
| Direct HLS links | streamUrl() — fMP4/CMAF, MPEG-TS, byte-range for videos | videos, broadcasts, 24/7 channels; Pro and Business |
| Channel data | getChannelState() (now and next), getChannelGuide() (up to two weeks), progress() | published 24/7 channels |
| Signed links | signToken(), signedStreamUrl(), signedPlaylistItemUrl() from @dodocast/player/server — JWT, HS256, up to 24 h | your own content; Node.js 18+ |
The same embed as the console.
embedHtml() returns the markup of the console’s “Embed” button; mount() puts it into an element on your page.
- Responsive by default, with any aspect ratio —
aspect: [9, 16]for vertical video. - Start a video at a second with
start, open a playlist on an item withitem. - Where the player may appear is set per video in the console: everywhere, nowhere or up to 50 domains.
A “now playing” widget in a few lines.
Every published channel serves its state and its program guide as open JSON. The SDK reads both and gives you a progress value based on the server clock.
getChannelState(): on or off air, the current and next item, the current and next scheduled show.getChannelGuide(): the next 24 hours by default, any window up to two weeks withfromandto.- Poll the state every 10–30 seconds; there’s no push channel.
Direct HLS for hls.js, Safari and TVs.
streamUrl() builds the manifest URL. Public content plays from it directly; anything else answers 403 until you sign the link on your server.
- Videos: fMP4/CMAF, MPEG-TS and byte-range manifests. Broadcasts and channels: fMP4/CMAF and MPEG-TS.
- Encrypted content plays in standard HLS players: the key URI is in the manifest.
- Retention and completion are measured by the dodocast player; your own player’s views count as traffic.
Your backend decides who watches.
Create a key in the console under Settings → Signing keys. Your server issues a token for one video, playlist, broadcast or channel; the player does the rest.
- Header
{ alg: HS256, kid }, payload{ code, iat, exp }, lifetime up to 24 hours. - The secret is used as a string, exactly as the console shows it. Never send it to a browser.
- Python, PHP and Kotlin examples are in the signed links guide.
What the SDK doesn’t do.
So you can plan around it from the start.
- No playback API: you can’t call play, pause or seek on an embedded player or listen to its events. The iframe is the integration; start time and playlist item go in the URL.
- No upload or management API: upload and organize videos in the console.
- No DASH and no DRM. Encryption is HLS AES-128 or SAMPLE-AES.
- No live camera or encoder input: broadcasts and channels air uploaded videos.
Does it work without a build step?
Yes. It’s plain ES modules: import it from npm in your bundler, or from an ESM CDN in a script tag.
Which plan do I need?
Embeds and channel data work on every plan. Direct HLS links and signed links are on Pro and Business.
Where do the links point?
To watch.dodocast.com and stream.dodocast.com by default. During early access, pass the hosts you were given with the hosts option.
Is it open source?
Yes, MIT. Issues and pull requests are welcome on GitHub.
Your channel is one upload away.
We're opening dodocast to early partners: media, education, events, in-house TV. Tell us what you want to put on air.
or write to hello@dodocast.com