IVSStageRenderer

Objective-C

@protocol IVSStageRenderer <NSObject>

Swift

protocol IVSStageRenderer : NSObjectProtocol

A protocol to implement that can be used to build user interfaces. Implementing a IVSStageRenderer provides all the necessary information about a Stage to create a complete UI.

  • The connection state of the associated IVSStage has changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
        didChangeConnectionState:(IVSStageConnectionState)connectionState
                       withError:(nullable NSError *)error;

    Swift

    optional func stage(_ stage: Any!, didChangeConnectionState connectionState: Any!, withError error: (any Error)?)

    Parameters

    stage

    The IVSStage that had the connection state change.

    connectionState

    The new connection state of the Stage.

    error

    An error, if the state unexpected turned to disconnected.

  • A new participant has joined the Stage and started publishing.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
        participantDidJoin:(nonnull IVSParticipantInfo *)participant;

    Swift

    optional func stage(_ stage: Any!, participantDidJoin participant: IVSParticipantInfo)

    Parameters

    stage

    The IVSStage that the participant joined and started publishing.

    participant

    A description of the participant that joined and started publishing.

  • A participant has been updated. Unlike other renderer methods, this will be a new IVSParticipantInfo object. It will share a participantId and isLocal value with an existing participant, but other properties may have changed. IVSParticipantInfo.userInfo is not copied from the old instance to this new instance. If you are storing information in userInfo, it will need to manually be copied over.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
        participantMetadataDidUpdate:(nonnull IVSParticipantInfo *)participant;

    Swift

    optional func stage(_ stage: Any!, participantMetadataDidUpdate participant: IVSParticipantInfo)

    Parameters

    stage

    The IVSStage that the participant that was updated.

    participant

    The updated participant with different property values.

  • A participant has left the Stage or stopped publishing.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
        participantDidLeave:(nonnull IVSParticipantInfo *)participant;

    Swift

    optional func stage(_ stage: Any!, participantDidLeave participant: IVSParticipantInfo)

    Parameters

    stage

    The IVSStage that the participant left or stopped publishing.

    participant

    A description of the participant that left or stopped publishing.

  • The publish state of a participant has changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
                  participant:(nonnull IVSParticipantInfo *)participant
        didChangePublishState:(IVSParticipantPublishState)publishState;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, didChange publishState: IVSParticipantPublishState)

    Parameters

    stage

    The IVSStage associated with the participant that changed their publish state.

    participant

    The participant that changed their publish state.

    publishState

    The new publish state.

  • The subscribe state of the local participant has changed with respect to a remote publisher. This callback only fires when the local participant’s subscribe state changes. Participants are not made aware of subscription updates for other participants via this callback.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
                    participant:(nonnull IVSParticipantInfo *)participant
        didChangeSubscribeState:(IVSParticipantSubscribeState)subscribeState;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, didChange subscribeState: IVSParticipantSubscribeState)

    Parameters

    stage

    The IVSStage associated with the participant that changed their subscribe state.

    participant

    The publishing participant for whom the local participant has changed their subscribe state.

    subscribeState

    The new subscribe state.

  • A participant added media streams that can be rendered locally or attached to an IVSBroadcastSession.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
          participant:(nonnull IVSParticipantInfo *)participant
        didAddStreams:(nonnull NSArray<IVSStageStream *> *)streams;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, didAdd streams: [IVSStageStream])

    Parameters

    stage

    The IVSStage associated with the new media streams.

    participant

    The participant associated with the new media streams.

    streams

    The new media streams.

  • A participant removed media streams. They could have unpublished or stopped sharing a certain media type.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
             participant:(nonnull IVSParticipantInfo *)participant
        didRemoveStreams:(nonnull NSArray<IVSStageStream *> *)streams;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, didRemove streams: [IVSStageStream])

    Parameters

    stage

    The IVSStage associated with the removed media streams.

    participant

    The participant associated with the removed media streams.

    streams

    The removed media streams.

  • Some media streams have had their muted status changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
                  participant:(nonnull IVSParticipantInfo *)participant
        didChangeMutedStreams:(nonnull NSArray<IVSStageStream *> *)streams;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, didChangeMutedStreams streams: [IVSStageStream])

    Parameters

    stage

    The IVSStage associated with the updated media streams.

    participant

    The participant associated with the updated media streams.

    streams

    The media streams that have had their mute status changed.

  • Some remote stream have had its layers changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
                  participant:(nonnull IVSParticipantInfo *)participant
                       stream:(nonnull IVSRemoteStageStream *)stream
        didChangeStreamLayers:
            (nonnull NSArray<IVSRemoteStageStreamLayer *> *)layers;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, stream: IVSRemoteStageStream, didChange layers: [IVSRemoteStageStreamLayer])

    Parameters

    stage

    The IVSStage associated with the remote stream.

    participant

    The participant associated with the remote stream.

    stream

    The remote stream that have had its layers changed.

    layers

    The updated layers.

  • Some remote stream have had its selected layer changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
                 participant:(nonnull IVSParticipantInfo *)participant
                      stream:(nonnull IVSRemoteStageStream *)stream
        didSelectStreamLayer:(nullable IVSRemoteStageStreamLayer *)layer
                      reason:(IVSRemoteStageStreamLayerSelectedReason)reason;

    Parameters

    stage

    The IVSStage associated with the remote stream.

    participant

    The participant associated with the remote stream.

    stream

    The remote stream that have had its layers changed.

    layer

    The updated selected layer.

    reason

    The reason that slected layer changed.

  • Some remote stream have had its adaption changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
                    participant:(nonnull IVSParticipantInfo *)participant
                         stream:(nonnull IVSRemoteStageStream *)stream
        didChangeStreamAdaption:(BOOL)adaption;

    Swift

    optional func stage(_ stage: Any!, participant: IVSParticipantInfo, stream: IVSRemoteStageStream, didChangeStreamAdaption adaption: Bool)

    Parameters

    stage

    The IVSStage associated with the remote stream.

    participant

    The participant associated with the remote stream.

    stream

    The remote stream that have had its adaption changed.

    adaption

    Whether dynamic adaption is enabled.

  • Warning

    This API is in beta and will not be invoked. The number of subscribers to the Stage has changed.

    Declaration

    Objective-C

    - (void)stage:(nonnull IVSStage *)stage
        didChangeSubscriberCount:(NSInteger)subscriberCount;

    Swift

    optional func stage(_ stage: Any!, didChangeSubscriberCount subscriberCount: Int)

    Parameters

    stage

    The IVSStage associated with the subscriber count change

    subscriberCount

    The number of subscribers to this Stage. If a single participant subscribes to multiple publishers, that still counts as 1 subscriber. Publishers do not count as subscribers unless they themselves are also subscribing.