Skip to main content

Live Video (Cloudflare Stream)

5 min readDirectory Theme only

Live Video (Cloudflare Stream)

Video Theme. Let your members broadcast live from their web browser, and let anyone watch. Every broadcast is recorded automatically, 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 a busy stream never slows your website down.

How it works​

The five steps of a live broadcast: the member presses Go Live, their camera streams to Cloudflare, viewers watch on your site, the member presses End, and the replay stays on the page.

  1. A member presses Go Live. Their browser asks to use the camera and microphone.
  2. The video goes straight to Cloudflare. It never passes through your hosting.
  3. 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.
  4. The member presses End broadcast.
  5. The replay stays. Cloudflare has already recorded the broadcast, and the recording plays on the same page from then on.

Before you start​

  • Your site must use HTTPS (the address starts with https://). Browsers only allow the camera on secure sites. Most hosts switch this on for free.
  • A Cloudflare account with Stream. Stream is a paid Cloudflare service. Your website does not 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:

  1. Turn on Stream. Open Stream in the left menu and choose a plan.
  2. Account ID. On your account's home page, find Account ID in the right-hand column and copy it.
  3. API token (the key your site uses to talk to Cloudflare):
    1. Click the person icon at the top right, then My Profile ▸ API Tokens.
    2. Click Create Token, then Create Custom Token.
    3. Give it a name, for example "My website live video".
    4. Under Permissions, choose Account, Stream, Edit.
    5. Click Continue to summary, then Create Token.
    6. Copy the token now. Cloudflare only shows it once. Keep it private.
  4. Customer code. On the Stream page, your video addresses look like customer-abc123xyz.cloudflarestream.com. The code is the part between customer- 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, the names above (Account ID, API Tokens, Stream) are still the ones to look for.

Step 2: Connect your site​

  1. In your WordPress admin, go to Settings and open the Live streaming tab.
  2. Paste the Account ID, API token and Customer code into the three boxes.
  3. Check that Live streaming is switched on. It is on by default.
  4. Click Save.

The Go Live button appears for members once all three boxes are filled in and the switch is on.

Publish live streams instantly, without review is a second switch in the same tab, off by default. Leave it off and, if 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. Turn it on and members can go live straight away. It only affects live streams; uploaded videos still follow your normal review setting.

Going live (for your members)​

  1. In their channel area, the member clicks Go Live.
  2. They add a Title (and tags if they like), then click Go Live again.
  3. The browser asks for the camera and microphone. They click Allow.
  4. The page shows LIVE, and a Copy watch link button to share the stream.
  5. When they're done, they click End broadcast. The replay is saved automatically.

Nothing to install: a recent Chrome, Edge, Firefox or Safari and a webcam is all they need.

What viewers see​

WhenThe video's page shows
Before the broadcast starts"This stream is offline" with the cover image
While the member is liveThe 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, visitors must sign in before they can see a live stream.

The Live now page (/live/, in the side menu) lists every channel that is on air right now, newest first. Video cards across your site show a LIVE badge while a video is broadcasting.

Phones and tablets​

Watching works on iPhone, iPad and Android, inside the page.

Broadcasting works from the phone's normal browser (Safari on iPhone, Chrome on Android), with no app. A few things to tell 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, based on how many minutes of video you store and how many minutes people watch. There is no extra charge from the theme. See Cloudflare's Stream pricing page for current prices.

Common questions​

The Go Live button doesn't appear. Check 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://. Switch on HTTPS with your host.

"Camera and microphone access is needed." The member clicked Block. They can allow the camera from the padlock icon next to the address bar, then try again.

"Could not start the stream." Usually a mistyped Cloudflare detail, or an API token without Stream: Edit permission. Make a new token and paste it again.

The broadcast stopped on its own. The member's connection dropped, or they locked their phone. The 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.