Skip to content
Media CloudDocs
Happy HolidaysSave 20% with codeValid through December 31Shop the sale
Setting Up Cloudflare Stream
On this page

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.

4 min read·4 tags

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

  1. Log in to the Cloudflare dashboard and open Stream.
  2. Copy the Account ID. It is also visible in the dashboard URL.
  3. 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

  1. Open My Profile → API Tokens.
  2. Click Create Token and choose Create Custom Token.
  3. Set Permissions to Account → Stream → Edit.
  4. Set Account Resources to include your account.
  5. Create the token and copy it. Cloudflare only shows the token once.

Step 3 – Configure Media Cloud

  1. Go to Media Cloud → Settings → Video Encoding.
  2. Set Video Encoding Provider to Cloudflare Stream.
  3. Fill in the credentials:
FieldValue
Account IDYour Cloudflare account ID
API KeyThe API token from step 2
Customer Subdomainhttps://customer-xxxxxxxx.cloudflarestream.com
Webhook HostThe public base URL Cloudflare should call
  1. 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:

SettingDefaultDescription
Import Uploaded VideosOnImports new video uploads into Cloudflare Stream.
Delete Videos From Cloudflare StreamOffDeletes 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:// or http://.
  • 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

ProblemLikely cause
API calls return 403The API token does not have Account → Stream → Edit.
Video stays in a queued stateCloudflare could not fetch the source URL, or the webhook never reached the site.
Webhook is never calledThe Webhook Host is wrong or not publicly reachable; check the ngrok URL and firewall.
Secure videos do not playOpenSSL is missing, or the signed URL expired.
Embedded player does not appearUse Cloudflare’s Embedded Player is off, or the Video Player tool is disabled.
Thumbnail is missingThe 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.

Contact support
Start typing to search the docs

Escto close·⌘Kto open

View all results →