From 7866b1c92ef3abbe222095b7a95f8301cf5a6068 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 19 Sep 2019 17:57:30 +0800 Subject: Fixed frames dropping when playing videos (for real this time). --- .../docilealligator/infinityforreddit/ParsePost.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java index 0f34840a..c6a980b8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java @@ -275,23 +275,7 @@ class ParsePost { post.setVideoUrl(videoUrl); post.setDownloadableGifOrVideo(false); } else if(data.has(JSONUtils.PREVIEW_KEY)){ - JSONObject variations = data.getJSONObject(JSONUtils.PREVIEW_KEY).getJSONArray(JSONUtils.IMAGES_KEY).getJSONObject(0); - if (variations.has(JSONUtils.VARIANTS_KEY) && variations.getJSONObject(JSONUtils.VARIANTS_KEY).has(JSONUtils.MP4_KEY)) { - //Gif video post (MP4) - int postType = Post.GIF_VIDEO_TYPE; - String videoUrl = Html.fromHtml(variations.getJSONObject(JSONUtils.VARIANTS_KEY).getJSONObject(JSONUtils.MP4_KEY).getJSONObject(JSONUtils.SOURCE_KEY).getString(JSONUtils.URL_KEY)).toString(); - String gifDownloadUrl = Html.fromHtml(variations.getJSONObject(JSONUtils.VARIANTS_KEY).getJSONObject(JSONUtils.GIF_KEY).getJSONObject(JSONUtils.SOURCE_KEY).getString(JSONUtils.URL_KEY)).toString(); - - post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, - formattedPostTime, title, previewUrl, permalink, score, postType, voteType, - gilded, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, - isCrosspost, false); - post.setPreviewWidth(previewWidth); - post.setPreviewHeight(previewHeight); - post.setVideoUrl(videoUrl); - post.setDownloadableGifOrVideo(true); - post.setGifOrVideoDownloadUrl(gifDownloadUrl); - } else if(data.getJSONObject(JSONUtils.PREVIEW_KEY).has(JSONUtils.REDDIT_VIDEO_PREVIEW_KEY)) { + if(data.getJSONObject(JSONUtils.PREVIEW_KEY).has(JSONUtils.REDDIT_VIDEO_PREVIEW_KEY)) { //Gif video post (HLS) int postType = Post.GIF_VIDEO_TYPE; String videoUrl = Html.fromHtml(data.getJSONObject(JSONUtils.PREVIEW_KEY) -- cgit v1.2.3