diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java
index ba6521b91..03e061d1c 100644
--- a/app/src/main/java/org/schabi/newpipe/player/Player.java
+++ b/app/src/main/java/org/schabi/newpipe/player/Player.java
@@ -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) {
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index 9a1fcba7d..fd6cc7251 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -171,7 +171,8 @@
allow_heap_dumping_key
show_memory_leaks_key
allow_disposed_exceptions_key
- show_original_time_ago_text_key
+ show_original_time_ago_key
+ disable_media_tunneling_key
crash_the_app_key
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 247326b7a..5acb83e40 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -521,6 +521,8 @@
Force reporting of undeliverable Rx exceptions outside of fragment or activity lifecycle after disposal
Show original time ago on items
Original texts from services will be visible in stream items
+ Disable media tunneling
+ Disable media tunneling if you experience a black screen or stuttering on video playback
Crash the app
Import/export
diff --git a/app/src/main/res/xml/debug_settings.xml b/app/src/main/res/xml/debug_settings.xml
index 8dda516fe..d27d67aad 100644
--- a/app/src/main/res/xml/debug_settings.xml
+++ b/app/src/main/res/xml/debug_settings.xml
@@ -30,6 +30,13 @@
android:title="@string/show_original_time_ago_title"
app:iconSpaceReserved="false" />
+
+