Cloudflare Stream Demo
Feature Demo

Cloudflare Stream
in action

Live demo of Stream's embed, captions, downloads, signed URLs, and JSON metadata — using your uploaded video.

Video: YOUR_VIDEO_UID  ·  3840×2160 · 60fps · 4K
⚙️
Before demoing: Replace YOUR_VIDEO_UID and YOUR_ACCOUNT_SUBDOMAIN in this page with your actual values from the Stream dashboard.
Find them at: dash.cloudflare.com → Stream → your video → Embed tab. The embed URL looks like https://customer-<CODE>.cloudflarestream.com/<VIDEO_UID>/iframe.
Player will appear here
Replace the VIDEO_UID and ACCOUNT_SUBDOMAIN
to load your Stream video

UID from Stream dashboard · Subdomain from embed URL (e.g. customer-abc123)

📺
Embed
iframe

Stream provides a ready-to-use iframe embed. You can customise autoplay, loop, mute, controls, start time, and brand colour directly in the iframe URL.

<!-- Basic embed --> <iframe src="https://customer-SUBDOMAIN .cloudflarestream.com/VIDEO_UID/iframe ?autoplay=true&muted=true &primaryColor=%23F48120" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen ></iframe>
💬
Captions
AI-generated

Cloudflare can auto-generate captions via AI for any language, or you can upload a WebVTT/SRT file. Once added, enable them in the player with defaultTextTrack.

# Generate AI captions (POST) curl -X POST \ "https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/stream/VIDEO_UID/captions/en" \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"generate": true}'
<!-- Enable captions in player --> src="...iframe?defaultTextTrack=en"
→ GET /captions would return available language tracks
⬇️
Downloads
API

Enable MP4 download links for a video. Two types: default (full video MP4) and audio (audio-only). Downloads must be explicitly created — they are not on by default.

# Enable MP4 download for a video curl -X POST \ "https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/stream/VIDEO_UID/downloads" \ -H "Authorization: Bearer TOKEN" # Returns download URL: # https://customer-SUBDOMAIN # .cloudflarestream.com/VIDEO_UID # /downloads/default.mp4
🔐
Signed URLs
API

Restrict video access by requiring signed JWT tokens. Enable "Require Signed URLs" on the video, then generate short-lived tokens server-side. Use in the embed src instead of the plain video UID.

# Step 1 — Enable on the video curl -X POST \ ".../stream/VIDEO_UID" \ -d '{"requireSignedURLs": true}' # Step 2 — Create signing key curl -X POST \ ".../stream/keys" # Step 3 — Issue a token (Worker/backend) # Sign a JWT with the key (exp: +1h) # Use token as VIDEO_UID in embed src
{ }
JSON & Public Details
Metadata

Every Stream video exposes a public JSON endpoint and a public details page. Useful for structured data, VideoObject schema, and programmatic video metadata access.

# Public video details (no auth) https://customer-SUBDOMAIN .cloudflarestream.com/VIDEO_UID/videodeliveryapi/report # Authenticated video metadata curl "https://api.cloudflare.com/client/v4 /accounts/ACCOUNT_ID/stream/VIDEO_UID" \ -H "Authorization: Bearer TOKEN"
"uid": "VIDEO_UID", "thumbnail": "https://...thumbnail.jpg", "readyToStream": true, "status": { "state": "ready" }, "meta": { "name": "13737026_3840_2160_60fps.mp4" }, "duration": -1, "input": { "width": 3840, "height": 2160 }, "playback": { "hls": "https://...manifest/video.m3u8", "dash": "https://...manifest/video.mpd" }, "requireSignedURLs": false
🚀 Deploy this page to stream.smthingy.com

Two options — Pages (recommended) or a Worker. Both give you a clean subdomain on your account.

A

Cloudflare Pages (easiest): Put this HTML file in a repo or upload directly. Go to Workers & Pages → Create → Pages → Upload asset. Deploy, then add Custom domain → stream.smthingy.com. Cloudflare auto-provisions the DNS + TLS.

B

Worker with HTML response: Create a Worker that returns this page as an HTML response. Attach it to a Custom Domain: stream.smthingy.com. Good if you want server-side token signing in the same Worker.

1

Set VIDEO_UID: Replace YOUR_VIDEO_UID in the page with your actual Stream video UID from the dashboard JSON tab.

2

Set ACCOUNT_SUBDOMAIN: From your embed URL — e.g. customer-abc123def.cloudflarestream.com → subdomain is customer-abc123def.

3

For Signed URL demo: Add a Worker binding or a backend endpoint that issues JWT tokens. Store signing keys as Worker Secrets (wrangler secret put STREAM_SIGNING_KEY).