Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DirectCall

Hierarchy

Index

Properties

Optional onConnected

onConnected: (call: DirectCall) => void

Type declaration

Optional onCustomItemsDeleted

onCustomItemsDeleted: (call: DirectCall, deletedKeys: string[]) => void

Type declaration

    • Parameters

      Returns void

Optional onCustomItemsUpdated

onCustomItemsUpdated: (call: DirectCall, updatedKeys: string[]) => void

Type declaration

    • Parameters

      Returns void

Optional onEnded

onEnded: (call: DirectCall) => void

Type declaration

Optional onEstablished

onEstablished: (call: DirectCall) => void

Type declaration

Optional onReconnected

onReconnected: (call: DirectCall) => void

Type declaration

Optional onReconnecting

onReconnecting: (call: DirectCall) => void

Type declaration

Optional onRemoteAudioSettingsChanged

onRemoteAudioSettingsChanged: (call: DirectCall) => void

Type declaration

Optional onRemoteRecordingStatusChanged

onRemoteRecordingStatusChanged: (call: DirectCall) => void

Type declaration

Optional onRemoteVideoSettingsChanged

onRemoteVideoSettingsChanged: (call: DirectCall) => void

Type declaration

Optional onScreenShareStopped

onScreenShareStopped: () => void

Type declaration

    • (): void
    • Returns void

Optional onUserHoldStatusChanged

onUserHoldStatusChanged: (call: DirectCall, isLocalUser: boolean, isUserOnHold: boolean) => void

Type declaration

    • (call: DirectCall, isLocalUser: boolean, isUserOnHold: boolean): void
    • Parameters

      • call: DirectCall
      • isLocalUser: boolean
      • isUserOnHold: boolean

      Returns void

Accessors

callId

  • get callId(): string
  • readonly

    Get the ID of the current call.

    Returns string

    uuid string

callLog

  • readonly

    Get calllog information for the current call that has been terminated. Get the information held in Local Memory, not the information retrieved from the server.

    Returns DirectCallLog

    If a request is made when the call is not terminated, a null value is returned.

callee

  • readonly

    Get caller infomation.

    Returns DirectCallUser

    Returns an object containing information about the callee.

caller

  • readonly

    Get caller infomation.

    Returns DirectCallUser

    Returns an object containing information about the caller.

customItems

  • readonly

    Get custom items used during the call.

    Returns CustomItems

endResult

endedBy

  • get endedBy(): any
  • readonly

    Get information about whom the call was terminated by.

    Returns any

isEnded

  • get isEnded(): boolean
  • readonly

    Get whether the call has ended.

    Returns boolean

isLocalAudioEnabled

  • get isLocalAudioEnabled(): boolean
  • readonly

    Get whether local audio media is active.

    Returns boolean

isLocalScreenShareEnabled

  • get isLocalScreenShareEnabled(): boolean
  • readonly

    Get information on whether doing screen share.

    Returns boolean

isLocalVideoEnabled

  • get isLocalVideoEnabled(): boolean
  • readonly

    Get whether local video media is active.

    Returns boolean

isOnHold

  • get isOnHold(): boolean
  • readonly

    Get on whether the current call is on hold.

    Returns boolean

isOngoing

  • get isOngoing(): boolean
  • readonly

    Get on whether the current call is in progress.

    Returns boolean

isRemoteAudioEnabled

  • get isRemoteAudioEnabled(): boolean
  • readonly

    Get whether remote audio media is active.

    Returns boolean

isVideoCall

  • get isVideoCall(): boolean
  • readonly

    Get information on whether the ongoing call is a video call.

    Returns boolean

localMediaView

  • get localMediaView(): HTMLMediaElement
  • readonly

    Handle value of the element that plays Local Media Stream

    Returns HTMLMediaElement

localUser

  • readonly

    Get current user's information.

    Returns DirectCallUser

    Returns an object containing information about current user.

myRole

  • readonly

    Get the current user's role.

    Returns CALLER | CALLEE

remoteMediaView

  • get remoteMediaView(): HTMLMediaElement
  • readonly

    Handle value of the element that plays Remote Media Stream

    Returns HTMLMediaElement

remoteUser

  • readonly

    Get remote user information.

    Returns DirectCallUser

    Returns an object containing information about remote user.

Methods

