-
-
Save skydoves/4609707e2e9755310192c1b66d2a4497 to your computer and use it in GitHub Desktop.
video_controls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2023 Stream.IO, Inc. All Rights Reserved. | |
// SPDX-License-Identifier: Apache-2.0 | |
VideoCallControls( | |
modifier = Modifier | |
.fillMaxWidth() | |
.align(Alignment.BottomCenter), | |
callMediaState = callMediaState, | |
onCallAction = { | |
when (it) { | |
is CallAction.ToggleMicroPhone -> { | |
val enabled = callMediaState.isMicrophoneEnabled.not() | |
callMediaState = callMediaState.copy(isMicrophoneEnabled = enabled) | |
sessionManager.enableMicrophone(enabled) | |
} | |
is CallAction.ToggleCamera -> { | |
val enabled = callMediaState.isCameraEnabled.not() | |
callMediaState = callMediaState.copy(isCameraEnabled = enabled) | |
sessionManager.enableCamera(enabled) | |
} | |
CallAction.FlipCamera -> sessionManager.flipCamera() | |
CallAction.LeaveCall -> { | |
sessionManager.disconnect() | |
activity?.finish() | |
} | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment