Skip to main content
Version: v1.10.1

Interface: StageStrategy

A StageStrategy dictates certain behavior on the Stage

Methods

shouldPublishParticipant

shouldPublishParticipant(participant): boolean

Should return true if you wish to publish to the Stage otherwise return false.

Parameters

NameType
participantStageParticipantInfo

Returns

boolean


shouldSubscribeToParticipant

shouldSubscribeToParticipant(participant): SubscribeType

Should return whether or not you wish to subscribe to a given participant. Return SubscribeType.AUDIO_VIDEO to subscribe to audio and video. Return SubscribeType.AUDIO_ONLY to subscribe to just audio. Return SubscribeType.NONE to not subscribe at all. This will be invoked after a new participant joins or against every participant when Stage.refreshStrategy is called

Parameters

NameType
participantStageParticipantInfo

Returns

SubscribeType


stageStreamsToPublish

stageStreamsToPublish(): LocalStageStream[]

Should return the local streams that should be published to the stage. This will be invoked during the Stage.join call and every subsequent Stage.refreshStrategy call. This will not be invoked if StageStrategy.shouldPublishParticipant returns false

Returns

LocalStageStream[]