mirror of https://github.com/mue/mue.git
14 lines
401 B
JavaScript
14 lines
401 B
JavaScript
/**
|
|
* If the URL starts with `data:video/` or ends with `.mp4`, `.webm`, or `.ogg`, then it's a video.
|
|
* @param url - The URL of the file to be checked.
|
|
* @returns A function that takes a url and returns a boolean.
|
|
*/
|
|
export default function videoCheck(url) {
|
|
return (
|
|
url.startsWith('data:video/') ||
|
|
url.endsWith('.mp4') ||
|
|
url.endsWith('.webm') ||
|
|
url.endsWith('.ogg')
|
|
);
|
|
}
|