browser-media-tool
v0.0.10
Published
media-tool for get media info (video、 image) such as width、height、ratio; and format media as base64 by media url
Downloads
4
Maintainers
Readme
npm install browser-media-tool / yarn add browser-media-tool
a tool for get media info, such as width、height、ratio, if media is image, can even get base64 by set option base64 = true
methods
- getMediaInfoByFile(file: File)
return Promise -> {width: number, height: number, ratio: number, base64: string, file: File}
- getImageInfoByUrl(url: string, base64: boolean)
return Promise -> {width: number, height: number, ratio: number, url: string} if you set base64 is true, return Promise -> {width: number, height: number, ratio: number, base64: string, url: string}
- getVideoInfoByUrl(url: string)
return Promise -> {width: number, height: number, ratio: number, url: string}