Call - v26.1.0
    Preparing search index...

    Class NCCallEngine

    Overseas (Nexconn) CallPlus public exports. Primary naming: NC*, INC*, etc.

    Index

    Constructors

    Properties

    _instance: NCCallEngine | null = null

    Methods

    • Singleton initialization

      Parameters

      • options: INCCallInitOptions

        logOutputLevel: console log level, default EnableLogL.WARN; logs at or below this level are printed

        • isPubLowResolutionStream: whether to publish low-resolution stream, default false; when true, remote can subscribe to low-res to save bandwidth

      Returns NCCallEngine

      Existing or newly created NCCallEngine instance

      Repeated calls return the same instance if one already exists

    • Set application call event listener (incoming call, call end, participant state, media type changes, etc.).

      Parameters

      Returns void

      Replaces any previously set listener

    • Set call quality listener; send/receive quality callbacks are driven by underlying status reports, about once per second.

      Parameters

      • listener: IConnectionQualityListener

        IConnectionQualityListener; all methods optional

        Call connection quality listener

        • onAudioVolumeChanged?: function
          • Per-user volume: userId → level (0–100), about once per second.

            Parameters

            • volumes: { [userId: string]: number }

              User ID to volume map

            Returns void

        • onSendQualityChanged?: function
          • Local uplink quality; userId is the logged-in user. About once per second.

            Parameters

            Returns void

        • onReceiveQualityChanged?: function
          • Per-remote downlink quality. About once per second.

            Parameters

            Returns void

      Returns void

    • Bind video views (local and remote).

      Parameters

      • list: { userId: string; videoElement: HTMLVideoElement; useTinyStream?: boolean }[]

        Entries for multiple users

      Returns { code: number }

      code Whether binding succeeded

      Dynamic tiny/main stream switching is not supported

    • Remove bound video views. You may remove the DOM nodes; calling this stops receiving that user's video from the SDK.

      Parameters

      • userIds: string[]

        User IDs

      Returns { code: number }

      code Whether removal succeeded

    • Play a user's audio/video. For video, call setVideoView for that user first.

      Parameters

      Returns Promise<{ code: number }>

      Whether playback started successfully

    • Create video config builder

      Returns NCVideoConfigBuilder

      NCVideoConfigBuilder for capture settings (camera id, frame rate, resolution, etc.); call build() then setVideoConfig

    • Set video config (resolution, min/max bitrate, frame rate, camera ID, etc.). Apply before the call connects.

      Parameters

      Returns { code: number }

    • Create audio config builder

      Returns NCAudioConfigBuilder

      NCAudioConfigBuilder for capture settings (e.g. microphone id); call build() then setAudioConfig

    • Create Android push config builder

      Returns NCAndroidPushConfigBuilder

      NCAndroidPushConfigBuilder; call build() for androidPushConfig, then pass it in pushConfig.androidConfig of startCall / inviteToCall / endCall

    • Set audio config (bitrate, sample rate, capture device ID). Apply before the call connects.

      Parameters

      Returns { code: number }

    • Start an outgoing call

      Parameters

      • calleeIds: string | string[]

        Callee user id(s); single string or string[] (one entry for 1:1)

      • callType: NCCallType = NCCallType.SINGLE
      • mediaType: NCCallMediaType = NCCallMediaType.VIDEO
      • OptionalpushConfig: INCCallPushConfig

        Mobile push payload

      • Optionalextra: string

        Opaque string forwarded to callee(s)

      • OptionaltargetId: string

        Group id for multi-party calls

      Returns Promise<{ code: number; callId?: string }>

      callId Session id on success

      On signaling send failure, SDK retries every 2s until success or ~1 minute timeout

    • Join an ongoing group call by ID (invitation not required if you know callId).

      Parameters

      • callId: string

        Call ID

      Returns Promise<{ code: number }>

      On signaling send failure, SDK retries every 2s until success or ~1 minute timeout

    • Invite users during a 1:1 or group call

      Parameters

      • calleeIds: string[]

        Invitee user IDs

      • OptionalpushConfig: INCCallPushConfig

        Mobile push payload

      • Optionalextra: string

        Opaque string forwarded to invitees

      Returns Promise<
          {
              code: number;
              busyUsers?: { userId: string; userState: NCCallUserState }[];
          },
      >

      busyUsers Users busy; userState is NCCallUserState

      Inviting from a 1:1 call may change call type

      On signaling send failure, SDK retries every 2s until success or ~1 minute timeout

    • Accept a call

      Parameters

      Returns Promise<{ code: number }>

      On signaling send failure, SDK retries every 2s until success or ~1 minute timeout

    • Hang up

      Parameters

      • OptionalcallId: string

        Optional. Omit to hang up the active main session; pass id to hang up that call or a pending incoming call (ringing, not answered) without affecting other calls

      • OptionalpushConfig: INCCallPushConfig

        Mobile push payload

      Returns Promise<{ code: number }>

    • Request media type change during a call (1:1 only; no manual camera toggle required)

      Parameters

      Returns Promise<{ code: number; transactionId?: string }>

      transactionId Use when cancelling or responding to the change request

    • Cancel a pending media type change (1:1 only)

      Parameters

      • transactionId: string

        Same as returned from requestChangeMediaType

      Returns Promise<{ code: number }>

    • Respond to a media type change request (1:1 only)

      Parameters

      • transactionId: string

        From onMediaTypeChangeRequestReceived

      • isAgree: boolean

        Whether to accept the change

      Returns Promise<{ code: number }>

    • Get the active main call session

      Returns NCCallSession | null

      Current NCCallSession or null

    • Fetch ongoing (not ended) call logs for the current user from server

      Returns Promise<{ code: number; records?: INCCallLog[] }>

      records List of INCCallLog

    • Paginated call history for the current user

      Parameters

      • startTime: number

        Anchor timestamp; use -1 for first page (newest when order is reverse, oldest when forward). Forward: records after this time; reverse: records before this time

      • count: number

        Page size

      • Optionalorder: 0 | 1

        0 ascending (after startTime), 1 descending (before startTime); default forward

      Returns Promise<{ code: number; result?: INCCallLogInfo }>

      result.hasMore More pages available

    • Delete call logs by id for the current user

      Parameters

      • callIds: string[]

        Call IDs to delete

      Returns Promise<{ code: number }>

    • Delete all call logs for the current user

      Returns Promise<{ code: number }>

    • Turn camera on (true) or off (false).

      Parameters

      • enable: boolean

        Enable camera

      Returns Promise<{ code: number }>

      Default is on after video call connects

      If publish fails so remote never sees camera on, this action fails

    • Switch camera device (before or during call)

      Parameters

      • cameraId: string

        From getVideoInputDevices

      Returns Promise<{ code: number }>

      On success, onUserMediaAvailable fires; call playMedia for the new track

    • Turn microphone on (true, unmute) or off (false, local mute).

      Parameters

      • enable: boolean

        Enable microphone

      Returns Promise<{ code: number }>

      Default is on after call connects

      If publish fails so remote never sees mic on, this action fails

    • List audio input (microphone) devices

      Returns Promise<MediaDeviceInfo[]>

    • Switch microphone (before or during call)

      Parameters

      • microphoneId: string

        From getAudioInputDevices

      Returns Promise<{ code: number }>

      On success, onUserMediaAvailable fires; call playMedia for the new track

    • List audio output (speaker) devices

      Returns Promise<MediaDeviceInfo[]>

    • Set audio output (playback) device

      Parameters

      • deviceId: string

        Device id

      Returns Promise<{ code: number }>

    • SDK version string

      Returns string

    • List video input (camera) devices

      Returns Promise<MediaDeviceInfo[]>

    • Whether the microphone is currently enabled

      Returns boolean