Search in sources :

Example 11 with Thumbnail

use of com.zype.android.webapi.model.video.Thumbnail in project zype-android by zype.

the class AnalyticsManager method getVideoAttributes.

private Map<String, Object> getVideoAttributes(Video video) {
    Map<String, Object> result = new HashMap<>();
    result.put(AnalyticsTags.VIDEO_CREATED_AT, video.createdAt);
    result.put(AnalyticsTags.VIDEO_DURATION, (long) video.duration);
    result.put(AnalyticsTags.VIDEO_ID, video.id);
    result.put(AnalyticsTags.VIDEO_PUBLISHED_AT, video.publishedAt);
    result.put(AnalyticsTags.VIDEO_SERIES_ID, video.seriesId);
    result.put(AnalyticsTags.VIDEO_TITLE, video.title);
    result.put(AnalyticsTags.VIDEO_UPDATED_AT, video.updatedAt);
    Thumbnail thumbnail = VideoHelper.getThumbnailByHeight(video, 480);
    if (thumbnail != null) {
        result.put(AnalyticsTags.VIDEO_THUMBNAIL, thumbnail.getUrl());
    }
    return result;
}
Also used : HashMap(java.util.HashMap) Thumbnail(com.zype.android.webapi.model.video.Thumbnail)

Example 12 with Thumbnail

use of com.zype.android.webapi.model.video.Thumbnail in project zype-android by zype.

the class DataHelper method getThumbnailList.

public static List<Thumbnail> getThumbnailList(ContentResolver contentResolver, String fileId) {
    List<Thumbnail> thumbnailList = null;
    Cursor cursor = CursorHelper.getVideoCursor(contentResolver, fileId);
    if (cursor != null) {
        if (cursor.moveToFirst()) {
            String thumbnailJson = cursor.getString(cursor.getColumnIndexOrThrow(Contract.Video.COLUMN_THUMBNAILS));
            thumbnailList = (new Gson().fromJson(thumbnailJson, new TypeToken<List<Thumbnail>>() {
            }.getType()));
        }
        cursor.close();
    }
    return thumbnailList;
}
Also used : TypeToken(com.google.gson.reflect.TypeToken) Gson(com.google.gson.Gson) Thumbnail(com.zype.android.webapi.model.video.Thumbnail) Cursor(android.database.Cursor)

Aggregations

Thumbnail (com.zype.android.webapi.model.video.Thumbnail)12 Gson (com.google.gson.Gson)6 Type (java.lang.reflect.Type)5 List (java.util.List)5 ArrayList (java.util.ArrayList)4 TypeToken (com.google.gson.reflect.TypeToken)3 Image (com.zype.android.webapi.model.video.Image)3 MediaInfo (com.google.android.gms.cast.MediaInfo)2 MediaMetadata (com.google.android.gms.cast.MediaMetadata)2 WebImage (com.google.android.gms.common.images.WebImage)2 Video (com.zype.android.Db.Entity.Video)2 VideoData (com.zype.android.webapi.model.video.VideoData)2 Intent (android.content.Intent)1 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 NonNull (androidx.annotation.NonNull)1 MediaQueueItem (com.google.android.gms.cast.MediaQueueItem)1 Playlist (com.zype.android.Db.Entity.Playlist)1 ConsumerFavoriteVideoData (com.zype.android.webapi.model.consumers.ConsumerFavoriteVideoData)1 Image (com.zype.android.webapi.model.playlist.Image)1