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

chore: enable hls for streaming by default #5953

Merged
merged 1 commit into from
May 1, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@
false
)

val useHlsOverDash: Boolean
get() = PreferenceHelper.getBoolean(

Check failure on line 356 in app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 A multiline expression should start on a new line Raw Output: app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt:356:17: error: A multiline expression should start on a new line (standard:multiline-expression-wrapping)
PreferenceKeys.USE_HLS_OVER_DASH,
true

Check failure on line 358 in app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Missing trailing comma before ")" Raw Output: app/src/main/java/com/github/libretube/helpers/PlayerHelper.kt:358:17: error: Missing trailing comma before ")" (standard:trailing-comma-on-call-site)
)

fun shouldPlayNextVideo(isPlaylist: Boolean = false): Boolean {
// if there is no next video, it obviously should not be played
if (!PlayingQueue.hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,8 @@
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

Check failure on line 375 in app/src/main/java/com/github/libretube/services/OnlinePlayerService.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Unnecessary trailing comma before ")" Raw Output: app/src/main/java/com/github/libretube/services/OnlinePlayerService.kt:375:60: error: Unnecessary trailing comma before ")" (standard:trailing-comma-on-call-site)
} else {
ProxyHelper.unwrapStreamUrl(streams.hls.orEmpty())
.toUri() to MimeTypes.APPLICATION_M3U8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/audio_video_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
app:useSimpleSummaryProvider="true" />

<SwitchPreferenceCompat
android:defaultValue="false"
android:defaultValue="true"
android:icon="@drawable/ic_list"
android:summary="@string/hls_instead_of_dash_summary"
android:title="@string/hls_instead_of_dash"
Expand Down
Loading