# ParticipantListeners

## Public method Summary <a href="#sessionerror-publicconstructorsummary" id="sessionerror-publicconstructorsummary"></a>

| Methods                                                                                                                                           | Description                                                                                                                          | Parameters                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>onParticipantJoin(fn)</p><p></p><p>const fn = (partricipant) => { <code>//do smth }</code></p>                                                 | The Event handler will be invoked when new participant joined to the Session but haven't started streaming yet                       |                                                                                                                                                                     |
| <p>onParticipantLeft(fn)</p><p></p><p><code>const fn = ({participantId}) => { //do smth }</code></p>                                              | The Event handler will be invoked when the participant leaves the Session                                                            | <ul><li>participantId <em>-</em> unique identification of the user</li></ul>                                                                                        |
| <p>onParticipantSpeaking(fn)</p><p></p><p><code>const fn = ({participantId}) => { //do smth }</code></p>                                          | The Event handler will be invoked when the participant starts speaking                                                               |                                                                                                                                                                     |
| <p>onParticipantStopSpeaking(fn)</p><p></p><p><code>const fn = ({participantId}) => { //do smth }</code></p>                                      | The Event handler will be invoked when the participant stops speaking                                                                |                                                                                                                                                                     |
| onOrganizerReceived(fn)                                                                                                                           | The Event handler will be invoked when the user receives the organizer previlegious.                                                 | <ul><li>Fn - custom callback function without any parameters</li></ul>                                                                                              |
| <p>onParticipantMediaStreamChanged(fn)<br><br><code>const fn = ({participantId, mediaState, mediaType}) => { //do smth }</code></p><p></p><p></p> | <p>The Event handler will be invoked when a participant mute/unmute himself(audio or video).<br>Params object with keys:<br><br></p> | <ul><li>participantId -participant id which was muted</li><li>mediaType - allowed values Audio/Video</li><li>mediaState - allowed values Enabled/Disabled</li></ul> |
| <p>onParticipantRejected(fn)<br><br><code>const fn = (participant, message) => { //do smth }</code></p>                                           | The Event handler will be invoked when the participant was kicked from the session                                                   | <ul><li>participant - Participant object (who initiated a kick action)</li><li>message -  optional parameter to provide a reason of kick action</li></ul>           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.sceenic.co/watch-together-sdk/sscale-confluence-api-references/sscale-confluence-web-sdk-reference/sscale-confluence-participantlisteners-websdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
