Jump to content

Recommended Posts

Posted

Hi everyone,

I’m releasing Lumen, a ProcessWire module for managing Cloudflare Stream video from the page editor and the ProcessWire admin.

Lumen adds a dedicated video Fieldtype and Inputfield, handles direct and resumable uploads, follows Cloudflare processing status, and exposes playback, thumbnails and metadata through familiar ProcessWire APIs.

Lumen

What Lumen does

  • Adds a Cloudflare Stream Files Fieldtype and Inputfield.
  • Supports direct uploads and resumable TUS uploads.
  • Stores Stream status, duration, dimensions, category, tags, poster, subtitles, trim points, linked page and view count.
  • Provides HLS URLs, responsive iframe embeds, thumbnails, posters and previews.
  • Supports public playback and private playback with signed Stream tokens.
  • Detects portrait, landscape, square and unknown video orientation.
  • Identifies ready portrait videos that fit a configurable short-form duration.
  • Refreshes pending Stream metadata through bounded LazyCron jobs.
  • Includes local-storage mode for development without a Cloudflare account.
  • Protects expiring signed playback URLs when CloudCache is installed.
  • Provides public upload and metadata APIs for integrations with other modules.
  • Embeds videos in formatted text through [[lumen:...]] shortcodes.

Admin workspace

Lumen adds Setup → Lumen, where editors can upload videos, browse and filter the library, refresh processing status, inspect metadata, copy embeds and Stream URLs, estimate stored and delivered minutes, configure playback and review diagnostics.

The field itself can be added to any required template, so video remains part of the normal ProcessWire content model rather than a separate media system.

Pagefile API

<?php namespace ProcessWire;

if($modules->isInstalled('Lumen')) {
    $lumen = $modules->get('Lumen');

    echo $video->streamEmbedResponsive();

    $thumbnail = $video->streamThumbnail(12);
    $poster = $video->streamPoster();
    $ready = $video->streamReady();
    $orientation = $lumen->streamOrientation($video);
}

Trusted integrations can also attach uploaded or local files:

$video = $lumen->attachUploadedVideo(
    $page,
    'video',
    $_FILES['video'],
    1024 * 1024 * 1024
);

$video = $lumen->attachLocalVideo($page, 'video', $sourcePath);

Textformatter

The included Textformatter supports:

  • [[lumen:video_uid]]
  • [[lumen:page_id.field_name]]
  • [[lumen:page_id.field_name:thumb]]

Requirements

  • ProcessWire 3.0.255 or newer
  • PHP cURL
  • A Cloudflare account with Stream enabled, unless local-storage mode is used for development

Installation

  1. Copy the Lumen directory to /site/modules/Lumen/.
  2. Refresh modules in the ProcessWire admin and install Lumen.
  3. Enable Cloudflare Stream for the account.
  4. Create an API token with Stream:Edit permission.
  5. Save the Account ID and token in Modules → Configure → Lumen.
  6. Open Setup → Lumen and refresh the connection status.
  7. Create a Cloudflare Stream Files field and add it to the required templates.

Links

Feedback about field behavior, upload workflows, signed playback and the admin experience is very welcome.

  • maximus changed the title to Lumen: Cloudflare Stream video hosting

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...