[Android] Add an option for subs auto loading
Geoffrey Métais
git at videolan.org
Thu Jan 25 09:10:51 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 25 09:10:29 2018 +0100| [d989fa560fcf8aaed2f57ae45393bd2e4089e421] | committer: Geoffrey Métais
Add an option for subs auto loading
> https://code.videolan.org/videolan/vlc-android/commit/d989fa560fcf8aaed2f57ae45393bd2e4089e421
---
vlc-android/res/values/strings.xml | 1 +
vlc-android/res/xml/preferences_subtitles.xml | 4 ++++
vlc-android/src/org/videolan/vlc/util/VLCOptions.java | 7 +++----
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 4b1f1c5fd..b7893e9bb 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -338,6 +338,7 @@
<string name="subtitles_color_green">Green</string>
<string name="subtitles_background_title">Subtitles Background</string>
<string name="subtitles_bold_title">Bold subtitles</string>
+ <string name="subtitles_autoload_title">Auto load subtitles</string>
<string name="audio_prefs_category">Audio</string>
<string name="lockscreen_cover_title">Media cover on Lockscreen</string>
diff --git a/vlc-android/res/xml/preferences_subtitles.xml b/vlc-android/res/xml/preferences_subtitles.xml
index 222776180..ed31d6bdd 100644
--- a/vlc-android/res/xml/preferences_subtitles.xml
+++ b/vlc-android/res/xml/preferences_subtitles.xml
@@ -4,6 +4,10 @@
android:key="subtitles_category"
android:title="@string/subtitles_prefs_category">
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="subtitles_autoload"
+ android:title="@string/subtitles_autoload_title" />
<ListPreference
android:defaultValue="16"
android:entries="@array/subtitles_size_entries"
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index 3cb5e0d2f..c3d7650a9 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -197,10 +197,9 @@ public class VLCOptions {
}
} /* else automatic: use default options */
- if (noVideo)
- media.addOption(":no-video");
- if (paused)
- media.addOption(":start-paused");
+ if (noVideo) media.addOption(":no-video");
+ if (paused) media.addOption(":start-paused");
+ if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("subtitles_autoload", true)) media.addOption(":sub-language=none");
}
private static MediaPlayer.Equalizer getEqualizerSetFromSettings(SharedPreferences pref) {
More information about the Android
mailing list