IVSStageStrategy
Objective-C
@protocol IVSStageStrategy
Swift
protocol IVSStageStrategy
The Strategy is the decision engine associated with an IVSStage
. It is how the Stage asks the host application what actions to take.
If the host application wants to change their answer to a question, they can call [IVSStage refreshStrategy]
.
-
Return an array of media streams to publish with the associated participant. If the return value of this function changes, call
[IVSStage refreshStrategy]
to use the new streams.Declaration
Objective-C
- (nonnull NSArray<IVSLocalStageStream *> *)stage:(nonnull IVSStage *)stage streamsToPublishForParticipant: (nonnull IVSParticipantInfo *)participant;
Swift
func stage(_ stage: IVSStage, streamsToPublishForParticipant participant: IVSParticipantInfo) -> [IVSLocalStageStream]
Parameters
stage
The
IVSStage
to publish the streams to.participant
The participant in question.
-
Return
true
to publish the associated participant, orfalse
to not publish them. If the return value of this function changes, call[IVSStage refreshStrategy]
update the local publishing state This will only be invoked on participants that have the publish capability.Declaration
Objective-C
- (BOOL)stage:(nonnull IVSStage *)stage shouldPublishParticipant:(nonnull IVSParticipantInfo *)participant;
Swift
func stage(_ stage: IVSStage, shouldPublishParticipant participant: IVSParticipantInfo) -> Bool
Parameters
stage
The
IVSStage
associated with the participant.participant
The participant in question.
-
Return the
IVSStageSubscribeType
corresponding to the type of media streams desired from the associated participant. This will only be invoked on participants that have the subscribe capability.Declaration
Objective-C
- (IVSStageSubscribeType)stage:(nonnull IVSStage *)stage shouldSubscribeToParticipant:(nonnull IVSParticipantInfo *)participant;
Swift
func stage(_ stage: IVSStage, shouldSubscribeToParticipant participant: IVSParticipantInfo) -> IVSStageSubscribeType
Parameters
stage
The
IVSStage
associated with the participant.participant
The participant in question.
-
Return the
IVSSubscribeConfiguration
to subscribe to the associated participant. This will only be invoked on participants that have the subscribe capability.Declaration
Objective-C
- (nonnull IVSSubscribeConfiguration *)stage:(nonnull IVSStage *)stage subscribeConfigurationForParticipant: (nonnull IVSParticipantInfo *)participant;
Swift
optional func stage(_ stage: IVSStage, subscribeConfigurationForParticipant participant: IVSParticipantInfo) -> IVSSubscribeConfiguration
Parameters
stage
The
IVSStage
associated with the participant.participant
The participant in question.