Files
OpenFrame/lib/video-providers/types.ts
T
Yusuf İpek 264392c2ec chore(init): scaffold OpenFrame — Next.js + Bun + shadcn
Initialize OpenFrame project with core scaffold and UI foundation.

- Project scaffold: Next.js 16.1 (App Router) + Bun runtime
- UI: shadcn/ui + TailwindCSS; landing, dashboard, project, and auth UIs
- Video support: provider abstraction (YouTube first), video player page with timestamped comments and custom timeline
- Auth & DB: NextAuth skeleton and Prisma schema (Postgres) included
- UX: dark-mode toggle, full-width layouts, comments sidebar, video route moved to /watch/[videoId]
- Dev: added YouTube iframe integration, custom controls, and TypeScript types
- Next steps: DB migrations, API routes (CRUD), real data wiring, voice-recording & sharing
2026-02-05 22:11:20 +03: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' | 'vimeo' | 'direct';
// Video source stored in database
export interface VideoSource {
providerId: VideoProviderType;
videoId: string;
originalUrl: string;
metadata?: VideoMetadata;
}