Inline MP4 GIF flag.

This commit is contained in:
Greyson Parrelli
2021-09-10 12:40:30 -04:00
parent 520fe481e9
commit e2e0caa94a
4 changed files with 4 additions and 19 deletions

View File

@@ -21,10 +21,6 @@ public final class GiphyMp4PlaybackPolicy {
private GiphyMp4PlaybackPolicy() { }
public static boolean sendAsMp4() {
return FeatureFlags.mp4GifSendSupport();
}
public static boolean autoplay() {
return !DeviceProperties.isLowMemoryDevice(ApplicationDependencies.getApplication());
}

View File

@@ -51,19 +51,15 @@ final class GiphyMp4Repository {
@WorkerThread
private @NonNull Uri saveToBlobInternal(@NonNull GiphyImage giphyImage, boolean isForMms) throws IOException {
boolean sendAsMp4 = GiphyMp4PlaybackPolicy.sendAsMp4();
String url;
String mime;
if (sendAsMp4) {
url = giphyImage.getMp4Url();
mime = MediaUtil.VIDEO_MP4;
} else if (isForMms) {
if (isForMms) {
url = giphyImage.getGifMmsUrl();
mime = MediaUtil.IMAGE_GIF;
} else {
url = giphyImage.getGifUrl();
mime = MediaUtil.IMAGE_GIF;
url = giphyImage.getMp4Url();
mime = MediaUtil.VIDEO_MP4;
}
Request request = new Request.Builder().url(url).build();