Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ansdevcloud.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Player SDK

The Ansdev Player SDK is two flavours of the same engine:
Web ComponentReact
Packagehttps://streem.ansdev.cloud/sdk/v1/player.js@ansdev/player-sdk/react
Markup<ansdev-player><AnsdevPlayer />
Bundle~204 KB gzipped (incl. hls.js)Same, React external
IsolationShadow DOMScoped CSS
Both:
  • Authenticate with your ak_live_… API key (in memory only — never localStorage).
  • Mint and auto-refresh playback tokens (30 s before expiry).
  • Stream HLS via hls.js (native HLS on Safari).
  • Support AES-128 encrypted videos (key delivery via /v1/video/playback/key/).
  • Theme with a single JSON object.

What the SDK does for you

your apiKey + videoId


  ┌──────────────────────────┐
  │  POST /v1/video/:id/      │  ← AnsdevApi (in SDK)
  │     playback-token        │
  └──────────────┬───────────┘
                 │  { token, expiresIn: 300 }

  ┌──────────────────────────┐
  │  GET /v1/video/playback/  │
  │       manifest/:token     │
  └──────────────┬───────────┘
                 │  { masterPlaylistUrl }

        hls.js → <video>
Every 4 min 30 s, the TokenManager quietly fetches a fresh token in the background so playback never stalls on an expired credential.

Bundle composition

Size (raw)Size (gz)
SDK code + UI + CSS~30 KB~10 KB
hls.js~750 KB~194 KB
Total781 KB204 KB
hls.js dominates the weight. We keep it inlined so consumers only need a single <script> tag — splitting it out would save 200 KB of bundle but add an extra HTTP request and a build-time concern for every customer.

Next

Embed Guide

Drop-in HTML and React snippets.

Customization

Theme colors, toggle controls, brand the player.

Events

React callbacks + DOM CustomEvents.