Skip to content

Video

StratoLMS plays YouTube, Vimeo, Cloudflare Stream, Mux, Bunny Stream, local files, and Cloudflare R2 objects. Access control is not the same for every provider.

  • Access-controlled: Cloudflare Stream, Mux and Bunny when signed: true and video.signing is on; R2 objects served from /api/video/file/... after hasAccess. The lesson HTML never contains the provider URL. The player asks /api/video/play/... (or the R2 route) after the learner is signed in.
  • Not access-controlled: an unlisted YouTube or Vimeo URL plays for anyone who has it, forever. stratolms check warns when those providers appear on a paid, non-preview lesson.

Signed playback never falls back to an unsigned URL. Missing credentials return 503 {"ok":false,"error":"video-signing-unconfigured"}.

Turn on video.signing in stratolms.config.mjs for Stream, Mux or Bunny tokens. Turn on video.r2Files for R2, on the Cloudflare adapter only.

Provider Secrets Player
Mux MUX_SIGNING_KEY_ID, MUX_SIGNING_KEY (secret; base64 PEM) player.mux.com/{id}?playback-token=
Cloudflare Stream STREAM_SIGNING_KEY_ID, STREAM_SIGNING_KEY, and video.cloudflareStream.customerCode for https://customer-<code>.cloudflarestream.com/<token>/iframe Token replaces the video UID. iframe.videodelivery.net/<token> is not a signed form.
Bunny Stream BUNNY_TOKEN_KEY iframe.mediadelivery.net/embed/{library}/{id}?token=&expires=
R2 STRATO_MEDIA binding /api/video/file/{lesson}/ with byte ranges

YouTube and Vimeo stay as they are: privacy-mode embeds, no tokens.

stratolms video upload <file> [--lesson <path>] [--name <title>]

Reads CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_STREAM_TOKEN from the environment or .dev.vars (local credentials, never deployed). Files up to 200 MB use a basic Stream direct upload; larger files use tus. With --lesson, only the video frontmatter mapping is rewritten to { provider: 'cloudflare-stream', id, signed: true }.