diff --git a/app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt b/app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt index 6ca3cf81be..d17aecbfbd 100644 --- a/app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt @@ -352,6 +352,12 @@ object PlayerHelper { false ) + val useHlsOverDash: Boolean + get() = PreferenceHelper.getBoolean( + PreferenceKeys.USE_HLS_OVER_DASH, + true + ) + fun shouldPlayNextVideo(isPlaylist: Boolean = false): Boolean { // if there is no next video, it obviously should not be played if (!PlayingQueue.hasNext()) { diff --git a/app/src/main/java/com/github/libretube/services/OnlinePlayerService.kt b/app/src/main/java/com/github/libretube/services/OnlinePlayerService.kt index a024b1e04b..66df208a4c 100644 --- a/app/src/main/java/com/github/libretube/services/OnlinePlayerService.kt +++ b/app/src/main/java/com/github/libretube/services/OnlinePlayerService.kt @@ -371,15 +371,8 @@ class OnlinePlayerService : LifecycleService() { val streams = streams ?: return val (uri, mimeType) = - if (!PreferenceHelper.getBoolean( - PreferenceKeys.USE_HLS_OVER_DASH, - false, - ) && streams.audioStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy - ) { - PlayerHelper.createDashSource( - streams, - this, - ) to MimeTypes.APPLICATION_MPD + if (!PlayerHelper.useHlsOverDash && streams.audioStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy) { + PlayerHelper.createDashSource(streams, this,) to MimeTypes.APPLICATION_MPD } else { ProxyHelper.unwrapStreamUrl(streams.hls.orEmpty()) .toUri() to MimeTypes.APPLICATION_M3U8 diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 62bf890ac3..c487bb1dfd 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -1296,10 +1296,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { lbryHlsUrl.toUri() to MimeTypes.APPLICATION_M3U8 } // DASH - !PreferenceHelper.getBoolean( - PreferenceKeys.USE_HLS_OVER_DASH, - false - ) && streams.videoStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy -> { + !PlayerHelper.useHlsOverDash && streams.videoStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy -> { // only use the dash manifest generated by YT if either it's a livestream or no other source is available val dashUri = if (streams.livestream && streams.dash != null) { diff --git a/app/src/main/res/xml/audio_video_settings.xml b/app/src/main/res/xml/audio_video_settings.xml index 15fa1f0d23..88d82852b7 100644 --- a/app/src/main/res/xml/audio_video_settings.xml +++ b/app/src/main/res/xml/audio_video_settings.xml @@ -87,7 +87,7 @@ app:useSimpleSummaryProvider="true" />