PlanetKitConference

public class PlanetKitConference : NSObject
extension PlanetKitConference: PlanetKitDataSessionControllable
extension PlanetKitConference: PlanetKitAudioVolumeDelegate
extension PlanetKitConference: PlanetKitAudioDeviceChangeDelegate
extension PlanetKitConference: PlanetKitCameraDeviceChangeDelegate
extension PlanetKitConference : PlanetKitAudioMicCaptureDelegate
extension PlanetKitConference : PlanetKitAudioSpkPlayDelegate
extension PlanetKitConference: PlanetKitVideoOutputDelegate
extension PlanetKitConference: PlanetKitVideoLimiter
extension PlanetKitConference: PlanetKitSharedContentsControllable
extension PlanetKitConference: PlanetKitStatisticsControllable
extension PlanetKitConference: PlanetKitDebugMonitor

The PlanetKitConference class represents a conference in the PlanetKit framework.

Data Session

PlanetKitAudioVolumeDelegate

PlanetKitAudioDeviceChangeDelegate

PlanetKitCameraDeviceChangeDelegate

Audio/Video Change

  • Enables a video conference in the middle of an audio conference.

    • initialMyVideoState: The initial state of the local user’s video.
    • completion: A closure that will be called when the video is enabled. The closure takes a Boolean value indicating whether the video conference was enabled successfully or not.

    Declaration

    Swift

    @objc
    public func enableVideo(initialMyVideoState: PlanetKitInitialMyVideoState = .resume, completion: @escaping (Bool) -> Void)
  • Disables a video conference in the middle of a video conference.

    Declaration

    Swift

    @objc
    public func disableVideo(completion: @escaping (Bool) -> Void)

Peer Video

Peer Control

Provider for Raw Data

AEC Reference Data

  • Starts the use of the user’s reference audio data for AEC to resolve echo.

    Remark

    To resolve echo using the user’s reference data, you should provide reference data using PlanetKitConference.putUserAcousticEchoCancellerReference(frameCnt:...) after calling this function.

    Declaration

    Swift

    @objc
    public func startUserAcousticEchoCancellerReference(_ completion: @escaping (Bool) -> Void)
  • Stops the use of the user’s reference audio data for AEC to resolve echo.

    Remark

    You should call this function to stop putting reference audio data for AEC.

    Declaration

    Swift

    @objc
    public func stopUserAcousticEchoCancellerReference(_ completion: @escaping (Bool) -> Void)
  • Puts reference audio data for AEC.

    Declaration

    Swift

    @objc
    public func putUserAcousticEchoCancellerReference(frameCnt: UInt32, channels: UInt32, sampleRate: UInt32, sampleType: PlanetKitAudioSampleType, outData: UnsafeMutableRawPointer!, outDataLen: UInt32)

PlanetKitAudioMicCaptureDelegate

PlanetKitAudioSpkPlayDelegate

PlanetKitVideoOutputDelegate

PlanetKitVideoLimiter

  • Determines if screen share sending is available at the specified timestamp.

    Declaration

    Swift

    public func isScreenShareSendAvailable(_ timestamp: CMTime) -> Bool

    Parameters

    timestamp

    The timestamp of the screen share frame.

    Return Value

    true if screen share sending is available, false otherwise.

  • Determines if video sending is available at the specified timestamp.

    Declaration

    Swift

    public func isVideoSendAvailable(_ timestamp: CMTime) -> Bool

    Parameters

    timestamp

    The timestamp of the video frame.

    Return Value

    true if video sending is available, false otherwise.

