Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug option to disable media tunneling #6288

Merged
merged 3 commits into from
May 14, 2021
Merged
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
6 changes: 5 additions & 1 deletion app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ private void initPlayer(final boolean playOnReady) {
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) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/settings_keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/xml/debug_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down