react-all-player
Version:
react-all-player is a simple, lightweight, accessible and customizable React media player that supports modern browsers.
32 lines (31 loc) • 895 B
TypeScript
/**
* Extracts YouTube video ID from various YouTube URL formats
* Supports:
* - https://www.youtube.com/watch?v=VIDEO_ID
* - https://youtu.be/VIDEO_ID
* - https://www.youtube.com/embed/VIDEO_ID
* - Just the video ID itself
*/
export declare function extractYouTubeId(url: string): string | null;
/**
* Extracts Vimeo video ID from various Vimeo URL formats
* Supports:
* - https://vimeo.com/VIDEO_ID
* - https://player.vimeo.com/video/VIDEO_ID
* - Just the video ID itself
*/
export declare function extractVimeoId(url: string): string | null;
/**
* Checks if a source should use YouTube embed
*/
export declare function isYouTubeSource(source: {
file: string;
type?: string;
}): boolean;
/**
* Checks if a source should use Vimeo embed
*/
export declare function isVimeoSource(source: {
file: string;
type?: string;
}): boolean;