Options
All
  • Public
  • Public/Protected
  • All
Menu

Agora Electron SDK API Reference

Index

Type aliases

AgoraNetworkQuality

AgoraNetworkQuality: 0 | 1 | 2 | 3 | 4 | 5 | 6

Network quality types:

  • 0: The network quality is unknown.
  • 1: The network quality is excellent.
  • 2: The network quality is quite good, but the bitrate may be slightly lower than excellent.
  • 3: Users can feel the communication slightly impaired.
  • 4: Users cannot communicate smoothly.
  • 5: The network is so bad that users can barely communicate.
  • 6: The network is down and users cannot communicate at all.

CaptureRect

CaptureRect: Rectangle

ClientRoleType

ClientRoleType: 1 | 2

Client roles in a live broadcast.

  • 1: Host
  • 2: Audience

ConnectionChangeReason

ConnectionChangeReason: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13

Reasons for a connection state change:

  • 0: The SDK is connecting to Agora's edge server.
  • 1: The SDK has joined the channel successfully.
  • 2: The connection between the SDK and Agora's edge server is interrupted.
  • 3: The connection between the SDK and Agora's edge server is banned by Agora's edge server.
  • 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel.
  • 5: The SDK has left the channel.
  • 6: Invalid App ID.
  • 7: Invalid Channel Name.
  • 8: Invalid Token.
  • 9: Token Expired.
  • 10: This user has been banned by server.
  • 11: SDK reconnects for setting proxy server.
  • 12: Network status change for renew token.
  • 13: Client IP Address changed.

ConnectionState

ConnectionState: 1 | 2 | 3 | 4 | 5

Connection states.

  • 1: The SDK is disconnected from Agora's edge server.
  • 2: The SDK is connecting to Agora's edge server. When the application calls the AgoraRtcEngine.joinChannel method, the SDK starts to establish a connection to the specified channel.
    • When the SDK successfully joins the channel, it triggers the connectionStateChanged callback and switches to the 3 state.
    • After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the joinedChannel callback.
  • 3: The SDK is connected to Agora's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel.If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers:
    • The connectionStateChanged callback and switches to the 4 state.
  • 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.
    • If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora's edge server, the SDK triggers the connectionLost callback, stays in this state, and keeps rejoining the channel.
    • If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK triggers the connectionStateChanged callback, switches to the 5 state, and stops rejoining the channel.
  • 5: The SDK fails to connect to Agora's edge server or join the channel. You must call the leaveChannel method to leave this state.
    • Calls the joinChannel method again to rejoin the channel.
    • If the SDK is banned from joining the channel by Agora's edge server (through the RESTful API), the SDK triggers connectionStateChanged callbacks.

MacScreenSymbol

MacScreenSymbol: number

MediaDeviceType

MediaDeviceType: -1 | 0 | 1 | 2 | 3 | 4

Media Device Type.

  • -1: Unknown device type
  • 0: Audio playback device
  • 1: Audio recording device
  • 2: Video renderer
  • 3: Video capturer
  • 4: Application audio playback device

RemoteVideoState

RemoteVideoState: 1 | 2

Statistics of the remote video stream.

  • 1: running
  • 2: frozen, usually caused by network reason

ScreenSymbol

StreamType

StreamType: 0 | 1

Video stream types.

  • 0: High-stream video
  • 1: Low-stream video

WindowsScreenSymbol

WindowsScreenSymbol: Rectangle

Variables

Const agora

agora: any = require('../../build/Release/agora_node_ext')