Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SyncSDK

Index

Constructors

constructor

Methods

addPlayerClient

  • Attaches player decorator to the SyncSDK instance if not yet attached.

    Parameters

    Returns void

attachListener

  • attachListener(listener: any, event: Events): void
  • Used to attach listeners. Only one listener can be attached per type/event at a time, if there was already a listener attached for the type/event it will be overridden.

    Parameters

    Returns void

createGroup

  • createGroup(token: string, clientName: string, passiveClient?: boolean): Promise<void | SyncError>
  • Used for creating or joining a synchronization group. Stops synchronization.

    Parameters

    • token: string

      JWT access token from CAS

    • clientName: string

      Client name for referencing

    • passiveClient: boolean = false

      Defines if client is passive. Passive client's position can not be used as a reference for server time initialization. Default is false.

    Returns Promise<void | SyncError>

    Promise which either successfully resolves or rejects with SyncError

groupChangeVolume

  • groupChangeVolume(volume: number): void
  • Sends volume change command to other clients in a group.

    Parameters

    • volume: number

      The volume to set between 0 (silent) and 1 (max volume)

    Returns void

groupPause

  • groupPause(): void
  • Sends pause command to other clients in a group.

    Returns void

groupPlay

  • groupPlay(): void
  • Sends play command to other clients in a group.

    Returns void

muteGroup

  • muteGroup(): void
  • Sends mute command to other clients in a group.

    Returns void

removeListener

  • removeListener(type: Events): void
  • Used to remove listeners. As only one listener can be attached per type/event at a time, there is no need to pass the reference to the callback function.

    Parameters

    Returns void

sendEventToGroup

  • sendEventToGroup(payload: any): void
  • Sends arbitrary payload to other clients in a group.

    Parameters

    • payload: any

    Returns void

sendMessageToGroup

  • sendMessageToGroup(message: string): void
  • Sends chat message to other clients in a group and calls Events.chat_update listener with the message.

    Parameters

    • message: string

    Returns void

setGroupPosition

  • setGroupPosition(delta?: number): void

setLogLevel

  • Sets the level of SyncSDK log outputs.

    Please note that especially DEBUG level should not be used for production environments as this can decrease performance, especially for long-term playback, due to the amount of log messages.

    Default is LogLevels.WARN.

    Parameters

    Returns void

startSynchronize

  • startSynchronize(): Promise<void | SyncError>

stopSynchronize

  • stopSynchronize(): void

unmuteGroup

  • unmuteGroup(): void
  • Sends unmute command to other clients in a group.

    Returns void