Skip to main content
Version: Next

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:

  1. tip: The camera parameter does not work on some Android phones because the system ROM does not support it.

Reference

Type

(option: Option) => Promise<CallbackResult>

Parameters

Option

PropertyTypeRequiredDescription
filePathstringYesVideo file path, which can be a temporary file path or a permanent file path.
complete(res: any) => voidNoThe callback function used when the API call completed (always executed whether the call succeeds or fails)
fail(res: any) => voidNoThe callback function for a failed API call
success(res: Result) => voidNoThe callback function for a successful API call

Sample Code

Taro.saveVideoToPhotosAlbum({
filePath: 'wxfile://xxx'
success: function (res) {
console.log(res.errMsg)
}
})

API Support

APIWeChat Mini-ProgramH5React Native
Taro.saveVideoToPhotosAlbum✔️✔️