/**
 * Video source type definitions
 */

// =============================================================================
// Source Types - Different ways to provide video content
// =============================================================================

/** Simple URL source (mp4, webm, etc.) */
export interface UrlSource {
  type: 'url';
  url: string;
  title?: string;
  poster?: string;
}

/** YouTube embed source */
export interface YouTubeSource {
  type: 'youtube';
  /** YouTube video ID (11 characters) */
  id: string;
  title?: string;
  poster?: string;
}

/** Vimeo embed source */
export interface VimeoSource {
  type: 'vimeo';
  /** Vimeo video ID */
  id: string;
  title?: string;
  poster?: string;
}

/** HLS streaming source */
export interface HLSSource {
  type: 'hls';
  /** URL to .m3u8 manifest */
  url: string;
  title?: string;
  poster?: string;
}

/** DASH streaming source */
export interface DASHSource {
  type: 'dash';
  /** URL to .mpd manifest */
  url: string;
  title?: string;
  poster?: string;
}

/** HTTP Range streaming source (for large files with auth) */
export interface StreamSource {
  type: 'stream';
  /** Session ID for authorization */
  sessionId: string;
  /** File path on server */
  path: string;
  /** Function to generate stream URL */
  getStreamUrl: (sessionId: string, path: string) => string;
  /** MIME type for the video */
  mimeType?: string;
  title?: string;
  poster?: string;
}

/** Binary data source (ArrayBuffer) */
export interface BlobSource {
  type: 'blob';
  /** Video data as ArrayBuffer */
  data: ArrayBuffer;
  /** MIME type (default: video/mp4) */
  mimeType?: string;
  title?: string;
  poster?: string;
}

/** Base64 data URL source */
export interface DataUrlSource {
  type: 'data-url';
  /** Base64 encoded data URL */
  data: string;
  title?: string;
  poster?: string;
}

/** Union of all source types */
export type VideoSourceUnion =
  | UrlSource
  | YouTubeSource
  | VimeoSource
  | HLSSource
  | DASHSource
  | StreamSource
  | BlobSource
  | DataUrlSource;
