chore: enable hls for streaming by default

This commit is contained in:
Bnyro 2024-05-01 17:59:46 +02:00
parent afdbf099c3
commit 2ad84ed9bd
4 changed files with 10 additions and 14 deletions

View File

@ -352,6 +352,12 @@ object PlayerHelper {
false false
) )
val useHlsOverDash: Boolean
get() = PreferenceHelper.getBoolean(
PreferenceKeys.USE_HLS_OVER_DASH,
true
)
fun shouldPlayNextVideo(isPlaylist: Boolean = false): Boolean { fun shouldPlayNextVideo(isPlaylist: Boolean = false): Boolean {
// if there is no next video, it obviously should not be played // if there is no next video, it obviously should not be played
if (!PlayingQueue.hasNext()) { if (!PlayingQueue.hasNext()) {

View File

@ -371,15 +371,8 @@ class OnlinePlayerService : LifecycleService() {
val streams = streams ?: return val streams = streams ?: return
val (uri, mimeType) = val (uri, mimeType) =
if (!PreferenceHelper.getBoolean( if (!PlayerHelper.useHlsOverDash && streams.audioStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy) {
PreferenceKeys.USE_HLS_OVER_DASH, PlayerHelper.createDashSource(streams, this,) to MimeTypes.APPLICATION_MPD
false,
) && streams.audioStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy
) {
PlayerHelper.createDashSource(
streams,
this,
) to MimeTypes.APPLICATION_MPD
} else { } else {
ProxyHelper.unwrapStreamUrl(streams.hls.orEmpty()) ProxyHelper.unwrapStreamUrl(streams.hls.orEmpty())
.toUri() to MimeTypes.APPLICATION_M3U8 .toUri() to MimeTypes.APPLICATION_M3U8

View File

@ -1296,10 +1296,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
lbryHlsUrl.toUri() to MimeTypes.APPLICATION_M3U8 lbryHlsUrl.toUri() to MimeTypes.APPLICATION_M3U8
} }
// DASH // DASH
!PreferenceHelper.getBoolean( !PlayerHelper.useHlsOverDash && streams.videoStreams.isNotEmpty() && !PlayerHelper.disablePipedProxy -> {
PreferenceKeys.USE_HLS_OVER_DASH,
false
) && 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 // only use the dash manifest generated by YT if either it's a livestream or no other source is available
val dashUri = val dashUri =
if (streams.livestream && streams.dash != null) { if (streams.livestream && streams.dash != null) {

View File

@ -87,7 +87,7 @@
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="true"
android:icon="@drawable/ic_list" android:icon="@drawable/ic_list"
android:summary="@string/hls_instead_of_dash_summary" android:summary="@string/hls_instead_of_dash_summary"
android:title="@string/hls_instead_of_dash" android:title="@string/hls_instead_of_dash"