Streamable Video.

This commit is contained in:
Nicholas
2023-08-29 16:52:17 -04:00
committed by Nicholas Tinsley
parent 099c94c215
commit 64babe2e42
23 changed files with 290 additions and 125 deletions

View File

@@ -113,6 +113,7 @@ public final class FeatureFlags {
private static final String PROMPT_FOR_NOTIFICATION_CONFIG = "android.logs.promptNotificationsConfig";
public static final String PROMPT_BATTERY_SAVER = "android.promptBatterySaver";
public static final String USERNAMES = "android.usernames";
public static final String INSTANT_VIDEO_PLAYBACK = "android.instantVideoPlayback";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -177,7 +178,8 @@ public final class FeatureFlags {
PROMPT_FOR_NOTIFICATION_LOGS,
PROMPT_FOR_NOTIFICATION_CONFIG,
PROMPT_BATTERY_SAVER,
USERNAMES
USERNAMES,
INSTANT_VIDEO_PLAYBACK
);
@VisibleForTesting
@@ -629,6 +631,14 @@ public final class FeatureFlags {
}
}
/**
* Allow the video players to read from the temporary download files for attachments.
* @return whether this functionality is enabled.
*/
public static boolean instantVideoPlayback() {
return getBoolean(INSTANT_VIDEO_PLAYBACK, false);
}
public static String promptForDelayedNotificationLogs() {
return getString(PROMPT_FOR_NOTIFICATION_LOGS, "*");
}
@@ -641,6 +651,7 @@ public final class FeatureFlags {
return getString(PROMPT_BATTERY_SAVER, "*");
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);

View File

@@ -446,7 +446,7 @@ public class MediaUtil {
{
try {
AttachmentId attachmentId = PartAuthority.requireAttachmentId(uri);
MediaDataSource source = SignalDatabase.attachments().mediaDataSourceFor(attachmentId);
MediaDataSource source = SignalDatabase.attachments().mediaDataSourceFor(attachmentId, false);
return extractFrame(source, timeUs);
} catch (IOException e) {
Log.w(TAG, "Failed to extract frame for URI: " + uri, e);