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
stageThe
IVSStageto publish the streams to.participantThe participant in question.
-
Return
trueto publish the associated participant, orfalseto 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) -> BoolParameters
stageThe
IVSStageassociated with the participant.participantThe participant in question.
-
Return the
IVSStageSubscribeTypecorresponding 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) -> IVSStageSubscribeTypeParameters
stageThe
IVSStageassociated with the participant.participantThe participant in question.