Search in sources :

Example 16 with ImageInfo

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

the class FireTVService method setMediaSourceFromMediaInfo.

private void setMediaSourceFromMediaInfo(MediaInfo mediaInfo, LaunchListener listener) {
    String iconSrc = "";
    if (mediaInfo.getImages() != null && !mediaInfo.getImages().isEmpty()) {
        ImageInfo imageInfo = mediaInfo.getImages().get(0);
        if (imageInfo != null) {
            iconSrc = imageInfo.getUrl();
        }
    }
    setMediaSource(mediaInfo.getUrl(), mediaInfo.getSubsUrl(), mediaInfo.getMimeType(), mediaInfo.getTitle(), mediaInfo.getDescription(), iconSrc, listener);
}
Also used : ImageInfo(com.connectsdk.core.ImageInfo)

Example 17 with ImageInfo

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

the class RokuService 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 18 with ImageInfo

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

the class RokuService method playMedia.

@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);
}
Also used : 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