本文整理汇总了Java中com.connectsdk.core.ImageInfo类的典型用法代码示例。如果您正苦于以下问题:Java ImageInfo类的具体用法?Java ImageInfo怎么用?Java ImageInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageInfo类属于com.connectsdk.core包,在下文中一共展示了ImageInfo类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayImage
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void displayImage(MediaInfo mediaInfo, LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
displayImage(mediaUrl, mimeType, title, desc, iconSrc, listener);
}
示例2: getMediaInfo
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
public static MediaInfo getMediaInfo(String str, String baseUrl) {
String url = DLNAMediaInfoParser.getURL(str);
String title = DLNAMediaInfoParser.getTitle(str);
String mimeType = DLNAMediaInfoParser.getMimeType(str);
String description = DLNAMediaInfoParser.getArtist(str) + "\n" +
DLNAMediaInfoParser.getAlbum(str);
String iconUrl = DLNAMediaInfoParser.getThumbnail(str);
try {
new URL(iconUrl).openConnection().connect();
} catch (Exception e) {
iconUrl = baseUrl + iconUrl;
}
ArrayList<ImageInfo> list = new ArrayList<ImageInfo>();
list.add(new ImageInfo(iconUrl));
return new MediaInfo(url, mimeType, title, description, list);
}
示例3: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop,
LaunchListener listener) {
String mediaUrl = null;
SubtitleInfo subtitle = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
subtitle = mediaInfo.getSubtitleInfo();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
displayMedia(mediaUrl, subtitle, mimeType, title, desc, iconSrc, listener);
}
示例4: displayImage
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void displayImage(MediaInfo mediaInfo, MediaPlayer.LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
displayImage(mediaUrl, mimeType, title, desc, iconSrc, listener);
}
示例5: displayImage
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void displayImage(MediaInfo mediaInfo,
MediaPlayer.LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
displayImage(mediaUrl, mimeType, title, desc, iconSrc, listener);
}
示例6: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop,
MediaPlayer.LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
playMedia(mediaUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
示例7: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop, LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
playMedia(mediaUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
示例8: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop, LaunchListener listener) {
String mediaUrl = null;
String subsUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
subsUrl = mediaInfo.getSubsUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
playMedia(mediaUrl, subsUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
示例9: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop,
LaunchListener listener) {
String mediaUrl = null;
String subsUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
subsUrl = mediaInfo.getSubsUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
displayMedia(mediaUrl, subsUrl, mimeType, title, desc, iconSrc, listener);
}
示例10: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(final MediaInfo mediaInfo,
final boolean shouldLoop, final MediaPlayer.LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
playMedia(mediaUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
示例11: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop, MediaPlayer.LaunchListener listener) {
String mediaUrl = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
playMedia(mediaUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
示例12: getMediaInfo
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void getMediaInfo(MediaInfoListener listener) {
if (mMediaPlayer == null)
return;
if (mMediaPlayer.getMediaInfo() != null) {
String url = mMediaPlayer.getMediaInfo().getContentId();
String mimeType = mMediaPlayer.getMediaInfo().getContentType();
MediaMetadata metadata = mMediaPlayer.getMediaInfo().getMetadata();
String title = null;
String description = null;
ArrayList<ImageInfo> list = null;
if (metadata != null) {
title = metadata.getString(MediaMetadata.KEY_TITLE);
description = metadata.getString(MediaMetadata.KEY_SUBTITLE);
if (metadata.getImages() != null && metadata.getImages().size() > 0) {
String iconUrl = metadata.getImages().get(0).getUrl().toString();
list = new ArrayList<ImageInfo>();
list.add(new ImageInfo(iconUrl));
}
}
MediaInfo info = new MediaInfo(url, mimeType, title, description, list);
Util.postSuccess(listener, info);
}
else {
Util.postError(listener, new ServiceCommandError(0, "Media Info is null", null));
}
}
示例13: playMedia
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop, LaunchListener listener) {
try {
mCastClient.getApplicationStatus(mApiClient);
} catch (CastClientException e) {
Util.postError(listener, new ServiceCommandError(e.getMessage()));
}
String mediaUrl = null;
SubtitleInfo subtitle = null;
String mimeType = null;
String title = null;
String desc = null;
String iconSrc = null;
if (mediaInfo != null) {
mediaUrl = mediaInfo.getUrl();
subtitle = mediaInfo.getSubtitleInfo();
mimeType = mediaInfo.getMimeType();
title = mediaInfo.getTitle();
desc = mediaInfo.getDescription();
if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
ImageInfo imageInfo = mediaInfo.getImages().get(0);
iconSrc = imageInfo.getUrl();
}
}
playMedia(mediaUrl, subtitle, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
示例14: playMediaByNativeApp
import com.connectsdk.core.ImageInfo; //导入依赖的package包/类
private void playMediaByNativeApp(MediaInfo mediaInfo, boolean shouldLoop,
LaunchListener listener) {
DeviceService dlnaService = this.getDLNAService();
if (dlnaService != null) {
MediaPlayer mediaPlayer = dlnaService.getAPI(MediaPlayer.class);
if (mediaPlayer != null) {
mediaPlayer.playMedia(mediaInfo, shouldLoop, listener);
return;
}
}
String iconSrc = null;
List<ImageInfo> images = mediaInfo.getImages();
if (images != null && !images.isEmpty()) {
ImageInfo iconImage = images.get(0);
if (iconImage != null) {
iconSrc = iconImage.getUrl();
}
}
try {
JSONObject params =
createPlayMediaJsonRequestForSsap(mediaInfo, shouldLoop, iconSrc);
displayMedia(params, listener);
} catch (JSONException ex) {
Util.postError(listener, new ServiceCommandError(-1, ex.getLocalizedMessage(), ex));
Log.e(Util.T, "Create JSON request for ssap://media.viewer/open failure", ex);
}
}