ParticipantExtensionRemote


@ExperimentalAppActions
public interface ParticipantExtensionRemote


Interface used to allow the remote surface (automotive, watch, etc...) to know if the connected calling application supports the participant extension and optionally set up additional actions for the Participants in the call.

Actions allow the remote surface to display additional optional state regarding the Participants in the call and send action requests to the calling application to modify the state of supported actions.

Summary

Public methods

abstract @NonNull KickParticipantAction

Adds the ability for the user to request to kick Participants in the call.

abstract @NonNull RaiseHandAction
addRaiseHandAction(
    @NonNull SuspendFunction1<@NonNull List<@NonNull Participant>, Unit> onRaisedHandsChanged
)

Adds the "raise hand" action and provides the remote surface with the ability to display which Participants have their hands raised and an action to request to raise and lower their own hand.

abstract boolean

Whether or not the participants extension is supported by the calling application.

Public methods

addKickParticipantAction

Added in 1.0.0-beta01
abstract @NonNull KickParticipantAction addKickParticipantAction()

Adds the ability for the user to request to kick Participants in the call.

connectExtensions(call) {
val participantExtension = addParticipantExtension(
// consume participant changed events
)
val kickParticipantAction = participantExtension.addKickParticipantAction()

onConnected {
// extensions have been negotiated and actions are ready to be used
...
// kick a participant
val kickResult = kickParticipantAction.kickParticipant(participant)
}
}
Returns
@NonNull KickParticipantAction

The action that is used to send kick Participant event requests to the remote Call.

addRaiseHandAction

abstract @NonNull RaiseHandAction addRaiseHandAction(
    @NonNull SuspendFunction1<@NonNull List<@NonNull Participant>, Unit> onRaisedHandsChanged
)

Adds the "raise hand" action and provides the remote surface with the ability to display which Participants have their hands raised and an action to request to raise and lower their own hand.

connectExtensions(call) {
val participantExtension = addParticipantExtension(
// consume participant changed events
)
// Initialize the raise hand action
val raiseHandAction = participantExtension.addRaiseHandAction { raisedHands ->
// consume changes of participants with their hands raised
}
onConnected {
// extensions have been negotiated and actions are ready to be used
...
// notify the remote that this user has changed their hand raised state
val raisedHandResult = raiseHandAction.setRaisedHandState(userHandRaisedState)
}
}

Note: Must be called during initialization before CallExtensionScope.onConnected is called.

Parameters
@NonNull SuspendFunction1<@NonNull List<@NonNull Participant>, Unit> onRaisedHandsChanged

Called when the List of Participants with their hands raised has changed, ordered from oldest raised hand to newest raised hand.

Returns
@NonNull RaiseHandAction

The action that is used to determine support of this action and send raise hand event requests to the calling application.

isSupported

Added in 1.0.0-beta01
abstract boolean isSupported()

Whether or not the participants extension is supported by the calling application.

If true, then updates about Participants in the call will be notified. If false, then the remote doesn't support this extension and participants will not be notified to the caller nor will associated actions receive state updates.

Note: Must not be queried until after CallExtensionScope.onConnected is called.