# SynchListener

Interface SynchListener monitors all events from the SynchSdk.

The SynchListener is created together with the SynchSdk instance.

## Public Method Summary <a href="#public-method-summary" id="public-method-summary"></a>

| Type  | Methods                                                                                        | Parameters                                                                                                                                                                                     |
| ----- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void  | onClientList(clientList: \[Client]) - List of all participants in the synchronization group    | <ul><li>clientList - The list of connected clients in the group</li></ul>                                                                                                                      |
| void  | onSetPlaybackRate(rate: Float) - Set playback rate                                             | <ul><li>rate - Playback rate</li></ul>                                                                                                                                                         |
| void  | onPlaybackFromPosition(position: Int)- Playback from position, similar to seek to the position | <ul><li><p>position - Recieve the value for the groupSeek functionality.</p><ul><li>The value is in ms and represents the point from which the Player should start to play</li></ul></li></ul> |
| Int   | onGetPlayerPosition() -> Int - Get player position                                             | <ul><li>position - The value is in ms. The actual Player current position, must be implemented and return a value</li></ul>                                                                    |
| Float | onGetPlaybackRate() -> Float - Get playback rate                                               | <ul><li>The actual Player rate/speed. Must be implemented and return a value</li></ul>                                                                                                         |
| void  | onSyncInfo(accuracy: Float, delta: Int) - Synchronization information about delta and accuracy | <ul><li>accuracy - synchronization accuracy</li><li>delta - synchronization delta</li></ul>                                                                                                    |
| void  | onPause()                                                                                      | receive group pause event                                                                                                                                                                      |
| void  | onResumePlay()                                                                                 | receive group play event                                                                                                                                                                       |

### Client model description

| Type   | Field  | Description                                   |
| ------ | ------ | --------------------------------------------- |
| String | name   | clients name                                  |
| String | id     | clients id                                    |
| Bool   | leader | abstract flag if client is leader/syncronizer |
| Bool   | local  | if client from client list is a local client  |
