diff --git a/app/(dashboard)/projects/[projectId]/videos/[videoId]/compare/page.tsx b/app/(dashboard)/projects/[projectId]/videos/[videoId]/compare/page.tsx index c6ca0bc..7c97d27 100644 --- a/app/(dashboard)/projects/[projectId]/videos/[videoId]/compare/page.tsx +++ b/app/(dashboard)/projects/[projectId]/videos/[videoId]/compare/page.tsx @@ -51,9 +51,6 @@ function getEmbedUrl(version: Version) { if (version.providerId === 'youtube') { return `https://www.youtube.com/embed/${version.videoId}?enablejsapi=1&rel=0&modestbranding=1`; } - if (version.providerId === 'vimeo') { - return `https://player.vimeo.com/video/${version.videoId}`; - } return version.originalUrl; } diff --git a/components/video-page-content.tsx b/components/video-page-content.tsx index 37daeda..d7f9794 100644 --- a/components/video-page-content.tsx +++ b/components/video-page-content.tsx @@ -358,9 +358,6 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi if (activeVersion.providerId === 'youtube') { return `https://www.youtube.com/embed/${activeVersion.videoId}?enablejsapi=1&rel=0&modestbranding=1&controls=0&showinfo=0&iv_load_policy=3&disablekb=1`; } - if (activeVersion.providerId === 'vimeo') { - return `https://player.vimeo.com/video/${activeVersion.videoId}`; - } try { const url = new URL(activeVersion.originalUrl); if (url.protocol !== 'http:' && url.protocol !== 'https:') { diff --git a/lib/video-providers/index.ts b/lib/video-providers/index.ts index 6a58958..a6480ee 100644 --- a/lib/video-providers/index.ts +++ b/lib/video-providers/index.ts @@ -1,7 +1,6 @@ // Video Provider Registry - Central place to manage all video providers import { youtubeProvider } from './youtube'; -import { vimeoProvider } from './vimeo'; import { directProvider } from './direct'; import type { VideoProvider, VideoSource, VideoMetadata, VideoProviderType } from './types'; @@ -11,7 +10,6 @@ export * from './types'; // Registry of all available providers const providers: VideoProvider[] = [ youtubeProvider, - vimeoProvider, directProvider, ]; diff --git a/lib/video-providers/types.ts b/lib/video-providers/types.ts index 27b5c96..ec9989b 100644 --- a/lib/video-providers/types.ts +++ b/lib/video-providers/types.ts @@ -38,7 +38,7 @@ export interface EmbedOptions { export type ThumbnailSize = 'small' | 'medium' | 'large' | 'maxres'; // Supported provider types - extend as we add more -export type VideoProviderType = 'youtube' | 'vimeo' | 'direct'; +export type VideoProviderType = 'youtube' | 'direct'; // Video source stored in database export interface VideoSource { diff --git a/lib/video-providers/vimeo.ts b/lib/video-providers/vimeo.ts deleted file mode 100644 index fa4b49f..0000000 --- a/lib/video-providers/vimeo.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { VideoProvider, VideoMetadata, EmbedOptions, ThumbnailSize } from './types'; -import { getCachedMetadata, setCachedMetadata } from './metadata-cache'; - -// Vimeo URL patterns -const VIMEO_PATTERNS = [ - /vimeo\.com\/(\d+)/, - /vimeo\.com\/video\/(\d+)/, - /player\.vimeo\.com\/video\/(\d+)/, - /vimeo\.com\/channels\/\w+\/(\d+)/, - /vimeo\.com\/groups\/\w+\/videos\/(\d+)/, -]; - -export const vimeoProvider: VideoProvider = { - id: 'vimeo', - name: 'Vimeo', - icon: 'Video', // Lucide doesn't have Vimeo icon - - canHandle(url: string): boolean { - return VIMEO_PATTERNS.some(pattern => pattern.test(url)); - }, - - extractVideoId(url: string): string | null { - for (const pattern of VIMEO_PATTERNS) { - const match = url.match(pattern); - if (match?.[1]) { - return match[1]; - } - } - return null; - }, - - getEmbedUrl(videoId: string, options: EmbedOptions = {}): string { - const params = new URLSearchParams(); - - if (options.autoplay) params.set('autoplay', '1'); - if (options.startTime) params.set('t', `${Math.floor(options.startTime)}s`); - if (options.loop) params.set('loop', '1'); - if (options.muted) params.set('muted', '1'); - - // Better UX options - params.set('byline', '0'); - params.set('portrait', '0'); - params.set('title', '0'); - - const queryString = params.toString(); - return `https://player.vimeo.com/video/${videoId}${queryString ? `?${queryString}` : ''}`; - }, - - getThumbnailUrl(videoId: string, size: ThumbnailSize = 'medium'): string { - // Vimeo requires API call to get thumbnail, return placeholder - // In production, cache these after fetching metadata - const sizeMap: Record = { - small: 200, - medium: 400, - large: 640, - maxres: 1280, - }; - - // This is a placeholder - actual thumbnail comes from metadata API - return `https://vumbnail.com/${videoId}_${sizeMap[size]}.jpg`; - }, - - async getMetadata(videoId: string): Promise { - const cacheKey = `vimeo:${videoId}`; - const cached = getCachedMetadata(cacheKey); - if (cached) return cached; - try { - const response = await fetch( - `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${videoId}`, - { signal: AbortSignal.timeout(5000) } - ); - - if (!response.ok) { - throw new Error('Failed to fetch video metadata'); - } - - const data = await response.json(); - - const metadata: VideoMetadata = { - title: data.title, - description: data.description, - thumbnailUrl: data.thumbnail_url, - duration: data.duration, - author: data.author_name, - authorUrl: data.author_url, - uploadDate: data.upload_date ? new Date(data.upload_date) : undefined, - }; - - setCachedMetadata(cacheKey, metadata); - return metadata; - } catch (error) { - const fallback: VideoMetadata = { - title: 'Vimeo Video', - thumbnailUrl: this.getThumbnailUrl(videoId, 'large'), - }; - setCachedMetadata(cacheKey, fallback); - return fallback; - } - }, -}; diff --git a/next.config.ts b/next.config.ts index a49252d..3f640be 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,8 +5,6 @@ const nextConfig: NextConfig = { remotePatterns: [ { protocol: 'https', hostname: 'img.youtube.com' }, { protocol: 'https', hostname: 'i.ytimg.com' }, - { protocol: 'https', hostname: 'i.vimeocdn.com' }, - { protocol: 'https', hostname: 'vumbnail.com' }, { protocol: 'https', hostname: 'images.unsplash.com' }, ], formats: ['image/avif', 'image/webp'],