Uploading lecture videos (Cloudflare Stream)
Videos are too large for the static site/git, so they live on Cloudflare Stream
(transcoding, adaptive HLS, a global player). The site already shows a Stream player
on a session once you give it that video’s ID. lectures_enabled is already true.
One-time setup
- Create a Cloudflare account → Stream → start the free trial / plan.
- (Optional, recommended) In
_config.ymlsetstream_customer_codeto your Stream customer code (thecustomer-XXXXpart of your Stream dashboard URLs). Leave blank to use the legacyvideodelivery.netembed.
Per video
- Upload the recording in the Stream dashboard (drag-and-drop the
.mp4), or via the API/wrangler. Large uploads run from your machine — that part is yours. - Copy the video’s UID (e.g.
a1b2c3d4e5f6...). - Add it to that session’s note front-matter:
--- title: "The Keynesian Cross" session: 2 stream_id: a1b2c3d4e5f6... --- - Commit + push. That session’s player now streams the video; sessions without a
stream_idkeep the tasteful “coming soon” state.
Notes
- The player is download-deterred (no direct file, right-click/Save blocked, watermark). For true DRM + signed/expiring playback, enable Stream signed URLs later (needs a tiny token-minting function) — see ARCHITECTURE.md.
- Mapping all sessions at once? You can instead keep a
_data/lectures.ymlofsession → stream_idand wire the hub to it — ask me and I’ll set that up.