diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-09-19 09:57:30 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-09-19 09:57:30 +0000 |
commit | 7866b1c92ef3abbe222095b7a95f8301cf5a6068 (patch) | |
tree | 2b653cbb6461f9c90746f3bb47b16f3bbb36182a /app/src/main/java | |
parent | 0b2e358584add4c70550dea654acfc79994c3490 (diff) | |
download | infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.tar infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.tar.gz infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.tar.bz2 infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.tar.lz infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.tar.xz infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.tar.zst infinity-for-reddit-7866b1c92ef3abbe222095b7a95f8301cf5a6068.zip |
Fixed frames dropping when playing videos (for real this time).
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java | 18 |
1 files changed, 1 insertions, 17 deletions
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) |