Screen Share (Sender)

  • Starts the local user’s screen share.

  • Starts the local user’s screen share.

    Declaration

    Swift

    @objc
    public func startMyScreenShare(device: PlanetKitScreenCaptureDevice, subgroupName: String?, completion: @escaping (Bool) -> Void)

    Parameters

    device

    The screen capture device to be used for screen share.

    completion

    A closure that will be called when the screen share is started. The closure takes a Boolean value indicating whether the screen share was started successfully or not.

  • Stops the local user’s screen share.

    Declaration

    Swift

    @objc
    public func stopMyScreenShare(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that will be called when the screen share is stopped. The closure takes a Boolean value indicating whether the screen share was stopped successfully or not.

  • Stops the local user’s screen share with a reason code.

    Remark

    The reason value must be between 0 and 39.

    Declaration

    Swift

    @objc
    public func stopMyScreenShare(reason: Int32, completion: @escaping (Bool) -> Void)

    Parameters

    reason

    The reason for stopping the screen share.

    completion

    A closure that will be called when the screen share is stopped. The closure takes a Boolean value indicating whether the screen share was stopped successfully or not.

  • Changes the destination for screen share.

    Declaration

    Swift

    @objc
    public func changeMyScreenShareDestination(subgroupName: String, completion: @escaping (Bool) -> Void)

    Parameters

    subgroupName

    The name of the subgroup to change the screen share destination for.

    completion

    A closure that is called when the operation is complete. The closure takes a Boolean value indicating whether the operation was successful.

  • Changes the screen share destination to the main room.

    Declaration

    Swift

    @objc
    public func changeMyScreenShareDestinationToMainRoom(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that is called when the operation is complete. The closure takes a Boolean value indicating whether the operation was successful.

  • Stops the local user’s ReplayKit session.

    Close the session that receives data transmitted from ReplayKit via App Extension.

Screen Share (Receiver)

Concurrent Count

  • Gets the maximum concurrent video count.

    Remark

    The count of received peer videos increases with a successful startVideo(maxResolution:delegate:subgroupName:completion:) and decreases with stopVideo(completion:). If the count of concurrently received peer videos is equal to the maximum count, a new startVideo(maxResolution:delegate:subgroupName:completion:) will fail.

    Declaration

    Swift

    @objc
    public var peersVideoMaxCount: Int { get }
  • Gets the maximum concurrent screen share count.

    Remark

    The count of received peer screen shares increases with a successful startScreenShare(delegate:subgroupName:completion:) and decreases with stopScreenShare(completion:). If the count of concurrently received peer screen shares is equal to the maximum count, a new startScreenShare(delegate:subgroupName:completion:) will fail.

    Declaration

    Swift

    @objc
    public var peersScreenShareMaxCount: Int { get }

Screen Share - Video Share Mode

  • Sets the video share mode for the local user’s screen share.

    Remark

    The video share mode determines whether the local user’s video is shared during screen share. By default, the video share mode is disabled.

    Declaration

    Swift

    @objc
    public func setMyScreenShareVideoShareMode(enable: Bool) -> Bool

    Parameters

    enable

    A Boolean value indicating whether the video share mode should be enabled.

    Return Value

    A Boolean value indicating whether the video share mode was set successfully or not.

  • A Boolean value indicating whether the video share mode is enabled for the local user’s screen share.

    Declaration

    Swift

    @objc
    public var isMyScreenShareVideoShareModeEnabled: Bool { get }

Shared Contents

  • Sets the shared contents during a conference.

    Declaration

    Swift

    public func setSharedContents(data: Data, completion: @escaping (Bool) -> Void)

    Parameters

    data

    The data to be shared.

    completion

    A closure that will be called when the shared contents are set. The closure takes a Boolean value indicating whether the shared contents were set successfully or not.

  • Unsets the shared contents during a conference.

    Declaration

    Swift

    public func unsetSharedContents(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that will be called when the shared contents are unset. The closure takes a Boolean value indicating whether the shared contents were unset successfully or not.

  • Sets the exclusively shared contents during a conference.

    Declaration

    Swift

    public func setExclusivelySharedContents(data: Data, completion: @escaping (Bool) -> Void)

    Parameters

    data

    The data to be shared.

    completion

    A closure that will be called when the exclusively shared contents are set. The closure takes a Boolean value indicating whether the exclusively shared contents were set successfully or not.

  • Unsets the exclusively shared contents during a conference.

    Declaration

    Swift

    public func unsetExclusivelySharedContents(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that will be called when the exclusively shared contents are unset. The closure takes a Boolean value indicating whether the exclusively shared contents were unset successfully or not.

  • Sets the room shared contents during a conference.

    Remark

    This function will not work at 1-to-1 call.

    Declaration

    Swift

    public func setRoomSharedContents(data: Data, completion: @escaping (Bool) -> Void)

    Parameters

    data

    The data to be shared.

    completion

    A closure that will be called when the room shared contents are set. The closure takes a Boolean value indicating whether the room shared contents were set successfully or not.

  • Unsets the room shared contents during a conference.

    Remark

    This function will not work at 1-to-1 call.

    Declaration

    Swift

    public func unsetRoomSharedContents(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that will be called when the room shared contents are unset. The closure takes a Boolean value indicating whether the room shared contents were unset successfully or not.

Short Data

  • Sends short data to a peer in the room.

    The maximum size of type is 100 bytes and the maximum size of data is 800 bytes. If the completion callback is called with false, the session is not in .connected state or the data or type exceeds the size limit.

    If the short data is sent successfully, the completion callback is called with true.

    Declaration

    Swift

    @objc
    public func sendShortData(peerId: PlanetKitUserId, type: String, data: Data, completion: @escaping (Bool) -> Void)

    Parameters

    peerId

    Peer to receive short data.

    type

    User-defined data type to be sent along with data

    data

    Data to be sent

    completion

    Completion callback to receive the result of sending short data

  • Sends short data to all peers in the room.

    The maximum size of type is 100 bytes and the maximum size of data is 800 bytes. If the completion callback is called with false, the session is not in .connected state or the data or type exceeds the size limit.

    If the short data is sent successfully, the completion callback is called with true.

    Declaration

    Swift

    @objc
    public func sendShortData(type: String, data: Data, completion: @escaping (Bool) -> Void)

    Parameters

    type

    User-defined data type to be sent along with data

    data

    Data to be sent

    completion

    Completion callback to receive the result of sending short data

Statistics

Getter for Peer

Conference Management

  • Leaves the conference.

    Declaration

    Swift

    @objc
    public func leaveConference()
  • Holds the conference to interact with another call or OS operations.

    Declaration

    Swift

    @objc
    public func hold(reason: String?, completion: @escaping (Bool) -> Void)

    Parameters

    reason

    Maximum size of reason is 255 bytes with UTF-8 encoded string.

  • Unholds the conference to resume.

    Declaration

    Swift

    @objc
    public func unhold(completion: @escaping (Bool) -> Void)

Audio/Video State

  • Indicates whether the audio of the peer users is silenced.

    Declaration

    Swift

    @objc
    public var isPeersAudioSilenced: Bool { get }
  • Gets the call duration. If the duration is invalid, it returns -1.

    Declaration

    Swift

    @objc
    public var duration: TimeInterval { get }

Peer Audio/Media Control

  • Requests a targeted peer to mute or unmute audio.

    Declaration

    Swift

    @objc
    public func requestPeerMute(_ mute: Bool, peerId: PlanetKitUserId, completion: @escaping (Bool) -> Void)
  • Requests all peers to mute or unmute audio.

    Declaration

    Swift

    @objc
    public func requestPeersMute(_ mute: Bool, completion: @escaping (Bool) -> Void)
  • Pauses the local user’s video during a conference.

    Declaration

    Swift

    @objc
    public func pauseMyVideo(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that is called when the video is paused. The closure takes a Boolean value that indicates whether the video was successfully paused.

  • Resumes the local user’s video during a conference.

    Remark

    On macOS, if there is no available camera device, the function call will fail. It may be necessary to check in advance using PlanetKitCameraManager.isCameraAvailable.

    Declaration

    Swift

    @objc
    public func resumeMyVideo(completion: @escaping (Bool) -> Void)

    Parameters

    completion

    A closure that is called when the video is resumed. The closure takes a Boolean value that indicates whether the video was successfully resumed.

  • Mutes or unmutes the local user’s audio during a conference.

    Declaration

    Swift

    @objc
    public func muteMyAudio(_ mute: Bool, completion: @escaping (Bool) -> Void)

    Parameters

    mute

    A Boolean value that indicates whether to mute or unmute the audio.

    completion

    A closure that is called when the audio is muted or unmuted. The closure takes a Boolean value that indicates whether the audio was successfully muted or unmuted.

  • Makes all peers’ voice silent by removing speaker output.

    Declaration

    Swift

    public func silencePeersAudio(_ silent: Bool, completion: @escaping (Bool) -> Void)

Customize setting

  • This is debugging only function. (DO NOT USE IT)

    Declaration

    Swift

    @objc
    public func reload(_ setting: [String : Any])
  • A Boolean value indicating whether the conference is on hold.

    Declaration

    Swift

    @objc
    public var isOnHold: Bool { get }
  • The local user equipment type associated with the conference.

    Declaration

    Swift

    @objc
    public var myUserEquipmentType: PlanetKitUserEquipmentType { get }
  • The display name of the local user associated with the conference.

    Declaration

    Swift

    @objc
    public var myDisplayName: String? { get }

Monitoring

  • Gets the monitoring information string.

    Declaration

    Swift

    public func getMonitorInfo() -> String