From a4a9957a155ddb2564b6381002a759acb7a1ce61 Mon Sep 17 00:00:00 2001 From: AudricV <74829229+AudricV@users.noreply.github.com> Date: Thu, 18 Aug 2022 18:35:22 +0200 Subject: [PATCH] Add ExoPlayerSettingsFragment and move playback load interval size setting into it This fragment has been added into SettingsResourceRegistry, to allow searches in its options. It has been placed at the place of the previous playback load interval size setting (so in Video and Audio settings). --- .../settings/ExoPlayerSettingsFragment.java | 14 ++++++++++++++ .../settings/SettingsResourceRegistry.java | 1 + app/src/main/res/values/settings_keys.xml | 2 ++ app/src/main/res/values/strings.xml | 4 ++++ app/src/main/res/xml/exoplayer_settings.xml | 16 ++++++++++++++++ app/src/main/res/xml/video_audio_settings.xml | 12 +++++------- 6 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/settings/ExoPlayerSettingsFragment.java create mode 100644 app/src/main/res/xml/exoplayer_settings.xml diff --git a/app/src/main/java/org/schabi/newpipe/settings/ExoPlayerSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ExoPlayerSettingsFragment.java new file mode 100644 index 000000000..7e740f869 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/ExoPlayerSettingsFragment.java @@ -0,0 +1,14 @@ +package org.schabi.newpipe.settings; + +import android.os.Bundle; + +import androidx.annotation.Nullable; + +public class ExoPlayerSettingsFragment extends BasePreferenceFragment { + + @Override + public void onCreatePreferences(@Nullable final Bundle savedInstanceState, + @Nullable final String rootKey) { + addPreferencesFromResourceRegistry(); + } +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java b/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java index 78ddb3786..b3d0741bb 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java @@ -40,6 +40,7 @@ public final class SettingsResourceRegistry { add(PlayerNotificationSettingsFragment.class, R.xml.player_notification_settings); add(UpdateSettingsFragment.class, R.xml.update_settings); add(VideoAudioSettingsFragment.class, R.xml.video_audio_settings); + add(ExoPlayerSettingsFragment.class, R.xml.exoplayer_settings); } private SettingRegistryEntry add( diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index 8f3e8e192..f00c25c8c 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -1366,4 +1366,6 @@ streams_notifications_channels player_notification_screen + + exoplayer_settings_key diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 43705056b..1dad7c01d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -773,4 +773,8 @@ Partially watched Upcoming Sort + ExoPlayer settings + Manage some ExoPlayer settings. These changes require a player restart to take effect + Use ExoPlayer\'s decoder fallback feature + Enable this option if you have decoder initialization issues, which falls back to lower-priority decoders if primary decoders initialization fail. This may result in poor playback performance than when using primary decoders \ No newline at end of file diff --git a/app/src/main/res/xml/exoplayer_settings.xml b/app/src/main/res/xml/exoplayer_settings.xml new file mode 100644 index 000000000..fd5637115 --- /dev/null +++ b/app/src/main/res/xml/exoplayer_settings.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/video_audio_settings.xml b/app/src/main/res/xml/video_audio_settings.xml index e4485f154..75a925c65 100644 --- a/app/src/main/res/xml/video_audio_settings.xml +++ b/app/src/main/res/xml/video_audio_settings.xml @@ -61,13 +61,11 @@ app:iconSpaceReserved="false" app:useSimpleSummaryProvider="true" /> -