Adds video streaming to Payload upload collections by sending uploaded videos to a streaming provider, currently Cloudflare Stream, through an adapter. It stores stream metadata in a field on each document and injects a background job that polls the provider until the video is ready. It works alongside S3 storage and can use signed URLs. Requires Payload 3.78 or newer.
Payload CMS plugin for streaming video uploads to cloud providers like Cloudflare Stream
Installation
npm i payload-video-stream8
Stars
0
Forks
0
Open Issues
8 months ago
Last Updated
65
Weekly Downloads
v1.3.1
npm Version
113.3 KB
Unpacked Size
0
Dependencies
80 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 8 |
| Dec 4, 2026 | 8 |
| Dec 3, 2026 | 8 |
| Dec 2, 2026 | 8 |
| Dec 1, 2026 | 8 |
| Nov 30, 2026 | 8 |
| Nov 29, 2026 | 8 |
| Nov 28, 2026 | 8 |
| Nov 27, 2026 | 8 |
| Nov 26, 2026 | 8 |
| Nov 25, 2026 | 8 |
| Nov 24, 2026 | 8 |
| Nov 23, 2026 | 8 |
| Nov 22, 2026 | 8 |
| Nov 21, 2026 | 8 |
| Nov 20, 2026 | 8 |
| Nov 19, 2026 | 8 |
| Nov 18, 2026 | 8 |
| Nov 17, 2026 | 8 |
| Nov 16, 2026 | 8 |
| Nov 15, 2026 | 8 |
| Nov 14, 2026 | 8 |
| Nov 13, 2026 | 8 |
| Nov 12, 2026 | 8 |
| Nov 11, 2026 | 8 |
| Nov 10, 2026 | 8 |
| Nov 9, 2026 | 8 |
| Nov 8, 2026 | 8 |
| Nov 7, 2026 | 8 |
| Nov 6, 2026 | 8 |
| Nov 5, 2026 | 8 |
| Nov 4, 2026 | 8 |
| Nov 3, 2026 | 8 |
| Nov 2, 2026 | 8 |
| Nov 1, 2026 | 8 |
| Oct 31, 2026 | 8 |
| Oct 30, 2026 | 8 |
| Oct 29, 2026 | 8 |
| Oct 28, 2026 | 8 |
| Oct 27, 2026 | 8 |
| Oct 26, 2026 | 8 |
| Oct 25, 2026 | 8 |
| Oct 24, 2026 | 8 |
| Oct 23, 2026 | 8 |
| Oct 22, 2026 | 8 |
| Oct 21, 2026 | 8 |
| Oct 20, 2026 | 8 |
| Oct 19, 2026 | 8 |
| Oct 18, 2026 | 8 |
| Oct 17, 2026 | 8 |
| Oct 16, 2026 | 8 |
| Oct 15, 2026 | 8 |
| Oct 14, 2026 | 8 |
| Oct 13, 2026 | 8 |
| Oct 12, 2026 | 8 |
| Oct 11, 2026 | 8 |
| Oct 10, 2026 | 8 |
| Oct 9, 2026 | 8 |
| Oct 8, 2026 | 8 |
| Oct 7, 2026 | 8 |
| Oct 6, 2026 | 8 |
| Oct 5, 2026 | 8 |
| Oct 4, 2026 | 8 |
| Oct 3, 2026 | 8 |
| Oct 2, 2026 | 8 |
| Oct 1, 2026 | 8 |
| Sep 30, 2026 | 8 |
| Sep 29, 2026 | 8 |
| Sep 28, 2026 | 8 |
| Sep 27, 2026 | 8 |
| Sep 26, 2026 | 8 |
| Sep 25, 2026 | 8 |
| Sep 24, 2026 | 8 |
| Sep 23, 2026 | 8 |
| Sep 22, 2026 | 8 |
| Sep 21, 2026 | 8 |
| Sep 20, 2026 | 8 |
| Sep 19, 2026 | 8 |
| Sep 18, 2026 | 8 |
| Sep 17, 2026 | 8 |
| Sep 16, 2026 | 8 |
| Sep 15, 2026 | 8 |
| Sep 14, 2026 | 8 |
| Sep 13, 2026 | 8 |
| Sep 12, 2026 | 8 |
| Sep 11, 2026 | 8 |
| Sep 10, 2026 | 8 |
| Sep 9, 2026 | 8 |
| Sep 8, 2026 | 8 |
| Sep 7, 2026 | 8 |
| Sep 6, 2026 | 8 |
16−21 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 16 |
| Dec 4, 2026 | 18 |
| Dec 3, 2026 | 14 |
| Dec 2, 2026 | 9 |
| Dec 1, 2026 | 25 |
| Nov 30, 2026 | 28 |
| Nov 29, 2026 | 28 |
| Nov 28, 2026 | 29 |
| Nov 27, 2026 | 27 |
| Nov 26, 2026 | 29 |
| Nov 25, 2026 | 33 |
| Nov 24, 2026 | 18 |
| Nov 23, 2026 | 16 |
| Nov 22, 2026 | 20 |
| Nov 21, 2026 | 25 |
| Nov 20, 2026 | 36 |
| Nov 19, 2026 | 42 |
| Nov 18, 2026 | 67 |
| Nov 17, 2026 | 65 |
| Nov 16, 2026 | 68 |
| Nov 15, 2026 | 63 |
| Nov 14, 2026 | 57 |
| Nov 13, 2026 | 50 |
| Nov 12, 2026 | 57 |
| Nov 11, 2026 | 29 |
| Nov 10, 2026 | 30 |
| Nov 9, 2026 | 34 |
| Nov 8, 2026 | 36 |
| Nov 7, 2026 | 53 |
| Nov 6, 2026 | 50 |
| Nov 5, 2026 | 36 |
| Nov 4, 2026 | 35 |
| Nov 3, 2026 | 36 |
| Nov 2, 2026 | 32 |
| Nov 1, 2026 | 55 |
| Oct 31, 2026 | 44 |
| Oct 30, 2026 | 44 |
| Oct 29, 2026 | 43 |
| Oct 28, 2026 | 43 |
| Oct 27, 2026 | 40 |
| Oct 26, 2026 | 41 |
| Oct 25, 2026 | 15 |
| Oct 24, 2026 | 10 |
| Oct 23, 2026 | 8 |
| Oct 22, 2026 | 9 |
| Oct 21, 2026 | 26 |
| Oct 20, 2026 | 25 |
| Oct 19, 2026 | 20 |
| Oct 18, 2026 | 20 |
| Oct 17, 2026 | 21 |
| Oct 16, 2026 | 21 |
| Oct 15, 2026 | 21 |
| Oct 14, 2026 | 5 |
| Oct 13, 2026 | 6 |
| Oct 12, 2026 | 6 |
| Oct 11, 2026 | 8 |
| Oct 10, 2026 | 8 |
| Oct 9, 2026 | 13 |
| Oct 8, 2026 | 13 |
| Oct 7, 2026 | 14 |
| Oct 6, 2026 | 18 |
| Oct 5, 2026 | 24 |
| Oct 4, 2026 | 27 |
| Oct 3, 2026 | 30 |
| Oct 2, 2026 | 30 |
| Oct 1, 2026 | 45 |
| Sep 30, 2026 | 50 |
| Sep 29, 2026 | 66 |
| Sep 28, 2026 | 64 |
| Sep 27, 2026 | 69 |
| Sep 26, 2026 | 80 |
| Sep 25, 2026 | 83 |
| Sep 24, 2026 | 74 |
| Sep 23, 2026 | 70 |
| Sep 22, 2026 | 68 |
| Sep 21, 2026 | 72 |
| Sep 20, 2026 | 65 |
| Sep 19, 2026 | 79 |
| Sep 18, 2026 | 72 |
| Sep 17, 2026 | 74 |
| Sep 16, 2026 | 88 |
| Sep 15, 2026 | 96 |
| Sep 14, 2026 | 120 |
| Sep 13, 2026 | 122 |
| Sep 12, 2026 | 96 |
| Sep 11, 2026 | 108 |
| Sep 10, 2026 | 105 |
| Sep 9, 2026 | 92 |
| Sep 8, 2026 | 66 |
| Sep 7, 2026 | 41 |
| Sep 6, 2026 | 37 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1097556548-root)<a href="https://payloaddirectory.dev/plugins/1097556548-root"><img src="https://payloaddirectory.dev/badge/1097556548-root.svg" alt="Payload Directory"></a>README
A Payload CMS plugin that enables seamless video uploads directly to streaming providers from Payload upload collections. This plugin automatically handles video file uploads to streaming platforms, providing optimized video delivery for your Payload CMS applications.
Currently supported:
Planned support:
npm install payload-video-stream
# or
yarn add payload-video-stream
# or
pnpm add payload-video-stream
Add the plugin to your payload.config.ts:
import { buildConfig } from 'payload/config'
import { videoStream } from 'payload-video-stream'
import { cloudflareStreamAdapter } from 'payload-video-stream/adapters'
export default buildConfig({
plugins: [
// configure your s3 storage configuration
s3Storage({
bucket: process.env.S3_BUCKET ?? 'romonoa',
clientUploads: true, // enable client-side uploads
collections: {
video: true,
},
config: {
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID ?? '',
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY ?? '',
},
endpoint: process.env.S3_ENDPOINT,
region: process.env.S3_REGION,
// ... Other S3 configuration
},
signedDownloads: {
// expires in 24 hours
expiresIn: 60 * 60 * 24,
}, // enable signed download URLs
}),
// configure video stream plugin
videoStream({
collections: {
media: true,
},
// configure default adapter, currently only support cloudflare stream adapter
defaultAdapter: cloudflareStreamAdapter({
accountId: process.env.CLOUDFLARE_STREAM_ACCOUNT_ID || '',
apiToken: process.env.CLOUDFLARE_STREAM_API_TOKEN || '',
customerSubdomain: process.env.NEXT_PUBLIC_CLOUDFLARE_STREAM_CUSTOMER_SUBDOMAIN || '',
requireSignedURLs: true // OPTIONAL: enable this if you enabled the signed downloads on your storage so the plugin will use the signed s3 url to the cloudflare stream copy video url function
}),
}),
],
// ... rest of your config
})
Create a .env file with your streaming provider credentials:
CLOUDFLARE_STREAM_API_TOKEN=your_cloudflare_api_token
CLOUDFLARE_STREAM_ACCOUNT_ID=your_cloudflare_account_id
NEXT_PUBLIC_CLOUDFLARE_STREAM_CUSTOMER_SUBDOMAIN=https://customer-<YOUR_CUSTOMER_ID>.cloudflarestream.com
The plugin works with Payload upload collections:
import type { CollectionConfig } from 'payload/types'
export const Videos: CollectionConfig = {
slug: 'videos',
upload: {
mimeTypes: ['video/*'],
},
fields: [
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'description',
type: 'textarea',
},
],
}
type VideoStreamConfig = {
collections?: {
[collectionSlug: string]: boolean
}
enabled?: boolean
defaultAdapter: StreamAdapter
disabled?: boolean
requireSignedURLs?: boolean
}
To use Cloudflare Stream:
The plugin automatically manages video processing status through Payload's job queue system. When you upload a video, the plugin continuously polls the streaming provider to check when the video is ready for playback.
The plugin automatically injects background tasks into your Payload configuration. Each streaming adapter gets its own task that runs on the payloadVideoStream queue:
payloadStreamUpdateStatusFor{AdapterName} (e.g., payloadStreamUpdateStatusForCloudflareStream)payloadVideoStream// The plugin injects tasks like this (happens automatically)
config.jobs = {
...config.jobs,
tasks: [
...(config.jobs?.tasks || []),
updateStreamStatusTask(cloudflareStreamAdapter),
],
}
Video Upload: When you upload a video to a collection with the plugin enabled:
stream field is populated with metadata (videoId, status: 'pending')Background Polling: The plugin creates a background task that:
payloadVideoStream queueSelf-Requeuing: If the video is still processing:
payloadVideoStream queueready statusStatus Lifecycle:
pending → Video is being processed by the providerready → Video processing complete, ready for playbackerror → Processing failedYou can track video status in several ways:
In the Payload Admin UI:
/admin/collections/videos)stream.status field shows the current statusProgrammatically:
const video = await payload.findByID({
collection: 'videos',
id: videoId,
})
const streamStatus = (video.stream as { status?: string })?.status
// 'pending', 'ready', or 'error'
The payloadVideoStream queue is automatically created and configured. No additional setup is required. However, you can monitor queue status through:
When the plugin queues a status update task, it passes:
documentId: The ID of the video document to updatecollectionSlug: The collection containing the videoExample task payload:
{
"documentId": "abc123",
"collectionSlug": "videos"
}
git clone https://github.com/webowodev/payload-video-stream.git
cd payload-video-stream
pnpm install
cd dev
cp .env.example .env
.env file with your configuration:DATABASE_URI=postgres://root:[email protected]:5432/videostream
PAYLOAD_SECRET=your-secret-key
CLOUDFLARE_STREAM_API_TOKEN=your_cloudflare_api_token
CLOUDFLARE_STREAM_ACCOUNT_ID=your_cloudflare_account_id
NEXT_PUBLIC_CLOUDFLARE_STREAM_CUSTOMER_SUBDOMAIN=https://customer-<YOUR_CUSTOMER_ID>.cloudflarestream.com
pnpm dev
The dev server will be available at http://localhost:3000
payload-video-stream/
├── src/
│ ├── index.ts # Main plugin export
│ ├── adapters/
│ │ ├── streamAdapter.ts # Base adapter interface
│ │ ├── cloudflareStream.ts # Cloudflare implementation
│ │ └── types.ts # Adapter type definitions
│ ├── fields/
│ │ └── stream.ts # Custom field definitions
│ └── hooks/
│ └── afterOperation.ts # Upload hooks
├── dev/ # Development Payload instance
│ ├── payload.config.ts
│ └── app/ # Next.js app router
└── test-results/ # Test output
Run the test suite:
pnpm test
Run tests in watch mode:
pnpm test:watch
Run integration tests:
pnpm test:int
Run E2E tests:
pnpm test:e2e
Build the plugin for production:
pnpm build
We welcome contributions! Here's how you can help:
src/adapters/:// src/adapters/yourProvider.ts
import type { StreamAdapter } from './streamAdapter'
export class YourProviderAdapter implements StreamAdapter {
async upload(file: File): Promise<StreamResult> {
// Implement upload logic
}
async delete(videoId: string): Promise<void> {
// Implement delete logic
}
}
Export your adapter in src/adapters/index.ts
Add configuration types in src/adapters/types.ts
Write tests for your adapter
Update documentation
git checkout -b feature/amazing-featurepnpm testgit commit -m 'Add amazing feature'git push origin feature/amazing-featurepnpm lint before committingFollow Conventional Commits:
feat: New featuresfix: Bug fixesdocs: Documentation changestest: Test additions or changesrefactor: Code refactoringchore: Maintenance tasksMIT License - see the LICENSE file for details.
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Built with Payload CMS - The most powerful TypeScript headless CMS.
Made with ❤️ by webowodev
Topics
plugin adaptive bitrate videos
Automatic HLS adaptive bitrate transcoding for video uploads in Payload collections
4827/wk22v3
payload video streaming
Video upload, encoding status and playback for Payload using Cloudflare Stream, Mux or Bunny Stream
65961/wk0v3 v4
video plugin
Queued FFmpeg video variant processing with presets, cropping and an admin panel for Payload upload collections
4561/wk1v3
payload media
Search stock images and videos from Unsplash, Pexels, Pixabay and Openverse inside the Payload admin
83900/wk8v4
mux video
Upload and manage Mux videos from a dedicated Payload collection with public or signed playback
793.9k/wk84v3
payload plugin media preview
Preview images, video, audio, code, CSV and Office files in the Payload admin edit and list views
66632/wk14v4