本文整理汇总了Java中com.sina.weibo.sdk.api.MusicObject类的典型用法代码示例。如果您正苦于以下问题:Java MusicObject类的具体用法?Java MusicObject怎么用?Java MusicObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MusicObject类属于com.sina.weibo.sdk.api包,在下文中一共展示了MusicObject类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMusicObj
import com.sina.weibo.sdk.api.MusicObject; //导入依赖的package包/类
/**
* 创建多媒体(音乐)消息对象。
*
* @return 多媒体(音乐)消息对象。
*/
private MusicObject getMusicObj(ShareContent shareContent) {
// 创建媒体消息
MusicObject musicObject = new MusicObject();
musicObject.identify = Utility.generateGUID();
musicObject.title = shareContent.getTitle();
musicObject.description = shareContent.getContent();
// 设置 Bitmap 类型的图片到视频对象里
Bitmap bmp = BitmapFactory.decodeFile(shareContent.getImageUrl());
musicObject.setThumbImage(bmp);
musicObject.actionUrl = shareContent.getURL();
musicObject.dataUrl = REDIRECT_URL;
musicObject.dataHdUrl = REDIRECT_URL;
musicObject.duration = 10;
musicObject.defaultText = shareContent.getContent();
return musicObject;
}
示例2: getMusicObj
import com.sina.weibo.sdk.api.MusicObject; //导入依赖的package包/类
/**
* 创建多媒体(音乐)消息对象。
*
* @return 多媒体(音乐)消息对象。
*/
private MusicObject getMusicObj() {
// 创建媒体消息
MusicObject musicObject = new MusicObject();
musicObject.identify = Utility.generateGUID();
musicObject.title = mShareMusicView.getTitle();
musicObject.description = mShareMusicView.getShareDesc();
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_logo);
// 设置 Bitmap 类型的图片到视频对象里 设置缩略图。 注意:最终压缩过的缩略图大小不得超过 32kb。
musicObject.setThumbImage(bitmap);
musicObject.actionUrl = mShareMusicView.getShareUrl();
musicObject.dataUrl = "www.weibo.com";
musicObject.dataHdUrl = "www.weibo.com";
musicObject.duration = 10;
musicObject.defaultText = "Music 默认文案";
return musicObject;
}
示例3: getMusicObj
import com.sina.weibo.sdk.api.MusicObject; //导入依赖的package包/类
/**
* 创建多媒体(音乐)消息对象。
*
* @return 多媒体(音乐)消息对象。
*/
private MusicObject getMusicObj() {
// 创建媒体消息
MusicObject musicObject = new MusicObject();
musicObject.identify = Utility.generateGUID();
musicObject.title = mShareMusicView.getTitle();
musicObject.description = mShareMusicView.getShareDesc();
// 设置 Bitmap 类型的图片到视频对象里
musicObject.setThumbImage(mShareMusicView.getThumbBitmap());
musicObject.actionUrl = mShareMusicView.getShareUrl();
musicObject.dataUrl = "www.weibo.com";
musicObject.dataHdUrl = "www.weibo.com";
musicObject.duration = 10;
musicObject.defaultText = "Music 默认文案";
return musicObject;
}
示例4: getMusicObj
import com.sina.weibo.sdk.api.MusicObject; //导入依赖的package包/类
/**
* 创建多媒体(音乐)消息对象。
*
* @return 多媒体(音乐)消息对象。
*/
private MusicObject getMusicObj(Message.Music message) {
// 创建媒体消息
MusicObject musicObject = new MusicObject();
musicObject.identify = Utility.generateGUID();
musicObject.title = message.getTitle();
musicObject.description = message.getDescription();
// 设置 Bitmap 类型的图片到视频对象里
musicObject.setThumbImage(message.getImage());
musicObject.actionUrl = message.getURL();
musicObject.dataUrl = ShareSDK.getInstance().getSinaRedirectUrl();
musicObject.dataHdUrl = ShareSDK.getInstance().getSinaRedirectUrl();
musicObject.duration = 10;
musicObject.defaultText = message.getDescription();
return musicObject;
}
示例5: getMusicObj
import com.sina.weibo.sdk.api.MusicObject; //导入依赖的package包/类
private MusicObject getMusicObj(String title, byte[] thumbData, String actionUrl, String defaultText, String dataUrl, int duration) {
// 创建媒体消息
MusicObject musicObject = new MusicObject();
initCommonParams(musicObject, title, thumbData, actionUrl, defaultText);
musicObject.dataUrl = dataUrl;
musicObject.dataHdUrl = dataUrl;
musicObject.duration = duration == 0 ? 10 : duration;
musicObject.defaultText = defaultText + " " + actionUrl;
return musicObject;
}
示例6: shareMusic
import com.sina.weibo.sdk.api.MusicObject; //导入依赖的package包/类
public void shareMusic(WeiboSKShareContent shareContent, Activity activity) {
MusicObject musicObject = new MusicObject();
musicObject.actionUrl = shareContent.url;
musicObject.defaultText = shareContent.title;
musicObject.title = shareContent.title;
musicObject.description = shareContent.content;
musicObject.duration = shareContent.duration;
musicObject.dataUrl = shareContent.dataUrl;
musicObject.thumbData = getCompressThumbImageData(shareContent, activity);
musicObject.identify = Utility.generateGUID();
send(musicObject, activity);
}