Skip to content

Multi Stream Video Pinning

adamrangs edited this page Aug 24, 2022 · 1 revision

Multi-stream - Pin Stream

With the pin stream feature, you can pin any participant in the meeting and that stream will not change when the stream user speaks and it will also not get replaced with the user in the queue when the queue user speaks.

NOTE: The below new APIs are available from SDK version 3.6.0 onwards.

  • The pinning feature comes under Category-C APIs.
  • The pin stream will not come to the active speaker stage.

Typical Scenario

In a meeting with more than two participants, if you want to see the active speaker along with other joined participants, you can use multi-stream to achieve it.

How to Use

This is the continuation of Multi Stream in SDK 3.5 Using Categories wiki page.

1. setMediaStreamCategoryC

If a pinned stream for the participant with participantId already exists, update the stream with the specified parameters. Otherwise, add a pinned stream for this participantId.

fun setMediaStreamCategoryC(participantId: String, quality: MediaStreamQuality)
enum class MediaStreamQuality {
   Undefined,
   LD,  // 180p
   SD,  // 360p
   HD,  // 720p
   FHD // 1080p
}

2. removeMediaStreamCategoryC

Remove the stream of pinned participant.

fun removeMediaStreamCategoryC(participantId: String)

3. isMediaStreamsPinningSupported

Return True if the pinning is supported for the media streams.

fun isMediaStreamsPinningSupported() : Boolean

4. OnMediaStreamInfoChanged Listener

We support different event types - MediaStreamChangeEventType. If any of the types changes concerning the stream, the event will get triggered.

enum class MediaStreamChangeEventType {
    Size,
    Membership,
    Video,
    Audio,
    PinState
}

The client can register the info change listener to receive the event change.

fun setOnMediaStreamInfoChanged(listener: (type: MediaStreamChangeEventType, info: MediaStreamChangeEventInfo) -> Unit)
Clone this wiki locally