Files
OpenFrame/lib/video-providers/types.ts
T
yusufipk 4bf6e821af feat: enable S3 video uploads and update related configurations
- Added support for self-hosted S3 video uploads with new environment variables: OPENFRAME_ENABLE_S3_VIDEO_UPLOADS and OPENFRAME_MAX_VIDEO_UPLOAD_BYTES.
- Updated .env.example and .env.docker.example to reflect new configuration options.
- Enhanced Content Security Policy to include origins for S3-compatible storage.
- Updated dependencies for AWS SDK to support new features.
- Refactored upload logic to accommodate both Bunny and S3 upload providers.
- Updated documentation to clarify the usage of direct uploads and S3 configurations.
- Closes #11
2026-05-27 17:04:39 +02:00

50 lines
1.2 KiB
TypeScript

// Video Provider Types - Future-proof abstraction for multiple video sources
export interface VideoMetadata {
title: string;
description?: string;
thumbnailUrl: string;
duration?: number; // in seconds
author?: string;
authorUrl?: string;
uploadDate?: Date;
}
export interface VideoProvider {
id: string;
name: string;
icon: string; // Lucide icon name
// URL handling
canHandle(url: string): boolean;
extractVideoId(url: string): string | null;
// Embed and display
getEmbedUrl(videoId: string, options?: EmbedOptions): string;
getThumbnailUrl(videoId: string, size?: ThumbnailSize): string;
// Metadata fetching
getMetadata(videoId: string): Promise<VideoMetadata>;
}
export interface EmbedOptions {
autoplay?: boolean;
startTime?: number; // in seconds
controls?: boolean;
loop?: boolean;
muted?: boolean;
}
export type ThumbnailSize = 'small' | 'medium' | 'large' | 'maxres';
// Supported provider types - extend as we add more
export type VideoProviderType = 'youtube' | 'direct' | 'bunny' | 'r2';
// Video source stored in database
export interface VideoSource {
providerId: VideoProviderType;
videoId: string;
originalUrl: string;
metadata?: VideoMetadata;
}