Skip to main content
Version: 2.x.x

VideoSurface Callbacks - Unity


OnStreamEnabledCallback​

The OnStreamEnabledCallback is triggered when a media stream (audio or video) is enabled for the participant.

Parameters​

  • kind: StreamKind
    • Specifies the type of stream that was enabled.
      Possible values:
      • StreamKind.AUDIO
      • StreamKind.VIDEO

Usage​

Use this callback to update UI or application logic when a participant enables their audio or video stream.

Example​

participant.OnStreamEnabledCallback += (kind) =>
{
Debug.Log($"{participant.ParticipantName}'s {kind} stream is now enabled.");
};

OnStreamDisabledCallback​

The OnStreamDisabledCallback is triggered when a media stream (audio or video) is disabled for the participant.

Parameters​

  • kind: StreamKind
    • Specifies the type of stream that was disabled.
      Possible values:
      • StreamKind.AUDIO
      • StreamKind.VIDEO

Usage​

Use this callback to update the UI or internal state when a participant disables their microphone or camera.

Example​

participant.OnStreamDisabledCallback += (kind) =>
{
Debug.Log($"{participant.ParticipantName}'s {kind} stream has been disabled.");
};

Got a Question? Ask us on discord