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


Java ImageInfo类代码示例

本文整理汇总了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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:23,代码来源:CastService.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:19,代码来源:DLNAMediaInfoParser.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:26,代码来源:DLNAService.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:23,代码来源:WebOSWebAppSession.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:24,代码来源:RokuService.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:24,代码来源:RokuService.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:23,代码来源:AirPlayService.java

示例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);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:25,代码来源:CastService.java

示例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);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:26,代码来源:DLNAService.java

示例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);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:24,代码来源:WebOSWebAppSession.java

示例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);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:23,代码来源:WebOSTVService.java

示例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));
    }
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:34,代码来源:CastService.java

示例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);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:30,代码来源:CastService.java

示例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);
    }
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:33,代码来源:WebOSTVService.java


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