Skip to content

Commit

Permalink
fix(example): fix crash on preferences when camera "0" does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Jan 24, 2025
1 parent 009a043 commit 97a2510
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.os.Bundle
import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import video.api.livestream.ConfigurationHelper
import video.api.livestream.example.R
import video.api.livestream.enums.Resolution
import video.api.livestream.example.R

class PreferencesFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
Expand All @@ -30,7 +30,7 @@ class PreferencesFragment : PreferenceFragmentCompat() {
(findPreference(getString(R.string.video_fps_key)) as ListPreference?)!!.apply {
val supportedFramerates = ConfigurationHelper.video.getSupportedFrameRates(
requireContext(),
"0"
ConfigurationHelper.video.getBackCamerasList(requireContext()).first()
)
entryValues.filter { fps ->
supportedFramerates.any { it.contains(fps.toString().toInt()) }
Expand Down

0 comments on commit 97a2510

Please sign in to comment.