Options
All
  • Public
  • Public/Protected
  • All
Menu

@zoom/videosdk

Index

Type aliases

ClosedReason

ClosedReason: "kicked by host" | "ended by host" | "expeled by host"

Reason of the meeting closed

  • kicked by host: Been kicked by the host.
  • ended by host: The meeting is ended by the hose.
  • expeled by host: Been expeled by the host.

ErrorTypes

ErrorTypes: "INVALID_OPERATION" | "INTERNAL_ERROR" | "OPERATION_TIMEOUT" | "INSUFFICIENT_PRIVILEGES" | "IMPROPER_MEETING_STATE" | "INVALID_PARAMETERS" | "OPRATION_LOCKED"

Define error types of operations.

  • INVALID_OPERATION: The operation is invalid, perhaps causeed by the duplicated operations.
  • INTERNAL_ERROR: The remote service is temporarily unavailable.
  • INSUFFICIENT_PRIVILEGES: The operation is only applicable for host or manager.
  • OPERATION_TIMEOUT: The operation is timeout, try again later.
  • IMPROPER_MEETING_STATE: The user is not in meeting, refer to the relevant reason for the detail.
  • closed: The meeting is not joined.
  • on hold: You are on hold.
  • reconnecting: The meeting is reconnecting.
  • INVALID_PARAMETERS: The parameters passing to the method is invala, perhaps the wrong user id or the wrong value, refer to the relevant reason for the detail.
  • OPERATION_LOCKED: The operation can not be completed because the relevant property is locked, refer to the relevant reason for the detail.

ExecutedResult

ExecutedResult: Promise<"" | ExecutedFailure>

The result of asynchronous operation. It is a promise object.

  • '': Success
  • ExecutedFailure: Failure. Use .catch(error=>{}) or try{ *your code* }catch(error){} to handle the errors.

ReconnectingReason

ReconnectingReason: "failover"

Reason of the meeting reconnecting

  • on hold: From on hold to into meeting.
  • failover: Remote server disconnect unexpectedly.
  • promote|depromote: From attendee to panelist and vice versa.

Events

event_active_share_change

  • event_active_share_change(payload: { state: "Active" | "Inactive"; userId: number }): void
  • Occurs when some participant is start sharing screen

    client.on('active-share-change',payload=>{
     if(payload.state==='Active'){
      stream.startRenderScreenShare(payload.userId,canvas);
     }else if(payload.state==='Inactive'){
      stream.stopRenderScreenShare();
     }
    })
    

    Parameters

    • payload: { state: "Active" | "Inactive"; userId: number }
      • state: "Active" | "Inactive"
      • userId: number

    Returns void

event_audio_active_speaker

  • Occurs when some participants in meeting are talking

    client.on('active-speaker', (payload) => {
       console.log(`Active user:`,payload);
    });
    

    Parameters

    • payload: ActiveSpeaker[]

      active user

      • Distinguish activity level by the volume, the bigest is the first element.

    Returns void

event_audio_unmute_consent

  • event_audio_unmute_consent(payload: { reason: "Spotlight" | "Unmute" | "Allow to talk" }): void
  • Occurs when host ask you to unmute audio.

    Parameters

    • payload: { reason: "Spotlight" | "Unmute" | "Allow to talk" }

      the event detail

      • reason:
      • Spotlight: Host spotlighted you, and if you are muted, you will receive the consent.
      • Unmute: Host ask you to unmute audio.
      • Allow to talk: You are an attendee of a webinar, the host allowed you to talk.
      client.on('unmute-audio-consent', (payload) => {
         console.log(payload.reason);
      });
      
      • reason: "Spotlight" | "Unmute" | "Allow to talk"

    Returns void

event_chat_delete_message

  • event_chat_delete_message(payload: { id: string }): void
  • Occurs when message is deleted

    Parameters

    • payload: { id: string }

      id of message

      client.on('chat-delete-message',payload=>{
       console.log('from %s, message:%s',payload.sender.name,payload.message);
      })
      
      • id: string

    Returns void

event_chat_privilege_change

  • event_chat_privilege_change(payload: { chatPrivilege: ChatPrivilege }): void
  • Occurs when the host change the privilege of chat

    Parameters

    • payload: { chatPrivilege: ChatPrivilege }

      the event detail

      client.on('chat-privilege-change',payload=>{
       console.log(payload.chatPrivilege);
      })
      

    Returns void

event_chat_received_message

  • event_chat_received_message(payload: ChatMessage): void
  • Occurs when receive a chat

    Parameters

    • payload: ChatMessage

      the event detail

      client.on('chat-on-message',payload=>{
       console.log('from %s, message:%s',payload.sender.name,payload.message);
      })
      

    Returns void

event_connection_change

  • Occurs when the connection is changed.

    Parameters

    Returns void