captureLocalVideoView

captureRemoteVideoView

deleteAllCustomItems

  • Delete all custom items associated with the call

    - using promise
    call.deleteAllCustomItems()
      .then(result => {
        // Handle added custom items using a returned promise.
    // result = { customItems: {}, affectedKeys: ['key1', key2']  }
      }, error => {
        // Handle error
      });
    - using callback
    call.deleteAllCustomItems(function(result, error){
      if(!error){
        // Handle added custom items using a returned result.
        // result = { customItems: {}, affectedKeys: ['key1', key2']  }
      } else {
        // Handle error
      }
    });
    

    Parameters

    Returns Promise<{}>

deleteCustomItems

  • deleteCustomItems(customItemKeys: string[], callback?: CustomItemsHandler): true | Promise<{}>
  • Custom items can be added to a call either by a caller or a callee. When dialing, the caller can add a Dictionary of String and String to a DialParams object by using the customItems property. The default value of a call's custom items is an empty Dictionary.

    const deleteCustomItemKeys = ["key1", "key2"];
    - using promise
    call.deleteCustomItems(deleteCustomItemKeys)
      .then(result => {
        // Handle added custom items using a returned promise.
        // result = { customItems: {key1: 'value1', ... }, affectedKeys: ['key1', key2']  }
      }, error => {
        // Handle error
      });
    - using callback
    call.deleteCustomItems(deleteCustomItemKeys, function(result, error){
      if(!error){
        // Handle added custom items using a returned result.
        // result = { customItems: {key1: 'value1', ... }, affectedKeys: ['key1', key2']  }
      } else {
        // Handle error
      }
    });
    

    Parameters

    Returns true | Promise<{}>

end

  • end(): void
  • When the call is not connected, cancel/reject the call. When the call is connected, the call is terminated.

    Returns void

getDuration

  • getDuration(): any
  • Gets the talk time that has been in progress so far.

    Returns any

    call duration time(unit ms)

hold

  • hold(): Promise<void>
  • Hold the current call.

    Returns Promise<void>

muteMicrophone

  • muteMicrophone(): void
  • Stop the local audio.

    Returns void

setLocalMediaView

  • setLocalMediaView(mediaView: HTMLMediaElement): Promise<void>
  • Set view element for display local media stream.

    Parameters

    • mediaView: HTMLMediaElement

      video html element.

    Returns Promise<void>

setRemoteMediaView

  • setRemoteMediaView(mediaView: HTMLMediaElement): Promise<void>
  • Set view element for display remote media stream.

    Parameters

    • mediaView: HTMLMediaElement

      video html element.

    Returns Promise<void>

startRecording

startScreenShare

  • startScreenShare(): Promise<void>
  • Start screen share.

    Returns Promise<void>

startVideo

  • startVideo(): void
  • Start the local video.

    Returns void

stopRecording

  • stopRecording(recordId: string): boolean
  • Stop recording.

    Parameters

    • recordId: string

    Returns boolean

stopScreenShare

  • stopScreenShare(): void
  • Start screen share.

    Returns void

stopVideo

  • stopVideo(): void
  • Stop the local video.

    Returns void

unhold

  • unhold(force: boolean): Promise<void>
  • Unhold the current call.

    Parameters

    • force: boolean

    Returns Promise<void>

unmuteMicrophone

  • unmuteMicrophone(): void
  • Start the local audio.

    Returns void

updateCustomItems

  • Custom items can be added to a call either by a caller or a callee. When dialing, the caller can add a Dictionary of String and String to a DialParams object by using the customItems property. The default value of a call's custom items is an empty Dictionary.

    const customItems = { key1: 'value1', key2: 'value2' };
    - using promise
    call.updateCustomItems(customItems)
      .then(result => {
        // Handle added custom items using a returned promise.
        // result = { customItems: {key1: 'value1', ... }, affectedKeys: ['key1', key2']  }
      }, error => {
        // Handle error
      });
    - using callback
    call.updateCustomItems(customItems, function(result, error){
      if(!error){
        // Handle added custom items using a returned result.
        // result = { customItems: {key1: 'value1', ... }, affectedKeys: ['key1', key2']  }
      } else {
        // Handle error
      }
    });
    

    Parameters

    Returns true | Promise<{}>

Generated using TypeDoc