Merge pull request #3172 from Bnyro/master

Fix that some videos are not playable using DASH
This commit is contained in:
Bnyro 2023-02-23 19:32:12 +01:00 committed by GitHub
commit 015e389227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1275,7 +1275,10 @@ class PlayerFragment : Fragment(R.layout.fragment_player), OnlinePlayerOptions {
if (!PreferenceHelper.getBoolean(PreferenceKeys.USE_HLS_OVER_DASH, false) &&
streams.videoStreams.isNotEmpty()
) {
val uri = streams.dash?.toUri() ?: let {
// only use the dash manifest generated by YT if either it's a livestream or no other source is available
val uri = streams.dash?.toUri().takeIf {
streams.livestream || streams.videoStreams.isEmpty()
} ?: let {
val manifest = DashHelper.createManifest(streams)
// encode to base64