Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API video and save video


May 18, 2021 WeChat Mini Program Development Document


Table of contents


wx.saveVideoToPhotosAlbum(Object object)

Base library 1.2.0 starts to support, and low versions need to be compatible.
User authorization is required for scope.writePhotosAlbum before the call

Save the video to the system album. Support for mp4 video formats.

Parameters

Object object

Property Type The default Required Description
filePath string Is Video file path, which can be between a temporary file path and a permanent file path (local path)
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)

The sample code

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