fix crash when using LBRY

This commit is contained in:
Bnyro 2022-11-21 15:17:33 +01:00
parent 956428a49f
commit 3bdce96818

View File

@ -1105,33 +1105,20 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
continue continue
} }
resolutions.add( runCatching {
VideoResolution(
name = "${vid.quality.qualityToInt()}p",
resolution = vid.quality.qualityToInt()
)
)
/*
// append quality to list if it has the preferred format (e.g. MPEG)
val preferredMimeType = "video/${PlayerHelper.videoFormatPreference}"
if (vid.url != null && vid.mimeType == preferredMimeType) {
// avoid duplicated resolutions
if (resolutions.any {
it.resolution == vid.quality.qualityToInt()
}
) {
continue
}
resolutions.add( resolutions.add(
VideoResolution( VideoResolution(
name = "${vid.quality.qualityToInt()}p", name = "${vid.quality.qualityToInt()}p",
resolution = vid.quality.qualityToInt() resolution = vid.quality.qualityToInt()
) )
) )
} }
*/
/*
// append quality to list if it has the preferred format (e.g. MPEG)
val preferredMimeType = "video/${PlayerHelper.videoFormatPreference}"
if (vid.url != null && vid.mimeType == preferredMimeType)
*/
} }
if (resolutions.isEmpty()) { if (resolutions.isEmpty()) {