Help Center/ SparkRTC/ SDK Reference/ Web SDK/ API Reference/ Stream Event Notification (RTCStreamEvent)
Updated on 2023-11-01 GMT+08:00

Stream Event Notification (RTCStreamEvent)

This section describes the RTCStreamEvent events of the Web SDK.

Table 1 StreamEvent events

API

Description

player-state-change

The player status is changed.

screen-sharing-stopped

Screen sharing is stopped.

audio-mixing-played

Local mixed audio is played.

audio-mixing-finished

Local mixed audio playback is stopped.

Registration listening must be canceled when the service ends. Otherwise, memory leakage may occur when there are a certain number of registration listening events.

player-state-change

[Event Description]

This event is triggered when the player state is changed.

[Callback Parameters]

event: The type is playState. The fields are defined as follows:

  • type: player type. The type is string. The options are video and audio.
  • id: stream resolution ID. The type is string.
  • state: current playback status. The type is string. The value is PLAYING, STOPPED, PAUSED, or NONE.
  • reason: reason that triggers the playback status change. The type is string.

screen-sharing-stopped

[Event Description]

This event is triggered only when local screen sharing is stopped.

[Callback Parameters]

event: stream ID when screen sharing is stopped. The type is string.

audio-mixing-played

[Event Description]

Mixed audio is played. This event is triggered only when the local mixed audio is played.

[Callback Parameters]

None

audio-mixing-finished

[Event Description]

Mixed audio playback ends. This event is triggered only when the local mixed audio playback ends.

This event is not triggered when you manually call stopAudioMixing and pauseAudioMixing.

[Callback Parameters]

None