PlanetKitSubgroupManager

public class PlanetKitSubgroupManager : NSObject

The manager class for PlanetKit subgroups.

  • The main room of the subgroups in a conference.

    Remark

    The main room is the default subgroup that all peers are subscribed to when they join the conference. The subgroup name of the main room is nil.

    Declaration

    Swift

    @objc
    public internal(set) var mainRoom: PlanetKitSubgroup { get }
  • List of all the subgroups in the conference.

    Declaration

    Swift

    @objc
    public var subgroups: [PlanetKitSubgroup] { get }

Subgroup Subscription

Subgroup Media Route

  • Changes the local user’s destination subgroup of the video to a specific subgroup.

    Declaration

    Swift

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

    Parameters

    subgroupName

    The name of the subgroup.

    completion

    A closure that is called when the operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful or not.

  • Changes the local user’s destination subgroup of the video to the main room.

    Declaration

    Swift

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

    Parameters

    completion

    A closure that is called when the operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful or not.

  • Changes the local user’s destination subgroup of the audio to a specific subgroup.

    Declaration

    Swift

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

    Parameters

    subgroupName

    The name of the subgroup.

    completion

    A closure that is called when the operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful or not.

  • Changes the local user’s destination subgroup of the audio to the main room.

    Declaration

    Swift

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

    Parameters

    completion

    A closure that is called when the operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful or not.

  • Sets the tag for the local user’s audio in the main room.

    Declaration

    Swift

    @objc
    public func setTagMyAudioOfMainRoom(taggedSubgroupName: String, completion: @escaping (Bool) -> Void)

    Parameters

    taggedSubgroupName

    The name of the subgroup to tag the audio with.

    completion

    A closure that is called when the operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful or not.

  • Clears the tag for the local user’s audio in the main room.

    Declaration

    Swift

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

    Parameters

    completion

    A closure that is called when the operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful or not.

Subgroup Volume Control

  • Sets the peer volume level.

    Declaration

    Swift

    @objc
    public func setPeerVolumeLevelSetting(_ volumeLevel: Int8, peerId: PlanetKitUserId, subgroupName: String?, allSubgroupsPeerSubscribed: Bool, completion: @escaping (Bool) -> Void)

    Parameters

    volumeLevel

    The audio volume range in percentage from 0 to 110. The 0 value is muted, 100 is original, and 110 will amplify original volume to +9dB.

    peerId

    Target peer’s ID.

    subgroupName

    Subgroup’s name, where nil means the main room.

    allSubgroupsPeerSubscribed

    If this is true, the peer volume will be changed in all subgroups that the target peer is subscribed to.

    completion

    The callback of completion event.

  • Silences or unsilences the target subgroup’s audio.

    Declaration

    Swift

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

    Parameters

    subgroupName

    Target subgroup name. Use nil for the main room.

    silenced

    Set true to silence or false to unsilence.

    completion

    The callback of completion event.

  • Enables auto volume control with focus subgroup names.

    Remark

    You should provide all subgroup names at once to enable auto volume control. If you exclude subgroup names, it will be disabled automatically.

    Declaration

    Swift

    @objc
    public func setPeersAudioAutoVolumeControl(focusSubgroupNames: [String], focusMainRoom: Bool, completion: @escaping (Bool) -> Void)

    Parameters

    focusSubgroupNames

    Array of subgroup names to enable auto volume control.

    focusMainRoom

    Set true when you want to enable auto volume control on the main room.

    completion

    The callback of completion event.

  • Disables all auto volume control.

    Declaration

    Swift

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