CallExtensionScope


@ExperimentalAppActions
interface CallExtensionScope


Provides a scope where extensions can be first initialized and next managed for a Call once onConnected is called.

The following extension is supported on a call:

class InCallServiceImpl : InCallServiceCompat() {
...

override fun onCallAdded(call: Call) {
lifecycleScope.launch {
connectExtensions(context, call) {
// Initialize extensions
onConnected { call ->
// change call states & listen for extension updates/send extension actions
}
}
// Once the call is destroyed, control flow will resume again
}
}
...
}

Summary

Public functions

LocalCallSilenceExtensionRemote
addLocalCallSilenceExtension(
    onIsLocallySilencedUpdated: suspend (Boolean) -> Unit
)

Add support for this remote surface to display information related to the local call silence state for this call.

ParticipantExtensionRemote
addParticipantExtension(
    onActiveParticipantChanged: suspend (Participant?) -> Unit,
    onParticipantsUpdated: suspend (Set<Participant>) -> Unit
)

Add support for this remote surface to display information related to the Participants in this call.

Unit
onConnected(block: suspend (Call) -> Unit)

Called when the Call extensions have been successfully set up and are ready to be used.

Public functions

addLocalCallSilenceExtension

Added in 1.0.0-beta01
fun addLocalCallSilenceExtension(
    onIsLocallySilencedUpdated: suspend (Boolean) -> Unit
): LocalCallSilenceExtensionRemote

Add support for this remote surface to display information related to the local call silence state for this call.

connectExtensions(call) {
val localCallSilenceExtension = addLocalCallSilenceExtension(
// consume local call silence state changes
)
onConnected {
// At this point, support for the local call silence extension will be known
}
}
Parameters
onIsLocallySilencedUpdated: suspend (Boolean) -> Unit

Called when the local call silence state has changed and the UI should be updated.

Returns
LocalCallSilenceExtensionRemote

The interface that is used to interact with the local call silence extension methods.

addParticipantExtension

fun addParticipantExtension(
    onActiveParticipantChanged: suspend (Participant?) -> Unit,
    onParticipantsUpdated: suspend (Set<Participant>) -> Unit
): ParticipantExtensionRemote

Add support for this remote surface to display information related to the Participants in this call.

connectExtensions(call) {
val participantExtension = addParticipantExtension(
// consume participant changed events
)
onConnected {
// extensions have been negotiated and actions are ready to be used
}
}
Parameters
onActiveParticipantChanged: suspend (Participant?) -> Unit

Called with the active Participant in the call has changed. If this method is called with a null Participant, there is no active Participant. The active Participant in the call is the Participant that should take focus and be either more prominent on the screen or otherwise featured as active in UI. For example, this could be the Participant that is actively talking or presenting.

onParticipantsUpdated: suspend (Set<Participant>) -> Unit

Called when the Participants in the Call have changed and the UI should be updated.

Returns
ParticipantExtensionRemote

The interface that is used to set up additional actions for this extension.

onConnected

Added in 1.0.0-beta01
fun onConnected(block: suspend (Call) -> Unit): Unit

Called when the Call extensions have been successfully set up and are ready to be used.

Parameters
block: suspend (Call) -> Unit

Called when the Call and initialized extensions are ready to be used.