Setting Up Cloudflare Stream
Connect Media Cloud to Cloudflare Stream to import videos for adaptive bitrate encoding and play them with the Media Cloud player.
Cloudflare Stream is a video encoding and delivery service. Media Cloud imports uploaded videos into Stream, tracks encoding with a webhook, and plays the HLS renditions with the Media Cloud player.
Cloudflare Stream support is labeled Beta in Media Cloud.
Before you start
You need:
- A Cloudflare account with Stream enabled.
- Your Cloudflare account ID.
- A Cloudflare API token with Account → Stream → Edit permission.
- Your Stream customer subdomain.
- A publicly reachable site, or a tunnel such as ngrok, so Cloudflare can call the webhook.
Step 1 – Find your account ID and customer subdomain
- Log in to the Cloudflare dashboard and open Stream.
- Copy the Account ID. It is also visible in the dashboard URL.
- Copy the Customer Subdomain. It looks like
customer-xxxxxxxx.cloudflarestream.com.
Include the scheme when entering the customer subdomain in Media Cloud, for example https://customer-xxxxxxxx.cloudflarestream.com.
Step 2 – Create an API token
- Open My Profile → API Tokens.
- Click Create Token and choose Create Custom Token.
- Set Permissions to Account → Stream → Edit.
- Set Account Resources to include your account.
- Create the token and copy it. Cloudflare only shows the token once.
Step 3 – Configure Media Cloud
- Go to Media Cloud → Settings → Video Encoding.
- Set Video Encoding Provider to Cloudflare Stream.
- Fill in the credentials:
| Field | Value |
|---|---|
| Account ID | Your Cloudflare account ID |
| API Key | The API token from step 2 |
| Customer Subdomain | https://customer-xxxxxxxx.cloudflarestream.com |
| Webhook Host | The public base URL Cloudflare should call |
- Save the settings.
The plugin builds the webhook URL as <Webhook Host>/__cloudflare-stream/webhook and registers it with Cloudflare automatically. Enter your site’s public URL, including the scheme. For local development, use your ngrok URL.
Step 4 – Upload a video
Upload a video through the WordPress media library. Media Cloud sends the video to Cloudflare through Stream’s copy API.
- If Cloud Storage is enabled, Media Cloud gives Cloudflare a short-lived pre-signed URL for the upload.
- If Cloud Storage is not enabled, the WordPress attachment URL must be publicly accessible.
Cloudflare downloads and encodes the video. When encoding finishes, Cloudflare calls the webhook, and Media Cloud stores the video ID and playback metadata and downloads the poster image.
Step 5 – Play the video
Insert the video with the Media Cloud video player block or shortcode. Stream videos play as HLS from your customer subdomain. See Player Settings and the Video Player Shortcode.
With the Pro version, Use Cloudflare’s Embedded Player replaces the Media Cloud player with Cloudflare’s iframe player.
WordPress integration settings
Under Video Encoding → WordPress Integration:
| Setting | Default | Description |
|---|---|---|
| Import Uploaded Videos | On | Imports new video uploads into Cloudflare Stream. |
| Delete Videos From Cloudflare Stream | Off | Deletes the Stream video when the attachment is deleted. |
Pro features
The Pro version adds:
- Secure Videos with signed HLS URLs and an expiration time.
- Allowed Origins to restrict which sites can embed the video.
- Signing key rotation with a configurable frequency.
- Exclude private videos from WP-REST.
- Watermark applied when a video is imported.
- Cloudflare’s embedded player.
Signed video URLs require the PHP OpenSSL extension. Media Cloud shows an admin notice if secure videos are enabled and OpenSSL is missing.
Limitations
- Cloudflare manages the encoding ladder, so the encoding settings panel is hidden for this provider.
- Security, watermark, and player options are Pro-only.
- The customer subdomain must include
https://orhttp://. - The webhook cannot reach a local development site without a tunnel.
- Cloudflare Stream support is beta; test playback in your theme before rolling it out.
Troubleshooting
| Problem | Likely cause |
|---|---|
| API calls return 403 | The API token does not have Account → Stream → Edit. |
| Video stays in a queued state | Cloudflare could not fetch the source URL, or the webhook never reached the site. |
| Webhook is never called | The Webhook Host is wrong or not publicly reachable; check the ngrok URL and firewall. |
| Secure videos do not play | OpenSSL is missing, or the signed URL expired. |
| Embedded player does not appear | Use Cloudflare’s Embedded Player is off, or the Video Player tool is disabled. |
| Thumbnail is missing | The webhook has not delivered the ready event yet; check the Media Cloud log. |
Need a hand with this guide?
Send support the exact step you’re stuck on and we’ll help you finish the setup.