当前位置: 首页>>代码示例>>Java>>正文


Java MusicObject类代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:WeiboShareManager.java

示例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;
}
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:26,代码来源:WBShareActivity.java

示例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;
}
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:22,代码来源:WBShareResponseActivity.java

示例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;
}
 
开发者ID:henjue,项目名称:sharesdk,代码行数:22,代码来源:WeiboShareManager.java

示例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;
}
 
开发者ID:chendongMarch,项目名称:SocialSdkLibrary,代码行数:11,代码来源:WbPlatform.java

示例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);
}
 
开发者ID:jhwing,项目名称:SKShare,代码行数:13,代码来源:WeiboShare.java


注:本文中的com.sina.weibo.sdk.api.MusicObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。