# wx.miniapp.shareVideoMessage
Share video to WeChat
Note:
1, the interface needs to apply and initialize WeChat open Capabilities, requires the client to configure the relevant
2, the interface does not support theMobile App AssistantDebugging, developers need to build Apk or ipa Install to the phone before debugging
# Precautions before Access
- This ability dependsWeChat Open SDK , need to follow the guidelines in theWeChat Open PlatformCreate a mobile application account to complete the relevant initialization configuration, details can be viewedWeChat mobile application capability initialization guidelines
# parameter
Easy for developers to understand, wx.miniapageshare VideoMessage Parameters andWeChat Open Platform opensdk Sharing interfaceConsistent parameters
attribute | type | Default value | Required | Introductions |
---|---|---|---|---|
videoUrl | string | - | yes | Video link url, Limit length does not exceed 10KB |
videoLowBandUrl | string | - | no | Video links for use in low-bandwidth environments, limited in length not exceeding 10KB |
title | string | - | yes | Video Title |
description | string | - | yes | Video Description |
thumbPath | string | - | yes | Share thumbnails, support code package image resource path or local temporary, cache, user fileGraph of a network is not supported |
scene | number | - | no | Scene value |
success | function | no | Successful callback after getting | |
fail | function | no | Get a failed callback |
Note: videoUrl and videoLowBandUrl Cannot be empty at the same time
# Call Example
wx.miniapp.shareVideoMessage({
videoUrl: 'https://encrypted-vtbn0.gstatic.com/Video? q=tbn:ANd9GcQPt0qbJ-TMyXt _fKgwfjE4y2qqS543MIWjjQ',
videoLowBandUrl: 'https://encrypted-vtbn0.gstatic.com/Video? q=tbn:ANd9GcQPt0qbJ-TMyXt _fKgwfjE4y2qqS543MIWjjQ',
title: 'title',
description: 'description',
thumbPath: '/pages/thumb.png',
success(e) {
console.log(`Share video success: ${JSON.stringify(e)})`)
},
fail(e) {
console.log(`Share video failed: ${JSON.stringify(e)}`)
}
})