Discourse Video Stream 🎥

Discourse Video Stream adds seamless Cloudflare Stream integration for uploading and embedding high-quality, long-form video content and live streaming in your Discourse site.

Overview

This plugin provides a complete workflow for handling large video files with adaptive bitrate streaming, allowing your users to upload videos directly from the composer and play them back with automatic quality adjustment based on their network conditions. It also supports creating live streams with RTMPS broadcasting.

Key Features

  • :clapper_board: Composer Integration: Optional toolbar button for direct video uploads from the composer
  • :outbox_tray: Automatic Upload Interception: Videos exceeding a configurable size threshold are automatically uploaded to Cloudflare Stream instead of local storage
  • :high_voltage: Resumable Uploads: Built on tus-js-client for reliable uploads of files well beyond 200 MB with automatic resume on connection issues
  • :locked: Secure Proxy: Server-side endpoint generates short-lived Cloudflare Stream upload URLs, keeping your API credentials safe
  • :satellite_antenna: Live Streaming: Create live streams with RTMPS broadcasting directly from the composer
  • :movie_camera: Custom BBCode: Simple [video-stream id="..."] syntax for embedding videos
  • :television: Adaptive Streaming: Shaka Player integration with DASH manifests for smooth playback across varying network speeds
  • :gear: Playback Controls: Built-in UI for resolution selection and playback speed control

Installation

Add the plugin to your app.yml:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/xfalcox/discourse-video-stream.git

Then rebuild your container:

./launcher rebuild app

Configuration

Navigate to Admin → Settings → Video streaming and configure:

Setting Description Default
video_stream_enabled Enable the video streaming plugin false
video_stream_account_id Your Cloudflare account identifier -
video_stream_api_token API token with Stream:Edit permissions -
video_stream_customer_subdomain Your Cloudflare Stream domain (e.g., customer-xxxxx.cloudflarestream.com) -
video_stream_allowed_extensions Comma-separated list of allowed video formats mp4,webm,mov
video_stream_max_file_size Maximum file size in MB (1-2000) 500
video_stream_intercept_native_uploads Automatically intercept large video uploads true
video_stream_intercept_threshold_mb Size threshold in MB for automatic interception (1-2000) 10
video_stream_enable_live_streams Enable live streaming feature false

Getting Cloudflare Stream Credentials

  1. Log into your Cloudflare dashboard
  2. Navigate to Stream under your account
  3. Copy your Account ID from the Stream overview
  4. Create an API token with Stream:Edit permissions
  5. Note your Customer subdomain from the Stream settings

Usage

Once configured, users have two ways to upload videos:

Automatic Interception

When a user drags and drops or selects a video file that exceeds the video_stream_intercept_threshold_mb setting, the plugin automatically handles it via Cloudflare Stream instead of local storage. You need to allow video file extensions on the allowed extension settings for this to work.

Manual Upload

Users can click the composer toolbar’s pop-up menu (:plus:) and select the video upload option to explicitly upload to Cloudflare Stream.

Both methods insert a [video-stream id=“video_id”] BBCode tag that renders as an adaptive streaming player with resolution and speed controls.

Live Streaming

When video_stream_enable_live_streams is enabled, users can create live streams:

  1. Click the composer toolbar’s pop-up menu (:plus:) and select “Create live stream”
  2. A modal generates RTMPS credentials via Cloudflare Stream API
  3. Copy the RTMPS URL and stream key using the convenient copy buttons
  4. Use the credentials with OBS, Streamlabs, or any RTMPS-compatible broadcasting software
  5. Click “Insert embed” to add the [video-stream id=“…”] BBCode to your post
  6. Start broadcasting immediately

Live Stream Features:

  • Automatic recording enabled by default (streams are saved for later playback)
  • Same adaptive player works for both live and recorded content
  • Users see live content while streaming, then can watch the recording afterward
  • Secure credential handling with warning messages

Why Cloudflare Stream?

We have support for doing the same using AWS in code, and with Mux in GitHub - discourse/discourse-video, so a cheaper alternative sounded like a good idea.

Requirements

  • Active Cloudflare account with Stream enabled

Source & Support

Screenshots

Demo

Visit my test site and upload some videos

https://discourse-on-a-pi5.falco.dev/t/test-video-upload-plugin/20?u=falco


Note: This is not an official plugin.

15 likes

Update: Live Streaming Support Now Available! :satellite_antenna:

The plugin now supports live streaming with RTMPS broadcasting!

What’s new:

  • Create live streams directly from the composer toolbar menu
  • Get RTMPS credentials instantly via Cloudflare Stream API
  • Stream with OBS, Streamlabs, or any RTMPS-compatible software
  • Automatic recording enabled - streams are saved for playback after broadcasting ends
  • Same [video-stream id="..."] BBCode and adaptive player for both live and recorded content

How to enable:
Set video_stream_enable_live_streams to true in Admin → Settings → Video streaming

See the updated OP for full details on the live streaming workflow.

6 likes