Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ private enum FeatureFlag {
DEFAULT_PREF_VIDEO_PLAYBACK_CONTROLS("defaultPrefVideoPlaybackControls"),
DEFAULT_PREF_CUSTOM_TABS("defaultPrefCustomTabs"),
CROSSPOST_ORIGIN_MENU_ITEM("crosspostOriginMenuItem"),
MAIN_MENU_RANDOM_REMOVED("mainMenuRandomRemoved");
MAIN_MENU_RANDOM_REMOVED("mainMenuRandomRemoved"),
DEFAULT_PREF_VIDEO_LOOP("defaultPrefVideoLoop");

@NonNull private final String id;

Expand Down Expand Up @@ -349,6 +350,15 @@ public static void handleUpgrade(@NonNull final Context context) {
context.getString(R.string.pref_menus_mainmenu_shortcutitems_key),
existingShortcutPreferences).apply();
}

if(getAndSetFeatureFlag(prefs, FeatureFlag.DEFAULT_PREF_VIDEO_LOOP)
== FeatureFlagStatus.UPGRADE_NEEDED) {

prefs.edit().putBoolean(
context.getString(R.string.pref_behaviour_video_loop_key),
true)
.apply();
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,12 @@ public static boolean pref_behaviour_video_mute_default() {
true);
}

public static boolean pref_behaviour_video_loop() {
return getBoolean(
R.string.pref_behaviour_video_loop_key,
true);
}

public static boolean pref_behaviour_video_zoom_default() {
return getBoolean(R.string.pref_behaviour_video_zoom_default_key,
false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public ExoPlayerWrapperView(
mVideoPlayer.setMediaSource(mediaSource);
mVideoPlayer.prepare();

mVideoPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);
if(PrefsUtility.pref_behaviour_video_loop()) {
mVideoPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);
} else {
mVideoPlayer.setRepeatMode(Player.REPEAT_MODE_OFF);
}

mVideoPlayer.setPlayWhenReady(true);

Expand Down
5 changes: 5 additions & 0 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1921,4 +1921,9 @@
<!-- 2025-11-08 -->
<string name="login_reddit_error_title">Reddit login issue</string>
<string name="login_reddit_error_message">There was a problem logging into Reddit. Try again in an different browser?</string>

<!-- 2025-11-12 -->
<string name="pref_behaviour_video_loop_key" translatable="false">pref_behaviour_video_loop</string>
<string name="pref_behaviour_video_loop_title">Loop videos</string>

</resources>
4 changes: 4 additions & 0 deletions src/main/res/xml/prefs_images_video.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
android:key="@string/pref_behaviour_video_mute_default_key"
android:defaultValue="true"/>

<CheckBoxPreference android:title="@string/pref_behaviour_video_loop_title"
android:key="@string/pref_behaviour_video_loop_key"
android:defaultValue="true"/>

<CheckBoxPreference android:title="@string/pref_behaviour_video_zoom_default_title"
android:key="@string/pref_behaviour_video_zoom_default_key"
android:defaultValue="false"/>
Expand Down
Loading