File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
demos/camera/src/main/java/io/github/thibaultbee/streampack/app/ui/main Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -215,14 +215,24 @@ class PreviewViewModel(private val application: Application) : ObservableViewMod
215215 Manifest .permission.RECORD_AUDIO
216216 ) == PackageManager .PERMISSION_GRANTED
217217 ) {
218- streamer.setAudioConfig(config)
218+ try {
219+ streamer.setAudioConfig(config)
220+ } catch (t: Throwable ) {
221+ Log .e(TAG , " setAudioConfig failed" , t)
222+ _streamerErrorLiveData .postValue(" setAudioConfig: ${t.message ? : " Unknown error" } " )
223+ }
219224 }
220225 }
221226 }
222227 viewModelScope.launch {
223228 storageRepository.videoConfigFlow.filterNotNull()
224229 .collect { config ->
225- streamer.setVideoConfig(config)
230+ try {
231+ streamer.setVideoConfig(config)
232+ } catch (t: Throwable ) {
233+ Log .e(TAG , " setVideoConfig failed" , t)
234+ _streamerErrorLiveData .postValue(" setVideoConfig: ${t.message ? : " Unknown error" } " )
235+ }
226236 }
227237 }
228238 }
You can’t perform that action at this time.
0 commit comments