# wx.shareVideoMessage(Object object)

Start from base library version 2.16.1. Please remaining backward compatible.

with Promise style call: Supported

Mini Program plugin: Not supported

Forward video to chat

# parameter

# Object object

attribute type Default values Required Introductions
videoPath string yes To share a video address, it must be a local or temporary path
thumbPath string no Thumbnail path, if left blank, use first frame of video
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Callback function at the end of an interface call (both successful and unsuccessful calls are executed)

# sample code


  // callback Writing method
  wx.downloadFile({
    url: URL, // Download url
    success (res) {
      // Repost after download
      wx.shareVideoMessage({
        videoPath: res.tempFilePath,
        success() {},
        fail: console.error,
      })
    },
    fail: console.error,
  })

  // async await Writing method
  const { tempFilePath } = await wx.downloadFile({
    url: URL, // Download url
  })
  // Repost after download
  await wx.shareVideoMessage({
    videoPath: res.tempFilePath,
  })