Skip to content

isVideo

isVideo(path, extensions?): boolean

判断文件是否为视频

参数

NameTypeDefault valueDescription
pathstringundefined文件路径
extensionsstring[]VIDEO_EXTENSIONS自定义扩展名称列表

返回值

boolean

示例

ts
isVideo('/var/www/html/avatar.jpg') // false
isVideo('/var/www/html/avatar.mp4') // true

源码

file.js