Add upload/download size restrictions for attachments based on remote config.

This commit is contained in:
Clark
2023-06-30 11:06:36 -04:00
committed by Greyson Parrelli
parent 87d4dba32b
commit f4a082584c
10 changed files with 90 additions and 45 deletions

View File

@@ -41,8 +41,8 @@ public final class VideoUtil {
}
public static int getMaxVideoRecordDurationInSeconds(@NonNull Context context, @NonNull MediaConstraints mediaConstraints) {
int allowedSize = mediaConstraints.getCompressedVideoMaxSize(context);
int duration = (int) Math.floor((float) allowedSize / TOTAL_BYTES_PER_SECOND);
long allowedSize = mediaConstraints.getCompressedVideoMaxSize(context);
int duration = (int) Math.floor((float) allowedSize / TOTAL_BYTES_PER_SECOND);
return Math.min(duration, VIDEO_MAX_RECORD_LENGTH_S);
}