Skip to content

Call flows

kristiyan-petrov edited this page May 3, 2024 · 2 revisions

Get current call

The current call can be intercepted by adding the following code

KaleyraVideo.conference.call.onEach { call -> 
     
}.launchIn(MainScope())

Update displayed call actions

Call actions represents capabilities that are enabled on the call UI. To update or modify the call actions please refer to the following snippet:

KaleyraVideo.conference.callActions = CallUI.Action.default + CallUI.Action.FileShare + CallUI.Action.ScreenShare

Please follow the CallUI.Action documentation to get all the available actions.

Observe call events

To observe the call state it is necessary to observe the state flow exposed.

call.state.onEach { callState -> 
    Log.d("CALL STATE", "$callState")
}.launchIn(MainScope())

Observe call recording

Whenever a call is recorded, the call recording type can be either manual (recording is started by admin callee) or automatic (recording starts when the call is connected).

Call.Recording.Type can be retrieved from call info as show below.

call.recording.onEach { callRecordingType ->
   Log.d("CALL RECORDING TYPE", "$callRecordingType")
}.launchIn(MainScope())

Call recording state can be observed as shown below:

call.recording.flatMapLatest { it.state }.onEach { callRecordingState ->
   Log.d("CALL RECORDING STATE", "$callRecordingState")
}.launchIn(MainScope())

Call UI Display Mode

It's possible to change how the call UI should be displayed while the Bandyer SDK has an ongoing call.

The call UI can be displayed in the following display modes:

  • Foreground: fullscreen call UI
  • Background: the call UI is active but running in the background and can be retrieved through recent apps' screen.
  • PictureInPictureE: the call UI is active and shown in the default picture in picture window. No call controls can be triggered while shown in this display mode

The display mode can be updated every time is needed when the call activity is currently displayed.

KaleyraVideo.conference.call.onEach {
   call.setDisplayMode(CallUI.DisplayMode.PictureInPicture) // CallUI.DisplayMode.Foreground, CallUI.DisplayMode.Background
}.launchIn(lifecycleScope)
Clone this wiki locally