Implement video auto-loop option

master
Alex Eyre 7 years ago
parent 977c5a1f27
commit c687243e41
  1. 2
      Clover/app/src/main/java/org/floens/chan/core/settings/ChanSettings.java
  2. 5
      Clover/app/src/main/java/org/floens/chan/ui/controller/MediaSettingsController.java
  3. 2
      Clover/app/src/main/java/org/floens/chan/ui/view/MultiImageView.java
  4. 3
      Clover/app/src/main/res/values/strings.xml

@ -131,6 +131,7 @@ public class ChanSettings {
public static final BooleanSetting controllerSwipeable;
public static final BooleanSetting saveBoardFolder;
public static final BooleanSetting videoDefaultMuted;
public static final BooleanSetting videoAutoLoop;
public static final BooleanSetting watchEnabled;
public static final BooleanSetting watchCountdown;
@ -207,6 +208,7 @@ public class ChanSettings {
controllerSwipeable = new BooleanSetting(p, "preference_controller_swipeable", true);
saveBoardFolder = new BooleanSetting(p, "preference_save_subboard", false);
videoDefaultMuted = new BooleanSetting(p, "preference_video_default_muted", true);
videoAutoLoop = new BooleanSetting(p, "preference_video_loop", true);
watchEnabled = new BooleanSetting(p, "preference_watch_enabled", false);
watchEnabled.addCallback((setting, value) ->

@ -127,6 +127,11 @@ public class MediaSettingsController extends SettingsController {
setupMediaLoadTypesSetting(loading);
loading.add(new BooleanSettingView(this,
ChanSettings.videoAutoLoop,
R.string.setting_video_auto_loop,
R.string.setting_video_auto_loop_description));
groups.add(loading);
}
}

@ -406,7 +406,7 @@ public class MultiImageView extends FrameLayout implements View.OnClickListener
videoView.setOnPreparedListener(mp -> {
mediaPlayer = mp;
mp.setLooping(true);
mp.setLooping(ChanSettings.videoAutoLoop.get());
mp.setVolume(0f, 0f);
onModeLoaded(Mode.MOVIE, videoView);
callback.onVideoLoaded(this, hasMediaPlayerAudioTracks(mp));

@ -523,6 +523,9 @@ If disabled, save the image with the filename the uploader assigned."
<string name="setting_video_auto_load">Automatically load videos</string>
<string name="setting_video_auto_loop">Enable automatic video-looping</string>
<string name="setting_video_auto_loop_description">Automatically loop video content</string>
<!-- Save location settings -->
<string name="save_location_screen">Save location</string>

Loading…
Cancel
Save