Merge pull request #6200 from Bnyro/master

fix: video codec preference doesn't work when HLS enabled
This commit is contained in:
Bnyro 2024-07-07 23:29:01 +02:00 committed by GitHub
commit 4ffaeadfc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1313,11 +1313,11 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
if (enabledVideoCodecs != "all") {
// map the codecs to their corresponding mimetypes
val mimeType = when (enabledVideoCodecs) {
"vp9" -> "video/webm"
"avc" -> "video/mp4"
"vp9" -> arrayOf("video/webm", "video/x-vnd.on2.vp9")
"avc" -> arrayOf("video/mp4", "video/avc")
else -> throw IllegalArgumentException()
}
this.setPreferredVideoMimeType(mimeType)
this.setPreferredVideoMimeTypes(*mimeType)
}
}
}