A Cloudflare Workers demo, serving Big Buck Bunny (and maybe others soon).
https://bnuuy.stream/assets/big_buck_bunny/index.m3u8
https://bnuuy.stream/encrypted/big_buck_bunny/index.m3u8
The web
directory stores the website and video files. It's uploaded and served by Cloudflare Pages as-is.
A small Worker that dumps some logs from incoming request into Analytics Engine then forwards the request on.
Catches requests under the encrypted/
path and rewrites the HLS manifests to include an EXT-X-KEY
. Also catches requests for media chunks and
encrypts them on the fly with the same key. Keys are generated dynamically, based on the current date for simplicity.
Queries Analytics Engine and totals up view-counts for the different manifests.