7 lines
271 B
TypeScript
7 lines
271 B
TypeScript
/** Path looks like a video file (upload or URL path). */
|
|
export function isLikelyVideoPath(path: string | undefined | null): boolean {
|
|
if (!path) return false;
|
|
const p = path.split("?")[0].toLowerCase();
|
|
return /\.(mp4|webm|mov|m4v|mkv|ogv|avi)(\/)?$/i.test(p);
|
|
}
|