event_current_audio_change

  • event_current_audio_change(payload: { action: "join" | "leave" | "muted" | "unmuted"; source?: "active" | "passive(mute all)" | "passive(mute one)" | "passive"; type?: "phone" | "computer" }): void
  • Occurs when current audio is changed

    Parameters

    • payload: { action: "join" | "leave" | "muted" | "unmuted"; source?: "active" | "passive(mute all)" | "passive(mute one)" | "passive"; type?: "phone" | "computer" }

      the event detail

      • action
      • join: Join the audio. refer to the type attribute get the detail.
      • leave: Leave the audio.
      • muted: Audio muted, refer to the source attribute get the detail.
      • unmuted: Audio unmuted,refer to the source attribute get the detail.
      • type
      • `computer': Join by the computer audio.
      • phone: Join by the phone.
      • source
      • active: User active action.
      • passive(mute all): Muted due to the host muted all.
      • passive(mute one): Muted due to the host muted you.
      • passive: Umnuted due to the host unmuted you.
      client.on('current-audio-change', (payload) => {
         if(payload.action==='join'){
          console.log('Joined by ',payload.type);
         }
      });
      
      • action: "join" | "leave" | "muted" | "unmuted"
      • Optional source?: "active" | "passive(mute all)" | "passive(mute one)" | "passive"
      • Optional type?: "phone" | "computer"

    Returns void

event_device_change

  • event_device_change(): void
  • Occurs when add or remove the microphone/speaker/camera

    Returns void

event_media_sdk_change

  • Occurs when the encode or decode state of media sdk changes

    Parameters

    Returns void

event_passively_stop_share

event_peer_share_state_change

  • event_peer_share_state_change(payload: { action: "Start" | "Stop"; userId: number }): void
  • Occurs when some participant starts or stops screen share.

    client.on('peer-share-state-change',payload=>{
     if(payload.action==='Start'){
      console.log(`user:${payload.userId} starts share`);
     }else if(payload.action==='Stop'){
     console.log(`user:${payload.userId} stops share`);
     }
    })
    

    Parameters

    • payload: { action: "Start" | "Stop"; userId: number }
      • action: "Start" | "Stop"
      • userId: number

    Returns void

event_peer_video_state_change

  • event_peer_video_state_change(payload: { action: "Start" | "Stop"; userId: number }): void
  • Occurs when other participants start/stop video

    Parameters

    • payload: { action: "Start" | "Stop"; userId: number }
      • action: "Start" | "Stop"
      • userId: number

    Returns void

event_share_content_change

  • event_share_content_change(payload: { userId: number }): void
  • Occurs when received shared content automatically changed

    • Maybe host start new sharing, received shared content will be automatically changed

    Parameters

    • payload: { userId: number }
      • userId: number

    Returns void

event_share_content_dimension_change

  • event_share_content_dimension_change(payload: { height: number; type: "sended" | "received"; width: number }): void
  • Occurs when shared content dimension change

    client.on('share-content-dimension-change',payload=>{
     viewportElement.style.width = `${payload.width}px`;
     viewportElement.style.height = `${payload.height}px`;
    })
    

    Parameters

    • payload: { height: number; type: "sended" | "received"; width: number }
      • height: number
      • type: "sended" | "received"
      • width: number

    Returns void

event_share_privilege_change

  • event_share_privilege_change(payload: { privilege: SharePrivilege }): void

event_user_add

  • Occurs when new participant join the meeting

    client.on('user-added',(payload)=>{
     // You can refresh the participants when
     const participants = client.getParticipantsList();
    })
    

    Parameters

    Returns void

event_user_remove

event_user_update

event_video_active_change

  • event_video_active_change(payload: { state: VideoActiveState; userId: number }): void
  • Occurs when remote video stream changes.

    client.on('video-active-change', async(payload) => {
      try {
        if (payload.state === 'Active') {
          await stream.renderVideo(canvas,userId,1280,720,0,0,3);
        } else {
          await astream.stopRenderVideo();
        }
      } catch (error) {
        console.log(error);
      }
    });
    

    Parameters

    Returns void

event_video_capturing_change

  • Occurs when local video capture stream changes.

    client.on('video-capturing-change', (payload) => {
      try {
        if (payload.state === 'Started') {
          console.log('Capture started');
        } else if (payload.state === 'Stopped') {
          console.log('Capture stopped');
        } else {
          console.log('Stop capturing Failed');
        }
      } catch (error) {
        console.log(error);
      }
    });
    

    Parameters

    Returns void

event_video_dimension_change

  • event_video_dimension_change(payload: { height: number; type: "received"; width: number }): void
  • Occurs when received video content dimension change

    client.on('video-dimension-change', payload=>{
     viewportElement.style.width = `${payload.width}px`;
     viewportElement.style.height = `${payload.height}px`;
    })
    

    Parameters

    • payload: { height: number; type: "received"; width: number }
      • height: number
      • type: "received"
      • width: number

    Returns void

Functions

event_auto_play_audio_failed

  • event_auto_play_audio_failed(): void
  • Occurs when the SDK try to auto play audio failed. It may occur invoke stream.joinComputerAudio() immediately after join the meeting.

    client.on('auto-play-audio-failed',()=>{
     console.log('auto play audio failed, waiting user's interaction');
    })
    

    Returns void

Generated using TypeDoc