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 cc75a2c22..5dc9382e7 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -77,7 +77,6 @@ import com.google.android.exoplayer2.text.CueGroup; import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; import com.google.android.exoplayer2.trackselection.MappingTrackSelector; import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter; -import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.video.VideoSize; import com.squareup.picasso.Picasso; import com.squareup.picasso.Target; @@ -115,7 +114,6 @@ import org.schabi.newpipe.player.ui.PlayerUiList; import org.schabi.newpipe.player.ui.PopupPlayerUi; import org.schabi.newpipe.player.ui.VideoPlayerUi; import org.schabi.newpipe.util.DependentPreferenceHelper; -import org.schabi.newpipe.util.DeviceUtils; import org.schabi.newpipe.util.ListHelper; import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.PicassoHelper; @@ -522,16 +520,11 @@ public final class Player implements PlaybackListener, Listener { // Setup UIs UIs.call(PlayerUi::initPlayer); - // enable media tunneling - if (DEBUG && PreferenceManager.getDefaultSharedPreferences(context) + // Disable media tunneling if requested by the user from ExoPlayer settings + if (!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) { - Log.d(TAG, "[" + Util.DEVICE_DEBUG_INFO + "] does not support media tunneling"); } } //endregion diff --git a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java index 4b08cfcb5..f656c6144 100644 --- a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java @@ -36,22 +36,6 @@ public final class DeviceUtils { private static Boolean isTV = null; private static Boolean isFireTV = null; - /* - * Devices that do not support media tunneling - */ - // Formuler Z8 Pro, Z8, CC, Z Alpha, Z+ Neo - private static final boolean HI3798MV200 = Build.VERSION.SDK_INT == 24 - && Build.DEVICE.equals("Hi3798MV200"); - // Zephir TS43UHD-2 - private static final boolean CVT_MT5886_EU_1G = Build.VERSION.SDK_INT == 24 - && Build.DEVICE.equals("cvt_mt5886_eu_1g"); - // Hilife TV - private static final boolean REALTEKATV = Build.VERSION.SDK_INT == 25 - && Build.DEVICE.equals("RealtekATV"); - // Philips QM16XE - private static final boolean QM16XE_U = Build.VERSION.SDK_INT == 23 - && Build.DEVICE.equals("QM16XE_U"); - private DeviceUtils() { } @@ -211,18 +195,6 @@ public final class DeviceUtils { context.getResources().getDisplayMetrics()); } - /** - * Some devices have broken tunneled video playback but claim to support it. - * See https://github.com/TeamNewPipe/NewPipe/issues/5911 - * @return false if affected device - */ - public static boolean shouldSupportMediaTunneling() { - return !HI3798MV200 - && !CVT_MT5886_EU_1G - && !REALTEKATV - && !QM16XE_U; - } - public static boolean isLandscape(final Context context) { return context.getResources().getDisplayMetrics().heightPixels < context.getResources() .getDisplayMetrics().widthPixels; diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index 7d8c48bda..8ff617172 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -227,7 +227,6 @@ show_memory_leaks_key allow_disposed_exceptions_key show_original_time_ago_key - disable_media_tunneling_key show_image_indicators_key show_crash_the_player_key check_new_streams @@ -1369,5 +1368,6 @@ exoplayer_settings_key + disable_media_tunneling_key use_exoplayer_decoder_fallback_key diff --git a/app/src/main/res/xml/debug_settings.xml b/app/src/main/res/xml/debug_settings.xml index 7405e47ac..84bb281f3 100644 --- a/app/src/main/res/xml/debug_settings.xml +++ b/app/src/main/res/xml/debug_settings.xml @@ -34,14 +34,6 @@ app:singleLineTitle="false" app:iconSpaceReserved="false" /> - - + + \ No newline at end of file