Skip to content

Commit 2f2d43d

Browse files
authored
Merge pull request #191 from GetStream/refactor/permissions
Refactor EnsureVideoCallPermissions
2 parents cf78fa2 + 5d92f4e commit 2f2d43d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

features/video/src/main/kotlin/io/getstream/whatsappclone/video/WhatsAppVideoCall.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fun WhatsAppVideoCall(
6363
) {
6464
val uiState by viewModel.videoUiSate.collectAsStateWithLifecycle()
6565

66-
EnsureAudioPermission {
66+
EnsureVideoCallPermissions {
6767
viewModel.joinCall(type = "default", id = id.replace(":", ""))
6868
}
6969

@@ -217,12 +217,13 @@ private fun WhatsAppVideoCallContentPreview() {
217217

218218
@OptIn(ExperimentalPermissionsApi::class)
219219
@Composable
220-
fun EnsureAudioPermission(onPermissionsGranted: () -> Unit) {
220+
fun EnsureVideoCallPermissions(onPermissionsGranted: () -> Unit) {
221221
// While the SDK will handle the microphone permission,
222222
// its not a bad idea to do it prior to entering any call UIs
223223
val permissionsState = rememberMultiplePermissionsState(
224224
permissions = buildList {
225225
// Access to microphone
226+
add(Manifest.permission.CAMERA)
226227
add(Manifest.permission.RECORD_AUDIO)
227228
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
228229
// Allow for foreground service for notification on API 26+

0 commit comments

Comments
 (0)