本文整理汇总了Java中com.tencent.mm.sdk.openapi.WXMusicObject类的典型用法代码示例。如果您正苦于以下问题:Java WXMusicObject类的具体用法?Java WXMusicObject怎么用?Java WXMusicObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WXMusicObject类属于com.tencent.mm.sdk.openapi包,在下文中一共展示了WXMusicObject类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: shareMusic
import com.tencent.mm.sdk.openapi.WXMusicObject; //导入依赖的package包/类
private void shareMusic(int shareType, ShareContent shareContent) {
WXMusicObject music = new WXMusicObject();
//Str1+"#wechat_music_url="+str2 ;str1是网页地址,str2是音乐地址。
music.musicUrl =shareContent.getURL()+ "#wechat_music_url="+shareContent.getMusicUrl();
WXMediaMessage msg = new WXMediaMessage(music);
msg.title = shareContent.getTitle();
msg.description = shareContent.getContent();
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = ShareUtil.buildTransaction("music");
req.message = msg;
req.scene = shareType;
sendShare(shareContent.getImageUrl(), req);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:WechatShareManager.java
示例2: sendMusicUrlBmp
import com.tencent.mm.sdk.openapi.WXMusicObject; //导入依赖的package包/类
/**
* @param title
* @param desc
* @param musicUrl
* @param bmp
* @param isTimeline
* @return
*/
public boolean sendMusicUrlBmp(String title, String desc, String musicUrl, Bitmap bmp, boolean isTimeline) {
WXMediaMessage msg = createMediaMsg(title, desc);
WXMusicObject musicObj = new WXMusicObject();
musicObj.musicUrl = musicUrl;
msg.mediaObject = musicObj;
if (bmp != null && !bmp.isRecycled()) {
setThumbBmpDataToMsg(msg, bmp);
}
return sendReq(msg, isTimeline);
}
开发者ID:RincLiu,项目名称:Roid-Library,代码行数:19,代码来源:RLWeixinHelper.java
示例3: shareMusic
import com.tencent.mm.sdk.openapi.WXMusicObject; //导入依赖的package包/类
/**
* 分享音乐
*/
public void shareMusic(Context context, WeChatSKShareContent content, boolean isToFriend) {
WXMusicObject musicObject = new WXMusicObject();
musicObject.musicUrl = content.musicUrl;
send(context, content, isToFriend, musicObject, "music");
}
开发者ID:jhwing,项目名称:SKShare,代码行数:9,代码来源:WeChatShare.java
注:本文中的com.tencent.mm.sdk.openapi.WXMusicObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论