Search in sources :

Example 6 with ImageInfo

use of com.connectsdk.core.ImageInfo in project butter-android by butterproject.

the class NetcastTVService method displayImage.

@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);
}
Also used : ImageInfo(com.connectsdk.core.ImageInfo)

Example 7 with ImageInfo

use of com.connectsdk.core.ImageInfo in project butter-android by butterproject.

the class WebOSTVService method displayImage.

@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);
}
Also used : ImageInfo(com.connectsdk.core.ImageInfo)

Example 8 with ImageInfo

use of com.connectsdk.core.ImageInfo in project butter-android by butterproject.

the class WebOSWebAppSession method displayImage.

@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);
}
Also used : ImageInfo(com.connectsdk.core.ImageInfo)

Example 9 with ImageInfo

use of com.connectsdk.core.ImageInfo in project butter-android by butterproject.

the class WebOSWebAppSession method playMedia.

@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);
}
Also used : ImageInfo(com.connectsdk.core.ImageInfo)

Example 10 with ImageInfo

use of com.connectsdk.core.ImageInfo in project butter-android by butterproject.

the class CastService method getMediaInfo.

@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));
    }
}
Also used : MediaInfo(com.connectsdk.core.MediaInfo) MediaMetadata(com.google.android.gms.cast.MediaMetadata) ServiceCommandError(com.connectsdk.service.command.ServiceCommandError) ImageInfo(com.connectsdk.core.ImageInfo)

Aggregations

ImageInfo (com.connectsdk.core.ImageInfo)18 MediaInfo (com.connectsdk.core.MediaInfo)4 ServiceCommandError (com.connectsdk.service.command.ServiceCommandError)2 ArrayList (java.util.ArrayList)2 SubtitleWrapper (butter.droid.base.providers.subs.model.SubtitleWrapper)1 RemoteMediaPlayer (com.amazon.whisperplay.fling.media.controller.RemoteMediaPlayer)1 MediaPlayerInfo (com.amazon.whisperplay.fling.media.service.MediaPlayerInfo)1 MediaPlayer (com.connectsdk.service.capability.MediaPlayer)1 FireTVServiceError (com.connectsdk.service.command.FireTVServiceError)1 MediaMetadata (com.google.android.gms.cast.MediaMetadata)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 List (java.util.List)1 ExecutionException (java.util.concurrent.ExecutionException)1 JSONException (org.json.JSONException)1 JSONObject (org.json.JSONObject)1