mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Ignore unknown audio track types
Co-authored-by: AudricV <74829229+AudricV@users.noreply.github.com>
This commit is contained in:
parent
9d25d32bff
commit
df4df4fccc
@ -115,14 +115,18 @@ object DashHelper {
|
|||||||
adapSetElement.setAttribute("lang", adapSet.audioLocale)
|
adapSetElement.setAttribute("lang", adapSet.audioLocale)
|
||||||
}
|
}
|
||||||
|
|
||||||
val roleElement = doc.createElement("Role")
|
// Only add the Role element if there is a track type set
|
||||||
roleElement.setAttribute("schemeIdUri", "urn:mpeg:dash:role:2011")
|
// This allows distinction between formats marked as original on YouTube and
|
||||||
roleElement.setAttribute(
|
// formats without track type info set
|
||||||
"value",
|
if (adapSet.audioTrackType != null) {
|
||||||
getRoleValueFromAudioTrackType(adapSet.audioTrackType)
|
val roleElement = doc.createElement("Role")
|
||||||
)
|
roleElement.setAttribute("schemeIdUri", "urn:mpeg:dash:role:2011")
|
||||||
|
roleElement.setAttribute(
|
||||||
adapSetElement.appendChild(roleElement)
|
"value",
|
||||||
|
getRoleValueFromAudioTrackType(adapSet.audioTrackType)
|
||||||
|
)
|
||||||
|
adapSetElement.appendChild(roleElement)
|
||||||
|
}
|
||||||
|
|
||||||
val isVideo = adapSet.mimeType.contains("video")
|
val isVideo = adapSet.mimeType.contains("video")
|
||||||
|
|
||||||
@ -198,11 +202,7 @@ object DashHelper {
|
|||||||
return segmentBase
|
return segmentBase
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getRoleValueFromAudioTrackType(audioTrackType: String?): String {
|
private fun getRoleValueFromAudioTrackType(audioTrackType: String): String {
|
||||||
if (audioTrackType == null) {
|
|
||||||
return "main"
|
|
||||||
}
|
|
||||||
|
|
||||||
return when (audioTrackType.lowercase()) {
|
return when (audioTrackType.lowercase()) {
|
||||||
"descriptive" -> "description"
|
"descriptive" -> "description"
|
||||||
"dubbed" -> "dub"
|
"dubbed" -> "dub"
|
||||||
|
@ -1429,7 +1429,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
}
|
}
|
||||||
.show(childFragmentManager)
|
.show(childFragmentManager)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAudioStreamClicked() {
|
override fun onAudioStreamClicked() {
|
||||||
val context = requireContext()
|
val context = requireContext()
|
||||||
val audioLanguagesAndRoleFlags = PlayerHelper.getAudioLanguagesAndRoleFlagsFromTrackGroups(
|
val audioLanguagesAndRoleFlags = PlayerHelper.getAudioLanguagesAndRoleFlagsFromTrackGroups(
|
||||||
|
Loading…
Reference in New Issue
Block a user