Merge pull request #6288 from Redirion/debugtunnellingoff

Add debug option to disable media tunneling
This commit is contained in:
Tobi 2021-05-14 13:04:35 +02:00 committed by GitHub
commit 9fc6f19702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -495,7 +495,11 @@ public final class Player implements
simpleExoPlayer.addTextOutput(binding.subtitleView);
// enable media tunneling
if (DeviceUtils.shouldSupportMediaTunneling()) {
if (DEBUG && PreferenceManager.getDefaultSharedPreferences(context)
.getBoolean(context.getString(R.string.disable_media_tunneling_key), false)) {
Log.d(TAG, "[" + Util.DEVICE_DEBUG_INFO + "] "
+ "media tunneling disabled in debug preferences");
} else if (DeviceUtils.shouldSupportMediaTunneling()) {
trackSelector.setParameters(
trackSelector.buildUponParameters().setTunnelingEnabled(true));
} else if (DEBUG) {

View file

@ -171,7 +171,8 @@
<string name="allow_heap_dumping_key" translatable="false">allow_heap_dumping_key</string>
<string name="show_memory_leaks_key" translatable="false">show_memory_leaks_key</string>
<string name="allow_disposed_exceptions_key" translatable="false">allow_disposed_exceptions_key</string>
<string name="show_original_time_ago_key" translatable="false">show_original_time_ago_text_key</string>
<string name="show_original_time_ago_key" translatable="false">show_original_time_ago_key</string>
<string name="disable_media_tunneling_key" translatable="false">disable_media_tunneling_key</string>
<string name="crash_the_app_key" translatable="false">crash_the_app_key</string>
<!-- THEMES -->

View file

@ -521,6 +521,8 @@
<string name="enable_disposed_exceptions_summary">Force reporting of undeliverable Rx exceptions outside of fragment or activity lifecycle after disposal</string>
<string name="show_original_time_ago_title">Show original time ago on items</string>
<string name="show_original_time_ago_summary">Original texts from services will be visible in stream items</string>
<string name="disable_media_tunneling_title">Disable media tunneling</string>
<string name="disable_media_tunneling_summary">Disable media tunneling if you experience a black screen or stuttering on video playback</string>
<string name="crash_the_app">Crash the app</string>
<!-- Subscriptions import/export -->
<string name="import_export_title">Import/export</string>

View file

@ -30,6 +30,13 @@
android:title="@string/show_original_time_ago_title"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="@string/disable_media_tunneling_key"
android:summary="@string/disable_media_tunneling_summary"
android:title="@string/disable_media_tunneling_title"
app:iconSpaceReserved="false" />
<Preference
android:key="@string/crash_the_app_key"
android:title="@string/crash_the_app"