Interface: StageStrategy
A StageStrategy dictates certain behavior on the [[Stage]]
Methods
preferredLayerForStream()?
optional
preferredLayerForStream(participant
,stream
):undefined
|string
|StageStreamLayer
Optionally return the preferred stream layer for a given participant. If defined, the returned [[StageStreamLayer]] will be used to change what video layer is delivered. This is used when a Publisher is sending Simulcast Layers, and allows the Subscriber to choose between those layers.
Parameters
• participant: StageParticipantInfo
• stream: RemoteStageStream
Returns
undefined
| string
| StageStreamLayer
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
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
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