Skip to content

ShareMusic

Parameters

PropertyTypeDefault ValueRequiredDescription
titlestring-NoTitle
descriptionstring-NoDescription
musicUrlstring-YesAudio link
musicLowBandUrlstring-NoMusic link for low bandwidth environments
musicDataUrlstring-YesAudio data link
musicLowBandDataUrlstring-NoMusic data link for low bandwidth environments
songLyricstring-NoLyrics
songAlbumUrlstring-NoAlbum
scenenumber-NoTarget scene for sharing, 0=share to chat, 1=share to Moments, 2=share to favorites

Example

javascript
window.Wechat.shareMusic({
  		title: '分享音乐',
  		description: '这是一个音乐',
  		musicUrl: '',
  	  musicDataUrl: '',
      scene: 0, 
  }, function(res){
    console.log("share success");
  }, function(err) {
    console.error(err);
  }
);

Apache 2.0 License.