Taro.saveVideoToPhotosAlbum(option)
Saves videos to system album. The MP4 format is supported. User Authorization is required for scope.writePhotosAlbum before this API is called.
Bug & Tip:
tip
: The camera parameter does not work on some Android phones because the system ROM does not support it.
Type
(option: Option) => Promise<CallbackResult>
Parameters
Option
Property | Type | Required | Description |
---|---|---|---|
filePath | string | Yes | Video file path, which can be a temporary file path or a permanent file path. |
complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail | (res: any) => void | No | The callback function for a failed API call |
success | (res: Result) => void | No | The callback function for a successful API call |
Sample Code
Taro.saveVideoToPhotosAlbum({
filePath: 'wxfile://xxx'
success: function (res) {
console.log(res.errMsg)
}
})
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.saveVideoToPhotosAlbum | ✔️ | ✔️ |