Live Video (Cloudflare Stream)
Live Video (Cloudflare Stream)
Video Theme. Your members can broadcast live from their web browser, and anyone can watch. Every broadcast is recorded for you, so people who missed it can watch the replay on the same page.
Your site uses Cloudflare Stream for this. Cloudflare is a large internet company with servers all over the world. It carries the video, so even a busy stream never slows your website down.
How it works
- A member presses Go Live. Their browser asks if it can use the camera and microphone.
- The video goes straight to Cloudflare. It never passes through your hosting.
- Viewers watch on your site. The video's page shows the stream with a LIVE badge, and the channel appears on your Live now page.
- The member presses End broadcast.
- The replay stays. Cloudflare has already recorded the broadcast, and from then on the recording plays on the same page.
Before you start
- Your site needs to use HTTPS (the address starts with
https://). Browsers only allow the camera on secure sites. Most hosts will switch this on for free. - You'll need a Cloudflare account with Stream. Stream is a paid Cloudflare service. Your website doesn't have to use Cloudflare for anything else.
Step 1: Get your three Cloudflare details
Your site needs three things from Cloudflare. Sign in at dash.cloudflare.com (or create a free account), then:
- Turn on Stream. Open Stream in the left menu and choose a plan.
- Account ID. On your account's home page, find Account ID in the right-hand column and copy it.
- API token (the key your site uses to talk to Cloudflare):
- Click the person icon at the top right, then My Profile → API Tokens.
- Click Create Token, then Create Custom Token.
- Give it a name, for example "My website live video".
- Under Permissions, choose Account, Stream, Edit.
- Click Continue to summary, then Create Token.
- Copy the token straight away. Cloudflare only shows it once. Please keep it private.
- Customer code. On the Stream page, your video addresses look like
customer-abc123xyz.cloudflarestream.com. The code is the part betweencustomer-and.cloudflarestream.com(here,abc123xyz). If you can't see an address yet, upload any short test video to Stream and open it.
Cloudflare changes its dashboard from time to time. If a button has moved, don't worry. The names above (Account ID, API Tokens, Stream) are still the ones to look for.
Step 2: Connect your site
- In the admin sidebar, go to Settings → Live streaming (in the Members & messaging band).
- Under Cloudflare Stream credentials, paste the Cloudflare Account ID, API token (Stream: Edit) and Customer subdomain code into the three boxes.
- Check that Live streaming is switched on. It's on to begin with.
- Click Save changes.
Your members will see the Go Live button once all three boxes are filled in and the switch is on.
There's a second switch on the same screen, Publish live streams instantly, without review, and it starts off. If you leave it off and you review new videos before they go public, a new live stream waits for your approval too. The member sees "waiting for approval", and can go live once you approve it. If you turn it on, members can go live straight away. It only affects live streams. Uploaded videos still follow your normal review setting.
Going live (for your members)
- In their channel area, the member clicks Go Live.
- They add a Title (and tags if they like), then click Go Live again.
- The browser asks to use the camera and microphone. They click Allow.
- The page shows LIVE, along with a Copy watch link button so they can share the stream.
- When they've finished, they click End broadcast. The replay is saved for them.
There's nothing to install. All they need is a recent Chrome, Edge, Firefox or Safari, and a webcam.
What viewers see
| When | The video's page shows |
|---|---|
| Before the broadcast starts | "This stream is offline" with the cover image |
| While the member is live | The live video and a LIVE badge |
| After it ends | "The live stream has ended" and Watch the replay |
The page checks for changes every few seconds, so viewers don't need to refresh. If you use Sign in to watch (under Videos → Setup & Expiry), visitors need to sign in before they can see a live stream.
The Live now page (/live/, in the side menu) lists every channel that's on
air right now, newest first. While a video is broadcasting, its cards across your
site show a LIVE badge.
Phones and tablets
Watching works on iPhone, iPad and Android, right inside the page.
Broadcasting works from the phone's normal browser (Safari on iPhone, Chrome on Android), so there's no app to download. Here are a few things worth telling your members:
- The phone uses its front (selfie) camera.
- Keep the screen on and the page open. Locking the phone or switching apps pauses the camera, and the broadcast ends.
- A strong Wi-Fi or mobile signal gives viewers a smoother picture.
Costs
Cloudflare bills you directly. The cost depends on how many minutes of video you keep with them and how many minutes people watch. We don't charge anything extra for this. You'll find current prices on Cloudflare's Stream pricing page.
Common questions
The Go Live button doesn't appear. Check that all three Cloudflare boxes are filled in and the Live streaming switch is on (Step 2).
"A secure connection is required." Your site is on http://. Ask your host to
switch on HTTPS for you.
"Camera and microphone access is needed." The member clicked Block. That's easy to fix. They can allow the camera from the padlock icon next to the address bar, then try again.
"Could not start the stream." This is usually a mistyped Cloudflare detail, or an API token without Stream: Edit permission. Make a new token and paste it in again.
The broadcast stopped on its own. The member's connection dropped, or they locked their phone. Your site notices within seconds and shows the video as ended. They can press Go Live again on the same video. The new broadcast's recording then replaces the earlier replay on that page.
Is my Cloudflare token safe? Yes. It stays on your server and is never sent to anyone's browser. Only the member who owns a video can start or end its broadcast.