QNConferenceRepository

@MainActor
public final class QNConferenceRepository

Represents a conference

Properties

  • True if the user was invited to the room

    Declaration

    Swift

    @MainActor
    public var invited: Bool { get }
  • userConstraints Asynchronous

    Current user media constraints

    Declaration

    Swift

    @MainActor
    public var userConstraints: [(constraint: QNConferenceConstraint, muted: Bool)] { get async }
  • Current conference state

    Declaration

    Swift

    @MainActor
    public var state: QNConferenceState { get }
  • Incoming invitation identifier

    Declaration

    Swift

    @MainActor
    public var incomingInvitationId: String? { get }
  • QSS room identifier

    Declaration

    Swift

    @MainActor
    public var roomId: String { get }
  • Room participants

    Declaration

    Swift

    @MainActor
    public var participants: [String] { get }
  • Room identifier when make an attended transfer

    Declaration

    Swift

    @MainActor
    public var attendedTransferRoomId: String? { get }

API

  • Allows the user to join the conference.

    Declaration

    Swift

    @MainActor
    public func join(for constraints: [QNConferenceConstraint]? = nil,
                     configuration: QNConferenceConfiguration = QNConferenceConfiguration()) async throws

    Parameters

    constraints

    List of media that the user wants to share.

    configuration

    Provides info about fps,format,camera position and codes used in conference

  • Allow user to preview remote media before accept/decline an invitation This method doesn’t join the user to the conference, only subscribe to remote media

    Declaration

    Swift

    @MainActor
    public func previewMedia(prepareAudio: Bool) async throws

    Parameters

    prepareAudio

    Publish muted audio to avoid delays when user joins conference

  • invite(to:for:) Asynchronous

    Invite a participant to the conference

    Declaration

    Swift

    @MainActor
    public func invite(to participant: String,
                       for constraints: [QNConferenceConstraint]) async throws -> QNConferenceInvitationResponse

    Parameters

    to

    An identifier like username@domain or alias

    constraints

    List of media that the caller wants the participant to share. User who receives can accept it or provide another one when joining to or updating the conference.

    result

    Async Result with ConferenceInvitationResponse

  • invite(contact:for:) Asynchronous

    Invite a contact to the conference

    Declaration

    Swift

    @MainActor
    public func invite(contact: QNContact,
                       for constraints: [QNConferenceConstraint]) async throws -> QNConferenceInvitationResponse

    Parameters

    contact

    a Contact instance

    constraints

    List of media that the caller wants the user to share. The user can accept it or provide another one when joining to or updating the conference.

    result

    Async Result with ConferenceInvitationResponse

  • cancelInvitation(to:) Asynchronous

    Cancel an invitation to participant

    Declaration

    Swift

    @MainActor
    public func cancelInvitation(to participant: String) async throws -> String

    Parameters

    to

    An identifier like username@domain or alias

    result

    Async Result with invitationId

  • cancelInvitation(to:) Asynchronous

    Cancel an invitation to contact

    Declaration

    Swift

    @MainActor
    public func cancelInvitation(to contact: QNContact) async throws -> String

    Parameters

    to

    a Contact instance

    result

    Async Result with invitationId

  • expel(participant:) Asynchronous

    Expel a participant from a conference

    Declaration

    Swift

    @MainActor
    public func expel(participant: QNConferenceParticipant) async throws

    Parameters

    participant

    Participant to expel

    result

    Async Result, success when expel is completed

  • Decline an invitation

    Declaration

    Swift

    @MainActor
    public func declineInvitation()
  • leave() Asynchronous

    Leave a conference

    Declaration

    Swift

    @MainActor
    public func leave() async throws

    Parameters

    result

    Async Result, success when leave is completed

  • Accept an attended transfer

    Declaration

    Swift

    @MainActor
    public func acceptAttendedTransfer() async throws
  • Cancel an attended transfer

    Declaration

    Swift

    @MainActor
    public func cancelAttendedTransfer() async throws
  • Starts a new blind transfer

    Declaration

    Swift

    @MainActor
    public func transferUnattendedConference(to: String,
                                             constraints: [QNConferenceConstraint]) async throws

    Parameters

    to

    An identifier like username@domain or alias who will be called

    constraints

    List of media that the caller wants the participant to share.

    result

    Async Result, success when transfer is completed

  • Starts a new blind transfer

    Declaration

    Swift

    @MainActor
    public func transferUnattendedConference(to: String) async throws

    Parameters

    to

    An identifier like username@domain or alias who will be called with current user list of media that the caller wants the participant to share.

    result

    Async Result, success when transfer is completed

  • Starts a new blind transfer

    Declaration

    Swift

    @MainActor
    public func transferUnattendedConference(to contact: QNContact,
                                             constraints: [QNConferenceConstraint]) async throws

    Parameters

    to

    a Contact instance

    constraints

    List of media that the caller wants the participant to share.

    result

    Async Result, success when transfer is completed

  • Accepts a blind transfer

    Declaration

    Swift

    @MainActor
    public func acceptUnattendedTransfer(_ conferenceTransfer: QNConferenceTransfer) async throws

    Parameters

    conferenceTransfer

    Transfer to be accepted

    result

    Async Result, success when accept is completed

  • update(constraints:) Asynchronous

    Update a conference with new media, this override current media

    Declaration

    Swift

    @MainActor
    public func update(constraints: [QNConferenceConstraint]) async throws

    Parameters

    constraints

    New shared media

    result

    Async Result, success when update is completed

  • hold() Asynchronous

    Pause publish and subscribe media actions to attend other conference

    Declaration

    Swift

    @MainActor
    public func hold() async throws

    Return Value

    Complete when hold is finished

  • unhold() Asynchronous

    Restart media which had been published/suscribed before hold

    Declaration

    Swift

    @MainActor
    public func unhold() async throws

    Return Value

    Complete when unhold is finished

  • switchCamera() Asynchronous

    Switch camera to front or back position

    Declaration

    Swift

    @MainActor
    public func switchCamera() async
  • startRecording() Asynchronous

    Start recording conference

    Declaration

    Swift

    @MainActor
    public func startRecording() async throws

    Parameters

    result

    Async Result, success when startRecording is completed

  • stopRecording() Asynchronous

    Stop recording conference

    Declaration

    Swift

    @MainActor
    public func stopRecording() async throws

    Parameters

    result

    Async Result, success when stopRecording is completed

  • userView(frame:) Asynchronous

    View rendering local video if user is sharing video

    Declaration

    Swift

    @MainActor
    public func userView(frame rect: CGRect) async -> UIView?

    Parameters

    rect

    Rect for UIView

    metalRender

    Use metal library for video view

    Return Value

    UIView rendering local video

  • View rendering remote video if participant is sharing video

    Declaration

    Swift

    @MainActor
    public func viewFor(remoteParticipant: QNConferenceParticipant, frame rect: CGRect) async -> UIView?

    Parameters

    participant

    Participant

    rect

    Rect for UIView

    metalRender

    Use metal library for video view

    Return Value

    A UIView rendering remote video if participant is sharing it

  • remoteParticipants() Asynchronous

    Remote participants in conference

    Declaration

    Swift

    @MainActor
    public func remoteParticipants() async throws -> [(participant: QNConferenceParticipant, activeConstraints: [QNConferenceConstraint], status: QNConferenceParticipant.Status)]

    Parameters

    completion

    Closure to receive participants with active constraints and status

  • muteConferenceAudio() Asynchronous

    Mute conference audio

    Declaration

    Swift

    @MainActor
    public func muteConferenceAudio() async
  • Unmute conference audio

    Declaration

    Swift

    @MainActor
    public func unmuteConferenceAudio() async
  • muteLocal(constraint:) Asynchronous

    Mute local media

    Declaration

    Swift

    @MainActor
    public func muteLocal(constraint: QNConferenceConstraint) async

    Parameters

    constraint

    video or audio

  • Unmute local media

    Declaration

    Swift

    @MainActor
    public func unmuteLocal(constraint: QNConferenceConstraint) async

    Parameters

    constraint

    video or audio

  • Mute remote media

    Declaration

    Swift

    @MainActor
    public func muteRemoteVideo(participant: QNConferenceParticipant) async

    Parameters

    participant

    Participant to mute

  • Unmute remote media

    Declaration

    Swift

    @MainActor
    public func unmuteRemoteVideo(participant: QNConferenceParticipant) async

    Parameters

    participant

    Participant to unmute

  • send(dtmf:) Asynchronous

    Send dtmf sounds

    Declaration

    Swift

    @MainActor
    public func send(dtmf: String) async throws

    Parameters

    dtmf

    dialpad number