Skip to content

feat: add downloadable video support and enhanced metadata - #2

Merged
webowodev merged 2 commits into
mainfrom
feat/downladable
Nov 30, 2025
Merged

feat: add downloadable video support and enhanced metadata#2
webowodev merged 2 commits into
mainfrom
feat/downladable

Conversation

@webowodev

Copy link
Copy Markdown
Owner

What?

Added downloadable video support and enhanced metadata functionality to the Payload video stream plugin:

  • Downloadable Support: Added configurable download generation for both audio and video files through Cloudflare Stream API
  • Enhanced Metadata: Included comprehensive video metadata fields including duration, dimensions (width/height), file size, and readyToStreamAt timestamp
  • Improved Admin UI: Hidden internal metadata fields for a cleaner admin interface while preserving data access
  • Type Safety: Updated TypeScript definitions to support all new metadata fields
  • Dev Environment: Configured payload to disable local storage for better development experience

Why?

These changes are important because:

  1. Download Functionality: Enables users to generate and access downloadable versions of their streamed videos, providing more flexibility for content distribution
  2. Better Metadata: Rich video metadata helps with content management, analytics, and user experience by providing detailed information about video properties
  3. Cleaner UI: Hiding internal fields reduces admin interface clutter while maintaining data integrity
  4. Developer Experience: Better type definitions and development configuration improve the plugin development workflow

The downloadable feature is particularly valuable for content creators who need both streaming and download capabilities for their videos.

Screenshot (optional)

N/A - Backend functionality changes

Anything else? (optional)

  • The generateDownloads parameter in cloudflareStreamAdapter can be configured as:
    • true (default): Generate both audio and video downloads
    • false: Disable download generation
    • { audio: boolean, video: boolean }: Fine-grained control over download types
  • All new metadata fields are automatically populated when video status is updated
  • Changes are backward compatible with existing configurations

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

- Add downloadable video generation support to Cloudflare Stream adapter
- Include video metadata fields: duration, dimensions, size, readyToStreamAt
- Hide internal fields in admin UI for cleaner interface
- Update type definitions to support new metadata fields
- Configure payload to disable local storage in dev environment

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds downloadable video support and enhanced metadata functionality to the Payload video stream plugin. The changes enable users to generate downloadable versions of their streamed videos through the Cloudflare Stream API while enriching video documents with comprehensive metadata like duration, dimensions, file size, and stream readiness timestamp. These fields are hidden in the admin UI to maintain a clean interface while preserving data accessibility.

Key changes:

  • Added configurable download generation (generateDownloads parameter) for audio and video files
  • Enhanced metadata fields: durationInSeconds, width, height, size, and readyToStreamAt
  • Hidden internal metadata fields in admin UI for cleaner interface

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/hooks/afterOperation.ts Updates status hook to populate new metadata fields from streaming provider response
src/fields/stream.ts Adds new metadata field definitions and hides internal fields from admin UI
src/adapters/types.ts Updates TypeScript types to include new metadata properties
src/adapters/cloudflareStream.ts Implements download generation logic and maps Cloudflare API response to new metadata fields
dev/payload.config.ts Disables local storage in development environment

Comment thread src/fields/stream.ts
Comment on lines +32 to 34
hidden: true,

readOnly: true,

Copilot AI Nov 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line between hidden and readOnly properties is inconsistent with the formatting of other field definitions in the file. Remove the blank line to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment thread src/fields/stream.ts
Comment on lines +50 to +52
hidden: true,

readOnly: true,

Copilot AI Nov 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line between hidden and readOnly properties is inconsistent with the formatting of other field definitions in the file. Remove the blank line to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment thread src/fields/stream.ts
Comment on lines +59 to +61
hidden: true,

readOnly: true,

Copilot AI Nov 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line between hidden and readOnly properties is inconsistent with the formatting of other field definitions in the file. Remove the blank line to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment thread src/fields/stream.ts
Comment on lines +68 to +70
hidden: true,

readOnly: true,

Copilot AI Nov 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line between hidden and readOnly properties is inconsistent with the formatting of other field definitions in the file. Remove the blank line to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment thread src/fields/stream.ts
Comment on lines +77 to +79
hidden: true,

readOnly: true,

Copilot AI Nov 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line between hidden and readOnly properties is inconsistent with the formatting of other field definitions in the file. Remove the blank line to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment thread src/fields/stream.ts
Comment on lines +94 to 96
hidden: true,

readOnly: true,

Copilot AI Nov 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line between hidden and readOnly properties is inconsistent with the formatting of other field definitions in the file. Remove the blank line to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment thread src/adapters/cloudflareStream.ts
Comment thread src/adapters/cloudflareStream.ts Outdated
@webowodev
webowodev merged commit 3755d93 into main Nov 30, 2025
2 checks passed
@webowodev
webowodev deleted the feat/downladable branch November 30, 2025 03:19
github-actions Bot pushed a commit that referenced this pull request Nov 30, 2025
# [1.2.0](v1.1.2...v1.2.0) (2025-11-30)

### Features

* add downloadable video support and enhanced metadata ([#2](#2)) ([3755d93](3755d93))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants