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;
}
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;
}
Aggregations