title: Taro.saveVideoToPhotosAlbum(option)

sidebar_label: saveVideoToPhotosAlbum

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

  1. (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

  1. Taro.saveVideoToPhotosAlbum({
  2. filePath: 'wxfile://xxx'
  3. success: function (res) {
  4. console.log(res.errMsg)
  5. }
  6. })

API Support

API WeChat Mini-Program H5 React Native
Taro.saveVideoToPhotosAlbum ✔️ ✔️