SynchSDK
Public Method Summary
Methods
Parameters
createGroup(groupId: string, clientName: string)
Create a synchronization group.
groupId - Unique identification for clients group.
Max length is 255 chars
clientName - Name of user for showing in list of user and chat name.
addPlayer( player: Player, playerType: PlayerType) Connect the UI player element with SDK.
player - Client object extends ClientDecorator and implemented base interface Client.
playerType - Supporting player type.
Supported players:
PlayerType {
html,
youtube,
nexplayer,
Flowplayer,
vo_player
}
startSynchronize()
Create WebSocket connection and start the synchronization proccess.
stopSynchronize()
Close the WebSocket connection and finish synchronization proccess.
attachListener(callback: func, type: Callbaks )
Attach listener to get updates for - delta, speed, group updates.
callback - The function is called when the observable value is changed.
type - Callback type to observe delta, speed, etc.
Callbacks { sync_accuracy_change, delta_change, speed_change, leader_update, chat_update, client_list_update,
receive_command,
error
}
groupPause(), groupPlay(), muteGroup(), changeVolume(volume: number )
Methods for group remote control.
volume - The volume scale is between 0 and 1
sendEventToGroup(message: any)
Send any data to all clients in the current group.
message - Any data type message - can be used for a implemented any events or command in a group.
setGroupPosition(position?: number)
Set position on a timeline for all clients in the group. Do not recommend using it for the live stream.
position - Position on timeline who should be set for all clients of current group. By default SDK selected the position current client and send it to the group.
sendMessageToGroup(message: string)
Send a message to all clients in the current group.
message - String message - can be used for a customer message or for chat.
getOffset(): number
Get the real offset to first load fragment for the HLS stream (only for HLS streams).
setOffset(offset: number)
Manually set stream offset.
Last updated
Was this helpful?