fix crash caused by default resolution

This commit is contained in:
Bnyro 2022-11-16 18:55:12 +01:00
parent 74651b7617
commit 44163d5659

View File

@ -1166,7 +1166,7 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
} }
private fun setStreamSource(streams: Streams) { private fun setStreamSource(streams: Streams) {
val defaultResolution = PlayerHelper.getDefaultResolution(requireContext()) val defaultResolution = PlayerHelper.getDefaultResolution(requireContext()).replace("p", "")
if (defaultResolution != "") { if (defaultResolution != "") {
val params = trackSelector.buildUponParameters() val params = trackSelector.buildUponParameters()
.setMaxVideoSize(Int.MAX_VALUE, defaultResolution.toInt()) .setMaxVideoSize(Int.MAX_VALUE, defaultResolution.toInt())