aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java26
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/FetchStreamableVideo.java26
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java79
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java170
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java17
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java14
7 files changed, 224 insertions, 116 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
index 16e27ff5..e97b0ff4 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
@@ -15,18 +15,12 @@ import retrofit2.Response;
import retrofit2.Retrofit;
public class FetchGfycatOrRedgifsVideoLinks {
- private FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener;
- Call<String> gfycatCall;
public interface FetchGfycatOrRedgifsVideoLinksListener {
void success(String webm, String mp4);
void failed(int errorCode);
}
- public FetchGfycatOrRedgifsVideoLinks(FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) {
- this.fetchGfycatOrRedgifsVideoLinksListener = fetchGfycatOrRedgifsVideoLinksListener;
- }
-
public static void fetchGfycatOrRedgifsVideoLinks(Executor executor, Handler handler, Retrofit gfycatRetrofit,
String gfycatId,
FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) {
@@ -46,20 +40,20 @@ public class FetchGfycatOrRedgifsVideoLinks {
}
- public void fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(Executor executor, Handler handler,
- Retrofit gfycatRetrofit, Retrofit redgifsRetrofit,
- String gfycatId, boolean isGfycatVideo,
- boolean automaticallyTryRedgifs) {
+ public static void fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(Executor executor, Handler handler,
+ Call<String> gfycatCall,
+ String gfycatId, boolean isGfycatVideo,
+ boolean automaticallyTryRedgifs,
+ FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) {
executor.execute(() -> {
- gfycatCall = (isGfycatVideo ? gfycatRetrofit : redgifsRetrofit).create(GfycatAPI.class).getGfycatData(gfycatId);
try {
Response<String> response = gfycatCall.execute();
if (response.isSuccessful()) {
parseGfycatVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener);
} else {
if (response.code() == 404 && isGfycatVideo && automaticallyTryRedgifs) {
- fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(executor, handler, gfycatRetrofit,
- redgifsRetrofit, gfycatId, false, false);
+ fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(executor, handler, gfycatCall.clone(),
+ gfycatId, false, false, fetchGfycatOrRedgifsVideoLinksListener);
} else {
handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code()));
}
@@ -71,12 +65,6 @@ public class FetchGfycatOrRedgifsVideoLinks {
});
}
- public void cancel() {
- if (gfycatCall != null && !gfycatCall.isCanceled()) {
- gfycatCall.cancel();
- }
- }
-
private static void parseGfycatVideoLinks(Handler handler, String response,
FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) {
try {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchStreamableVideo.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchStreamableVideo.java
index ac7c2116..c310539a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchStreamableVideo.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchStreamableVideo.java
@@ -12,6 +12,7 @@ import java.util.concurrent.Executor;
import ml.docilealligator.infinityforreddit.apis.StreamableAPI;
import ml.docilealligator.infinityforreddit.utils.JSONUtils;
+import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
@@ -42,6 +43,31 @@ public class FetchStreamableVideo {
});
}
+ public static void fetchStreamableVideoInRecyclerViewAdapter(Executor executor, Handler handler, Call<String> streamableCall,
+ FetchStreamableVideoListener fetchStreamableVideoListener) {
+ executor.execute(() -> {
+ try {
+ Response<String> response = streamableCall.execute();
+ if (response.isSuccessful()) {
+ JSONObject jsonObject = new JSONObject(response.body());
+ String title = jsonObject.getString(JSONUtils.TITLE_KEY);
+ JSONObject filesObject = jsonObject.getJSONObject(JSONUtils.FILES_KEY);
+ StreamableVideo.Media mp4 = parseMedia(filesObject.getJSONObject(JSONUtils.MP4_KEY));
+ StreamableVideo.Media mp4Mobile = parseMedia(filesObject.getJSONObject(JSONUtils.MP4_MOBILE_KEY));
+ if (mp4 == null && mp4Mobile == null) {
+ handler.post(fetchStreamableVideoListener::failed);
+ return;
+ }
+ handler.post(() -> fetchStreamableVideoListener.success(new StreamableVideo(title, mp4, mp4Mobile)));
+ } else {
+ handler.post(fetchStreamableVideoListener::failed);
+ }
+ } catch (IOException | JSONException e) {
+ e.printStackTrace();
+ }
+ });
+ }
+
@Nullable
private static StreamableVideo.Media parseMedia(JSONObject jsonObject) {
try {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
index 4157db56..644c5ddc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
@@ -80,10 +80,12 @@ import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks;
+import ml.docilealligator.infinityforreddit.FetchStreamableVideo;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy;
import ml.docilealligator.infinityforreddit.SaveThing;
+import ml.docilealligator.infinityforreddit.StreamableVideo;
import ml.docilealligator.infinityforreddit.VoteThing;
import ml.docilealligator.infinityforreddit.activities.CommentActivity;
import ml.docilealligator.infinityforreddit.activities.FilteredPostsActivity;
@@ -94,6 +96,8 @@ import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity
import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity;
+import ml.docilealligator.infinityforreddit.apis.GfycatAPI;
+import ml.docilealligator.infinityforreddit.apis.StreamableAPI;
import ml.docilealligator.infinityforreddit.asynctasks.LoadSubredditIcon;
import ml.docilealligator.infinityforreddit.asynctasks.LoadUserData;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.CopyTextBottomSheetFragment;
@@ -112,6 +116,7 @@ import ml.docilealligator.infinityforreddit.utils.APIUtils;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.utils.Utils;
import pl.droidsonroids.gif.GifImageView;
+import retrofit2.Call;
import retrofit2.Retrofit;
public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements CacheManager {
@@ -130,6 +135,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
private Retrofit mOauthRetrofit;
private Retrofit mGfycatRetrofit;
private Retrofit mRedgifsRetrofit;
+ private Retrofit mStreamableRetrofit;
private RedditDataRoomDatabase mRedditDataRoomDatabase;
private RequestManager mGlide;
private Markwon mPostDetailMarkwon;
@@ -202,8 +208,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
public PostDetailRecyclerViewAdapter(AppCompatActivity activity, ViewPostDetailFragment fragment,
Executor executor, CustomThemeWrapper customThemeWrapper,
Retrofit retrofit, Retrofit oauthRetrofit, Retrofit gfycatRetrofit,
- Retrofit redgifsRetrofit, RedditDataRoomDatabase redditDataRoomDatabase,
- RequestManager glide,
+ Retrofit redgifsRetrofit, Retrofit streamableRetrofit,
+ RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide,
boolean separatePostAndComments, String accessToken,
String accountName, Post post, Locale locale,
SharedPreferences sharedPreferences,
@@ -218,6 +224,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
mOauthRetrofit = oauthRetrofit;
mGfycatRetrofit = gfycatRetrofit;
mRedgifsRetrofit = redgifsRetrofit;
+ mStreamableRetrofit = streamableRetrofit;
mRedditDataRoomDatabase = redditDataRoomDatabase;
mGlide = glide;
mSecondaryTextColor = customThemeWrapper.getSecondaryTextColor();
@@ -633,25 +640,46 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
}
((PostDetailVideoAutoplayViewHolder) holder).setVolume(mMuteAutoplayingVideos || (mPost.isNSFW() && mMuteNSFWVideo) ? 0f : 1f);
- if (mPost.isGfycat() || mPost.isRedgifs() && !mPost.isLoadGfycatOrRedgifsVideoSuccess()) {
- ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks = new FetchGfycatOrRedgifsVideoLinks(new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
- @Override
- public void success(String webm, String mp4) {
- mPost.setVideoDownloadUrl(mp4);
- mPost.setVideoUrl(webm);
- mPost.setLoadGfyOrRedgifsVideoSuccess(true);
- ((PostDetailVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl()));
- }
+ if (mPost.isGfycat() || mPost.isRedgifs() && !mPost.isLoadGfycatOrStreamableVideoSuccess()) {
+ ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
+ (mPost.isGfycat() ? mGfycatRetrofit : mRedgifsRetrofit).create(GfycatAPI.class).getGfycatData(mPost.getGfycatId());
+ FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
+ ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, mPost.getGfycatId(),
+ mPost.isGfycat(), mAutomaticallyTryRedgifs,
+ new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
+ @Override
+ public void success(String webm, String mp4) {
+ mPost.setVideoDownloadUrl(mp4);
+ mPost.setVideoUrl(mp4);
+ mPost.setLoadGfyOrStreamableVideoSuccess(true);
+ ((PostDetailVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl()));
+ }
- @Override
- public void failed(int errorCode) {
- ((PostDetailVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE);
- }
- });
- ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks
- .fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
- mGfycatRetrofit, mRedgifsRetrofit, mPost.getGfycatId(),
- mPost.isGfycat(), mAutomaticallyTryRedgifs);
+ @Override
+ public void failed(int errorCode) {
+ ((PostDetailVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE);
+ }
+ });
+ } else if(mPost.isStreamable() && !mPost.isLoadGfycatOrStreamableVideoSuccess()) {
+ ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
+ mStreamableRetrofit.create(StreamableAPI.class).getStreamableData(mPost.getStreamableShortCode());
+ FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
+ ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
+ new FetchStreamableVideo.FetchStreamableVideoListener() {
+ @Override
+ public void success(StreamableVideo streamableVideo) {
+ StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
+ mPost.setVideoDownloadUrl(media.url);
+ mPost.setVideoUrl(media.url);
+ mPost.setLoadGfyOrStreamableVideoSuccess(true);
+ ((PostDetailVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl()));
+ }
+
+ @Override
+ public void failed() {
+ ((PostDetailVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE);
+ }
+ });
} else {
((PostDetailVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl()));
}
@@ -1014,8 +1042,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
((PostDetailBaseViewHolder) holder).mNSFWTextView.setVisibility(View.GONE);
if (holder instanceof PostDetailVideoAutoplayViewHolder) {
- if (((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks != null) {
- ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks.cancel();
+ if (((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
+ ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
+ ((PostDetailVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
}
((PostDetailVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.GONE);
((PostDetailVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
@@ -1504,7 +1533,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
}
class PostDetailVideoAutoplayViewHolder extends PostDetailBaseViewHolder implements ToroPlayer {
- public FetchGfycatOrRedgifsVideoLinks fetchGfycatOrRedgifsVideoLinks;
+ public Call<String> fetchGfycatOrStreamableVideoCall;
@BindView(R.id.icon_gif_image_view_item_post_detail_video_autoplay)
AspectRatioGifImageView mIconGifImageView;
@BindView(R.id.subreddit_text_view_item_post_detail_video_autoplay)
@@ -1613,14 +1642,14 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
if (mPost.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
- if (mPost.isLoadGfycatOrRedgifsVideoSuccess()) {
+ if (mPost.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(mPost.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
}
} else if (mPost.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
- if (mPost.isLoadGfycatOrRedgifsVideoSuccess()) {
+ if (mPost.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(mPost.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
index 92547c66..852f8c93 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -68,10 +68,12 @@ import im.ene.toro.widget.Container;
import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks;
+import ml.docilealligator.infinityforreddit.FetchStreamableVideo;
import ml.docilealligator.infinityforreddit.MarkPostAsReadInterface;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy;
import ml.docilealligator.infinityforreddit.SaveThing;
+import ml.docilealligator.infinityforreddit.StreamableVideo;
import ml.docilealligator.infinityforreddit.VoteThing;
import ml.docilealligator.infinityforreddit.activities.FilteredPostsActivity;
import ml.docilealligator.infinityforreddit.activities.LinkResolverActivity;
@@ -81,6 +83,8 @@ import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity
import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity;
+import ml.docilealligator.infinityforreddit.apis.GfycatAPI;
+import ml.docilealligator.infinityforreddit.apis.StreamableAPI;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.ShareLinkBottomSheetFragment;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView;
@@ -92,6 +96,7 @@ import ml.docilealligator.infinityforreddit.utils.APIUtils;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.utils.Utils;
import pl.droidsonroids.gif.GifImageView;
+import retrofit2.Call;
import retrofit2.Retrofit;
/**
@@ -127,6 +132,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
private Retrofit mOauthRetrofit;
private Retrofit mGfycatRetrofit;
private Retrofit mRedgifsRetrofit;
+ private Retrofit mStreamableRetrofit;
private String mAccessToken;
private RequestManager mGlide;
private Locale mLocale;
@@ -205,7 +211,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
private Callback mCallback;
public PostRecyclerViewAdapter(AppCompatActivity activity, PostFragment fragment, Executor executor, Retrofit oauthRetrofit,
- Retrofit gfycatRetrofit, Retrofit redgifsRetrofit,
+ Retrofit gfycatRetrofit, Retrofit redgifsRetrofit, Retrofit streambleRetrofit,
CustomThemeWrapper customThemeWrapper, Locale locale,
String accessToken, String accountName, int postType, int postLayout, boolean displaySubredditName,
SharedPreferences sharedPreferences, SharedPreferences nsfwAndSpoilerSharedPreferences,
@@ -220,6 +226,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
mOauthRetrofit = oauthRetrofit;
mGfycatRetrofit = gfycatRetrofit;
mRedgifsRetrofit = redgifsRetrofit;
+ mStreamableRetrofit = streambleRetrofit;
mAccessToken = accessToken;
mPostType = postType;
mDisplaySubredditName = displaySubredditName;
@@ -685,29 +692,54 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostVideoAutoplayViewHolder) holder).setVolume(mFragment.getMasterMutingOption() ? 0f : 1f);
}
- if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrRedgifsVideoSuccess()) {
- ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks = new FetchGfycatOrRedgifsVideoLinks(new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
- @Override
- public void success(String webm, String mp4) {
- post.setVideoDownloadUrl(mp4);
- post.setVideoUrl(webm);
- post.setLoadGfyOrRedgifsVideoSuccess(true);
- if (position == holder.getBindingAdapterPosition()) {
- ((PostVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
- }
- }
+ if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) {
+ ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
+ (post.isGfycat() ? mGfycatRetrofit : mRedgifsRetrofit).create(GfycatAPI.class).getGfycatData(post.getGfycatId());
+ FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
+ ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, post.getGfycatId(),
+ post.isGfycat(), mAutomaticallyTryRedgifs,
+ new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
+ @Override
+ public void success(String webm, String mp4) {
+ post.setVideoDownloadUrl(mp4);
+ post.setVideoUrl(mp4);
+ post.setLoadGfyOrStreamableVideoSuccess(true);
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
+ }
+ }
- @Override
- public void failed(int errorCode) {
- if (position == holder.getBindingAdapterPosition()) {
- ((PostVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
- }
- }
- });
- ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks
- .fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
- mGfycatRetrofit, mRedgifsRetrofit, post.getGfycatId(),
- post.isGfycat(), mAutomaticallyTryRedgifs);
+ @Override
+ public void failed(int errorCode) {
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
+ }
+ }
+ });
+ } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) {
+ ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
+ mStreamableRetrofit.create(StreamableAPI.class).getStreamableData(post.getStreamableShortCode());
+ FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
+ ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
+ new FetchStreamableVideo.FetchStreamableVideoListener() {
+ @Override
+ public void success(StreamableVideo streamableVideo) {
+ StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
+ post.setVideoDownloadUrl(media.url);
+ post.setVideoUrl(media.url);
+ post.setLoadGfyOrStreamableVideoSuccess(true);
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
+ }
+ }
+
+ @Override
+ public void failed() {
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
+ }
+ }
+ });
} else {
((PostVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@@ -812,29 +844,54 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostCard2VideoAutoplayViewHolder) holder).setVolume(mFragment.getMasterMutingOption() ? 0f : 1f);
}
- if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrRedgifsVideoSuccess()) {
- ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks = new FetchGfycatOrRedgifsVideoLinks(new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
- @Override
- public void success(String webm, String mp4) {
- post.setVideoDownloadUrl(mp4);
- post.setVideoUrl(webm);
- post.setLoadGfyOrRedgifsVideoSuccess(true);
- if (position == holder.getBindingAdapterPosition()) {
- ((PostCard2VideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
- }
- }
+ if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
+ (post.isGfycat() ? mGfycatRetrofit : mRedgifsRetrofit).create(GfycatAPI.class).getGfycatData(post.getGfycatId());
+ FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
+ ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall, post.getGfycatId(),
+ post.isGfycat(), mAutomaticallyTryRedgifs,
+ new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
+ @Override
+ public void success(String webm, String mp4) {
+ post.setVideoDownloadUrl(mp4);
+ post.setVideoUrl(mp4);
+ post.setLoadGfyOrStreamableVideoSuccess(true);
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
+ }
+ }
- @Override
- public void failed(int errorCode) {
- if (position == holder.getBindingAdapterPosition()) {
- ((PostCard2VideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
- }
- }
- });
- ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks
- .fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
- mGfycatRetrofit, mRedgifsRetrofit, post.getGfycatId(), post.isGfycat(),
- mAutomaticallyTryRedgifs);
+ @Override
+ public void failed(int errorCode) {
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
+ }
+ }
+ });
+ } else if(post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
+ mStreamableRetrofit.create(StreamableAPI.class).getStreamableData(post.getStreamableShortCode());
+ FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
+ ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
+ new FetchStreamableVideo.FetchStreamableVideoListener() {
+ @Override
+ public void success(StreamableVideo streamableVideo) {
+ StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
+ post.setVideoDownloadUrl(media.url);
+ post.setVideoUrl(media.url);
+ post.setLoadGfyOrStreamableVideoSuccess(true);
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
+ }
+ }
+
+ @Override
+ public void failed() {
+ if (position == holder.getBindingAdapterPosition()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
+ }
+ }
+ });
} else {
((PostCard2VideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@@ -1693,8 +1750,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor);
if (holder instanceof PostVideoAutoplayViewHolder) {
((PostVideoAutoplayViewHolder) holder).mediaUri = null;
- if (((PostVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks != null) {
- ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks.cancel();
+ if (((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
+ ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
+ ((PostVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
}
((PostVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE);
((PostVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
@@ -1715,8 +1773,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostTextTypeViewHolder) holder).contentTextView.setVisibility(View.GONE);
} else if (holder instanceof PostCard2VideoAutoplayViewHolder) {
((PostCard2VideoAutoplayViewHolder) holder).mediaUri = null;
- if (((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks != null) {
- ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrRedgifsVideoLinks.cancel();
+ if (((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
+ ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
+ ((PostCard2VideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
}
((PostCard2VideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE);
((PostCard2VideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
@@ -2558,7 +2617,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
ExoPlayerViewHelper helper;
private Uri mediaUri;
private float volume;
- public FetchGfycatOrRedgifsVideoLinks fetchGfycatOrRedgifsVideoLinks;
+ public Call<String> fetchGfycatOrStreamableVideoCall;
+ //public FetchGfycatOrRedgifsVideoLinks fetchGfycatOrRedgifsVideoLinks;
PostVideoAutoplayViewHolder(View itemView) {
super(itemView);
@@ -2616,14 +2676,14 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (post.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
- if (post.isLoadGfycatOrRedgifsVideoSuccess()) {
+ if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
} else if (post.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
- if (post.isLoadGfycatOrRedgifsVideoSuccess()) {
+ if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
@@ -3839,7 +3899,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
ExoPlayerViewHelper helper;
private Uri mediaUri;
private float volume;
- public FetchGfycatOrRedgifsVideoLinks fetchGfycatOrRedgifsVideoLinks;
+ public Call<String> fetchGfycatOrStreamableVideoCall;
PostCard2VideoAutoplayViewHolder(View itemView) {
super(itemView);
@@ -3900,14 +3960,14 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (post.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
- if (post.isLoadGfycatOrRedgifsVideoSuccess()) {
+ if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
} else if (post.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
- if (post.isLoadGfycatOrRedgifsVideoSuccess()) {
+ if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
index b60a86db..1b83d8a8 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
@@ -183,6 +183,9 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
@Named("redgifs")
Retrofit mRedgifsRetrofit;
@Inject
+ @Named("streamable")
+ Retrofit mStreamableRetrofit;
+ @Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
@Named("default")
@@ -446,7 +449,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_SEARCH_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
@@ -523,7 +526,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
}
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, displaySubredditName,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
@@ -594,7 +597,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
}
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
@@ -659,7 +662,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_USER_POST_BASE + username, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
@@ -720,7 +723,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
@@ -780,7 +783,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
@@ -834,7 +837,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mCustomThemeWrapper, locale,
+ mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
mExoCreator, new PostRecyclerViewAdapter.Callback() {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
index 0a2ec296..eb94b01e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
@@ -66,7 +66,6 @@ import butterknife.ButterKnife;
import im.ene.toro.exoplayer.ExoCreator;
import im.ene.toro.media.PlaybackInfo;
import im.ene.toro.media.VolumeInfo;
-import im.ene.toro.widget.Container;
import ml.docilealligator.infinityforreddit.DeleteThing;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
@@ -154,6 +153,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
@Named("redgifs")
Retrofit mRedgifsRetrofit;
@Inject
+ @Named("streamable")
+ Retrofit mStreamableRetrofit;
+ @Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
@Named("default")
@@ -544,7 +546,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
mPostAdapter = new PostDetailRecyclerViewAdapter(activity,
this, mExecutor, mCustomThemeWrapper, mRetrofit, mOauthRetrofit, mGfycatRetrofit,
- mRedgifsRetrofit, mRedditDataRoomDatabase, mGlide,
+ mRedgifsRetrofit, mStreamableRetrofit, mRedditDataRoomDatabase, mGlide,
mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale,
mSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences,
mExoCreator, post -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition)));
@@ -1190,7 +1192,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
mPostAdapter = new PostDetailRecyclerViewAdapter(activity,
ViewPostDetailFragment.this, mExecutor, mCustomThemeWrapper,
mRetrofit, mOauthRetrofit, mGfycatRetrofit, mRedgifsRetrofit,
- mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments,
+ mStreamableRetrofit, mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments,
mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences,
mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences,
mExoCreator,
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java
index 69c93030..c20df496 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java
@@ -55,7 +55,7 @@ public class Post implements Parcelable {
private boolean isGfycat;
private boolean isRedgifs;
private boolean isStreamable;
- private boolean loadGfyOrRedgifsVideoSuccess;
+ private boolean loadGfyOrStreamableVideoSuccess;
private String permalink;
private String flair;
private String awards;
@@ -178,7 +178,7 @@ public class Post implements Parcelable {
isGfycat = in.readByte() != 0;
isRedgifs = in.readByte() != 0;
isStreamable = in.readByte() != 0;
- loadGfyOrRedgifsVideoSuccess = in.readByte() != 0;
+ loadGfyOrStreamableVideoSuccess = in.readByte() != 0;
permalink = in.readString();
flair = in.readString();
awards = in.readString();
@@ -357,12 +357,12 @@ public class Post implements Parcelable {
this.isStreamable = isStreamable;
}
- public boolean isLoadGfycatOrRedgifsVideoSuccess() {
- return loadGfyOrRedgifsVideoSuccess;
+ public boolean isLoadGfycatOrStreamableVideoSuccess() {
+ return loadGfyOrStreamableVideoSuccess;
}
- public void setLoadGfyOrRedgifsVideoSuccess(boolean loadGfyOrRedgifsVideoSuccess) {
- this.loadGfyOrRedgifsVideoSuccess = loadGfyOrRedgifsVideoSuccess;
+ public void setLoadGfyOrStreamableVideoSuccess(boolean loadGfyOrStreamableVideoSuccess) {
+ this.loadGfyOrStreamableVideoSuccess = loadGfyOrStreamableVideoSuccess;
}
public String getPermalink() {
@@ -556,7 +556,7 @@ public class Post implements Parcelable {
parcel.writeByte((byte) (isGfycat ? 1 : 0));
parcel.writeByte((byte) (isRedgifs ? 1 : 0));
parcel.writeByte((byte) (isStreamable ? 1 : 0));
- parcel.writeByte((byte) (loadGfyOrRedgifsVideoSuccess ? 1 : 0));
+ parcel.writeByte((byte) (loadGfyOrStreamableVideoSuccess ? 1 : 0));
parcel.writeString(permalink);
parcel.writeString(flair);
parcel.writeString(awards);