# Conference

class Conference

A conference instance.

This class allows performing actions over this specific conference like joining the conference, hanging up or managing its participants. It also allows adding a listener to receive events related to this particular instance (@see ConferenceListener).

In order to share the media successfully, it is necessary to declare the pertinent permissions on the manifest:

- "android.permission.CAMERA" for sharing video.

- "android.permission.RECORD_AUDIO" for sharing audio.

## Properties

caller
Link copied to clipboard
val caller: Contact?

Who has started this conference if the user was invited. If not, it will be null.

conferenceType
Link copied to clipboard
val conferenceType: ConferenceType

Current conference type.

currentMediaTypes
Link copied to clipboard
val currentMediaTypes: List<MediaType>

Current conference mediatypes.

currentParticipants
Link copied to clipboard
val currentParticipants: List<Participant>

Current conference participants.

currentState
Link copied to clipboard
lateinit var currentState: JanusConference.State

Current conference state.

id
Link copied to clipboard
val id: String

Conference identifier (which is the same as the room identifier).

isLocalAudioEnabled
Link copied to clipboard
val isLocalAudioEnabled: Boolean

True if the user is sharing audio and it is enabled.

isLocalVideoEnabled
Link copied to clipboard
val isLocalVideoEnabled: Boolean

True if the user is sharing video and it is enabled.

isRecordingEnabled
Link copied to clipboard
val isRecordingEnabled: Boolean

True if the conference is being recorded.

isRemoteAudioEnabled
Link copied to clipboard
val isRemoteAudioEnabled: Boolean

True if the remote audio is enabled.

rx
Link copied to clipboard
val rx: ConferenceRx

Access to the reactive API of the conference.

## Functions

acceptAttendedTransfer
Link copied to clipboard
fun acceptAttendedTransfer(onCompletion: (ConferenceError?) -> Unit)

Accepts an attended transfer in progress.

acceptTransfer
Link copied to clipboard
fun acceptTransfer(transfer: Transfer, mediaTypes: List<MediaType>? = null)

Accept an incoming transfer.

addListener
Link copied to clipboard
fun addListener(listener: ConferenceListener)

Adds a listener to receive different events related to this conference.

addMediaListener
Link copied to clipboard
fun addMediaListener(listener: ConferenceMediaListener)

Adds a listener to receive different media events related to this conference.

cancelAttendedTransfer
Link copied to clipboard
fun cancelAttendedTransfer(onCompletion: (ConferenceError?) -> Unit)

Cancels an attended transfer in progress.

cancelInviteToParticipant
Link copied to clipboard
fun cancelInviteToParticipant(participant: Participant, onCompletion: (ConferenceError?) -> Unit)

Cancels the invitation made for the user to the specified participant.

displayLocalVideo
Link copied to clipboard
fun displayLocalVideo(videoRenderer: SurfaceViewRenderer, aspect: RendererCommon.ScalingType, pip: Boolean)

Displays the local video in the specified videoRenderer if the user is sharing it. It should be called after receiving the event notifying that the local video has been added to the conference or when, once the video is being rendered, the videoRenderer needs to be changed. IMPORTANT: The videoRenderer used should be released (videoRenderer.release()) once the view is destroyed.

displayRemoteVideo
Link copied to clipboard
fun displayRemoteVideo(participantName: String, videoRenderer: SurfaceViewRenderer, aspect: RendererCommon.ScalingType, pip: Boolean)

Displays the remote video of the participant specified by participantName in the indicated videoRenderer if they are sharing it. It should be called after receiving the event notifying that the video for that participant has been added to the conference or when, once the video is being rendered, the videoRenderer needs to be changed. IMPORTANT: The videoRenderer used should be released (videoRenderer.release()) once the view is destroyed.

enableLocalAudio
Link copied to clipboard
fun enableLocalAudio(isEnabled: Boolean)

Enables/disables the local audio.

enableLocalVideo
Link copied to clipboard
fun enableLocalVideo(isEnabled: Boolean)

Enables/disables the local video.

enableRemoteAudio
Link copied to clipboard
fun enableRemoteAudio(isEnabled: Boolean)

Enables/disables the remote audio of the current Conference.

enableRemoteVideo
Link copied to clipboard
fun enableRemoteVideo(participantName: String, isEnabled: Boolean)

Enables/disables the remote video of the participant specified by participantName.

expelParticipant
Link copied to clipboard
fun expelParticipant(participant: Participant, onCompletion: (ConferenceError?) -> Unit)

Expels the specified participant from this conference.

getInvitations
Link copied to clipboard
fun getInvitations(onCompletion: (List<Invitation>) -> Unit)

Fetches all the invitations made for the user to this conference.

hangup
Link copied to clipboard
fun hangup()

Declines this conference.

hold
Link copied to clipboard
fun hold(onCompletion: (ConferenceError?) -> Unit)

Hold the current conference.

inviteParticipant
Link copied to clipboard
fun inviteParticipant(callee: String, context: Context, requestedMediaTypes: List<MediaType> = listOf(MediaType.AUDIO, MediaType.VIDEO), joinOnAnswer: Boolean = true, onCompletion: (Either<QssInvitation.State, ConferenceError>) -> Unit)

Invites a new participant to this conference.

join
Link copied to clipboard
fun join(context: Context, mediaTypes: List<MediaType>? = null, onCompletion: (ConferenceError?) -> Unit)

Allows the user to join this conference.

previewRemoteVideo
Link copied to clipboard
fun previewRemoteVideo()

Allows the user to preview remote media before joining/declining the conference. IMPORTANT: This method does not join the user to the conference. The join action has to be explicit.

removeListener
Link copied to clipboard
fun removeListener(listener: ConferenceListener)

Removes the specified listener.

removeMediaListener
Link copied to clipboard
fun removeMediaListener(listener: ConferenceMediaListener)

Removes the specified listener.

sendDtmf
Link copied to clipboard
fun sendDtmf(digit: Dtmf, onCompletion: (ConferenceError?) -> Unit)

Sends the provided digit tone to the current Conference.

swapVideos
Link copied to clipboard
fun swapVideos(participantNameA: String, participantNameB: String)

Swaps the videos of the specified participants. It should be called once both videos are being displayed if the surfaces on which they are being rendered are to be exchanged.

switchCamera
Link copied to clipboard
fun switchCamera()

Swaps the physical device used to capture the video. It should be used when the local user is already sharing video.

transferConference
Link copied to clipboard
fun transferConference(callee: String, mediaTypes: List<MediaType>? = null, onCompletion: (ConferenceError?) -> Unit)

Transfer the current conference to the specified Callee.

unhold
Link copied to clipboard
fun unhold(onCompletion: (ConferenceError?) -> Unit)

Unhold the current conference.

updateMedia
Link copied to clipboard
fun updateMedia(context: Context, mediaTypes: List<MediaType>, onCompletion: (ConferenceError?) -> Unit)

Updates the media types shared by the user, overridden the current ones.