Skip to main content
Version: v1.15.0

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

participant: StageParticipantInfo

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

participant: StageParticipantInfo

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[]


subscribeConfiguration()?

optional subscribeConfiguration(participant): SubscribeConfiguration

Optionally return the subscribe configuration for a given participant. If given, the returned [[SubscribeConfig]] will be merged against SDK default values. If not given, the default values will be applied.

Parameters

participant: StageParticipantInfo

Returns

SubscribeConfiguration