Options
All
  • Public
  • Public/Protected
  • All
Menu

The video client is the core of the Video SDK.

Index

Functions

  • Renames your name or another user's name.

    • Only the host or manager can rename others.
    • The host can set whether the user is allowed to rename themselves. See client.isAllowToRename() to get the value.

    Parameters

    • name: string

      New display name.

    • Optional userId: number

      User ID of the user to rename.

    Returns ExecutedResult

  • Get the in-session participants of the session.

    Returns Participant[]

  • getMediaStream(): typeof Stream
  • Gets the media stream instance for managing the media.

    This usually the first step of using media.

    Returns typeof Stream

  • Gets the host of the session.

    Returns Participant | undefined

  • Gets the current session’s information.

    Returns SessionInfo

  • Gets the user by user ID.

    Parameters

    • userId: number

    Returns Participant | undefined

  • getVoiceTranslatorClient(): typeof VoiceTranslatorClient
  • Gets the voiceTranslator client.

    Returns typeof VoiceTranslatorClient

  • Initializes the Zoom Video SDK before join a session. The Zoom Video SDK uses an SDK key & secret for authorization.

    Parameters

    • language: string

      The language of the Video SDK interface. Defaults to en-US.

    • dependentAssets: string

      Specifies the source path for the SDK's dependent assets. The Zoom Video SDK uses Web Workers and WebAssembly to process media streams. These components are distributed separately from the SDK, and you must specify the path where they are hosted. Each SDK release includes these assets in the lib folder. You can host the assets on your own server or use the paths provided by Zoom:

      • Global (default): Loads assets from https://source.zoom.us/videosdk/{version}/lib/. Recommended for most use cases.
      • CDN: Loads assets from https://dmogdx0jrul3u.cloudfront.net/videosdk/{version}/lib/. Recommended for global users when users include those in China.
      • CN: Loads assets from https://jssdk.zoomus.cn/videosdk/{version}/lib. Recommended if users are located exclusively in China.
      • Custom path ({FULL_ASSETS_PATH}): Loads assets from a developer-specified path. Not recommended except for special deployment cases.
    • Optional options: InitOptions

      Optional additional settings for SDK initialization.

    Returns ExecutedResult

    An ExecutedResult indicating whether initialization succeeded.

  • isHost(): boolean
  • Determines whether the current user is the host.

    Returns boolean

  • isManager(): boolean
  • Determines whether the current user is a manager.

    Returns boolean

  • isOriginalHost(): boolean
  • Determines whether the current user is the original host. role_type in JWT payload =1 is the original host.

    Returns boolean

  • join(topic: string, token: string, userName: string, sessionPassword?: string, sessionIdleTimeoutMins?: number): ExecutedResult
    • Make sure to call the init method before joining.

    Parameters

    • topic: string

      Required. A session name of your choice or the name of the session you are joining (must match the SWK JWT tpc value).

    • token: string

      Required. Your Video SDK JWT, which you should generate on the server.

    • userName: string

      Required. A name for the user.

    • Optional sessionPassword: string

      Optional, unless it was set with the host. A session password of your choice. If set with the host, all attendees must provide the same password value or they will fail to join the session.

    • Optional sessionIdleTimeoutMins: number

      Optional. The number of minutes your session can idle before ending, with one user present and without cloud recording. The default is 40 minutes.

      Note: This parameter only applies to the session host or original host; otherwise, the default value of 40 minutes will be used.

    Returns ExecutedResult

    an executed promise. Following are the possible error reasons:

    • duplicated operation: Duplicated invoking of the join method.
    • invalid apiKey/sdkKey or signature: API key, SDK key, or signature is not correct.
    • invalid password: Password is not correct.
    • invalid parameters: Can not join the session because of invalid parameters.
    • internal error: Internal error.
  • Leaves or ends the session.

    Parameters

    • Optional end: boolean

      Optional. Default is false. If true, the session ends. Only the host has the privilege to do this.

    Returns ExecutedResult

  • Makes other participant the host.

    • Only the host can make someone else the host.
    • There is only one host in a session. Once the host makes another user the host, the original host will no longer be the host.

    Parameters

    • userId: number

    Returns ExecutedResult

  • Makes another participant a manager.

    • Only the host can make others into managers.
    • There may be multiple managers in session.

    Parameters

    • userId: number

    Returns ExecutedResult

  • off(event: string, callback: ((payload: any) => void)): void
  • Removes the event handler.

    Parameters

    • event: string

      Event name.

    • callback: ((payload: any) => void)

      The event handler.

        • (payload: any): void
        • Parameters

          • payload: any

          Returns void

    Returns void

  • Reclaims the host privilege if the user is now the host.

    • Only the original host can do this.

    Returns ExecutedResult

  • Removes the participant.

    • Only the host or manager can remove others.

    Parameters

    • userId: number

    Returns ExecutedResult

  • Revokes the manager permission from the participant.

    • Only the host can revoke manager permissions.

    Parameters

    • userId: number

    Returns ExecutedResult