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