'use client'; /** * Dispatches `source.type` to the right canvas. Single-switch indirection * keeps `` simple and isolates engine-specific imports inside * the canvas files so tree-shakers can drop unused providers. */ import type { VideoSource, VideoPlayerSettings } from '../types'; import { NativeCanvas } from './native-canvas'; import { YouTubeCanvas } from './youtube-canvas'; import { VimeoCanvas } from './vimeo-canvas'; import { HlsCanvas } from './hls-canvas'; import { IframeCanvas } from './iframe-canvas'; export interface CanvasDispatcherProps extends VideoPlayerSettings { readonly source: VideoSource; } export function CanvasDispatcher({ source, ...settings }: CanvasDispatcherProps) { switch (source.type) { case 'youtube': return ; case 'vimeo': return ; case 'hls': return ; case 'iframe': return ; case 'url': default: return ; } }