Skip to content

ShareVideo

Parameters

PropertyTypeDefault ValueRequiredDescription
videoUrlstring-YesVideo URL, limited to 10KB in length
videoLowBandUrlstring-NoVideo URL for low bandwidth environments, limited to 10KB in length
titlestring-NoVideo title
descriptionstring-NoVideo description
thumbPathstring-YesThumbnail for sharing, supports network image links, Base64 strings, Assets resources, or system file paths
scenenumber-NoTarget scene for sharing, 0=share to chat, 1=share to Moments, 2=share to favorites

Note: videoUrl and videoLowBandUrl cannot both be empty

Example

javascript
window.Wechat.shareVideo({
      videoUrl: 'http://vjs.zencdn.net/v/oceans.mp4',
  		title: '分享视频',
  		description: '这是一个视频',
  		thumbPath: 'www/img/logo.png',
      scene: 0, 
  }, function(res){
    console.log("share success");
  }, function(err) {
    console.error(err);
  }
);

Apache 2.0 License.