parent
4d6bb95aa4
commit
91645e6adc
4 changed files with 19 additions and 4 deletions
|
@ -23,6 +23,10 @@ public final class GiphyMp4PlaybackPolicy {
|
|||
|
||||
private GiphyMp4PlaybackPolicy() { }
|
||||
|
||||
public static boolean sendAsMp4() {
|
||||
return FeatureFlags.mp4GifSendSupport();
|
||||
}
|
||||
|
||||
public static boolean autoplay() {
|
||||
return !DeviceProperties.isLowMemoryDevice(ApplicationDependencies.getApplication());
|
||||
}
|
||||
|
|
|
@ -51,15 +51,19 @@ final class GiphyMp4Repository {
|
|||
|
||||
@WorkerThread
|
||||
private @NonNull Uri saveToBlobInternal(@NonNull GiphyImage giphyImage, boolean isForMms) throws IOException {
|
||||
boolean sendAsMp4 = GiphyMp4PlaybackPolicy.sendAsMp4();
|
||||
String url;
|
||||
String mime;
|
||||
|
||||
if (isForMms) {
|
||||
if (sendAsMp4) {
|
||||
url = giphyImage.getMp4Url();
|
||||
mime = MediaUtil.VIDEO_MP4;
|
||||
} else if (isForMms) {
|
||||
url = giphyImage.getGifMmsUrl();
|
||||
mime = MediaUtil.IMAGE_GIF;
|
||||
} else {
|
||||
url = giphyImage.getMp4Url();
|
||||
mime = MediaUtil.VIDEO_MP4;
|
||||
url = giphyImage.getGifUrl();
|
||||
mime = MediaUtil.IMAGE_GIF;
|
||||
}
|
||||
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class GifSlide extends ImageSlide {
|
|||
null,
|
||||
false,
|
||||
borderless,
|
||||
true,
|
||||
FeatureFlags.mp4GifSendSupport(),
|
||||
false));
|
||||
|
||||
this.borderless = borderless;
|
||||
|
|
|
@ -74,6 +74,7 @@ public final class FeatureFlags {
|
|||
private static final String ANIMATED_STICKER_MIN_TOTAL_MEMORY = "android.animatedStickerMinTotalMemory";
|
||||
private static final String MESSAGE_PROCESSOR_ALARM_INTERVAL = "android.messageProcessor.alarmIntervalMins";
|
||||
private static final String MESSAGE_PROCESSOR_DELAY = "android.messageProcessor.foregroundDelayMs";
|
||||
private static final String MP4_GIF_SEND_SUPPORT = "android.mp4GifSendSupport.2";
|
||||
private static final String MEDIA_QUALITY_LEVELS = "android.mediaQuality.levels";
|
||||
private static final String RETRY_RECEIPT_LIFESPAN = "android.retryReceiptLifespan";
|
||||
private static final String RETRY_RESPOND_MAX_AGE = "android.retryRespondMaxAge";
|
||||
|
@ -111,6 +112,7 @@ public final class FeatureFlags {
|
|||
ANIMATED_STICKER_MIN_TOTAL_MEMORY,
|
||||
MESSAGE_PROCESSOR_ALARM_INTERVAL,
|
||||
MESSAGE_PROCESSOR_DELAY,
|
||||
MP4_GIF_SEND_SUPPORT,
|
||||
MEDIA_QUALITY_LEVELS,
|
||||
RETRY_RECEIPT_LIFESPAN,
|
||||
RETRY_RESPOND_MAX_AGE,
|
||||
|
@ -162,6 +164,7 @@ public final class FeatureFlags {
|
|||
ANIMATED_STICKER_MIN_TOTAL_MEMORY,
|
||||
MESSAGE_PROCESSOR_ALARM_INTERVAL,
|
||||
MESSAGE_PROCESSOR_DELAY,
|
||||
MP4_GIF_SEND_SUPPORT,
|
||||
MEDIA_QUALITY_LEVELS,
|
||||
RETRY_RECEIPT_LIFESPAN,
|
||||
RETRY_RESPOND_MAX_AGE,
|
||||
|
@ -348,6 +351,10 @@ public final class FeatureFlags {
|
|||
return getInteger(ANIMATED_STICKER_MIN_TOTAL_MEMORY, (int) ByteUnit.GIGABYTES.toMegabytes(3));
|
||||
}
|
||||
|
||||
public static boolean mp4GifSendSupport() {
|
||||
return getBoolean(MP4_GIF_SEND_SUPPORT, false);
|
||||
}
|
||||
|
||||
public static @NonNull String getMediaQualityLevels() {
|
||||
return getString(MEDIA_QUALITY_LEVELS, "");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue