Type Definitions

ConnectionState

Connection State

Type:
  • 'new' | 'connecting' | 'connected' | 'failed' | 'disconnected' | 'reconnecting' | 'not_support' | 'limit_exceeded'

CloudMode

Cloud Mode public - Public cloud public_intl - Public cloud (international) private - Private cloud

Type:
  • 'public' | 'public_intl' | 'private'

SDKMode

Service Mode server - Dedicated acceleration mode server2 - Standard acceleration mode

Type:
  • 'server' | 'server2'

MediaType

Media Type

Type:
  • 'video' | 'audio'

RoomState

Room State

Type:
  • 'joining' | 'joined' | 'unjoined'

SignalingState

Signaling State

Type:
  • 'new' | 'scheduling' | 'scheduled' | 'connecting' | 'connected' | 'disconnected' | 'closed' | 'reconnecting'

MqttConnectionState

MQTT Connection State

Type:
  • 'new' | 'connecting' | 'connected' | 'reconnecting' | 'error' | 'closed'

PermissionState

Gateway Device Permission

Type:
  • 'master' | 'guest'

Gateway

Gateway Information

Type:
  • object
Properties
NameTypeAttributesDescription
deviceIdstring

Field device ID. In public cloud mode, format is ${projectId}/${fieldDeviceId}

deviceNamestring
deviceTypestring
streamCountnumber
statusstring
versionstring

Gateway SDK version

licenseExpirenumber<optional>

License expiration timestamp (seconds)

OnEventAutoplayResponse

Autoplay Response Type

Type:
  • object
Properties
NameTypeDescription
type'autoplay'
dataobject
Properties
NameTypeAttributesDescription
codenumber

0 - Success -1 - Failed 20 - MQTT client not found (public cloud only) 21 - MQTT client not connected (public cloud only) 22 - MQTT publish failed (public cloud only) 25 - MQTT sessionId not found (public cloud only)

messagestring
fieldDeviceIdstring
srcUserIdstring
streamIdnumber
trackIdstring
mediaTypeMediaType
videoWidthnumber<optional>
videoHeightnumber<optional>

WebRTCStats

Media Stream Statistics

Type:
  • object
Properties
NameTypeAttributesDescription
srcUserIdstring

Media stream source user ID

trackIdstring

Media stream track ID

streamIdnumber

Media stream ID

mediaTypeMediaType

Media type

bitratenumber

Current bitrate in Mbps

packetsReceivednumber

Total received RTP packets (cumulative)

packetsLostnumber

Total lost RTP packets (cumulative)

lostnumber

Current packet loss rate in %

lostAvgnumber

Average packet loss rate in %

rttnumber

RTT (Round Trip Time) in ms

rttAvgnumber

Average RTT in ms

codecstring

Media codec MIME type

decoderImplementationstring

Decoder identifier

decoderType'hardware' | 'software' | 'unknown'

Decoder type:

  • hardware: Hardware decoder
  • software: Software decoder
  • unknown: Unknown type
nacknumber

Total NACK packets sent (cumulative)

firCountnumber

FIR count

pliCountnumber

PLI count (video only)

framesReceivednumber

Total frames received (cumulative, video only)

framesDecodednumber

Total frames decoded (cumulative, video only)

keyFramesDecodednumber

Total key frames decoded (cumulative, video only)

resolutionstring

Resolution in format ${width}x${height} (video only)

fpsnumber

Frame rate (video only)

decodeTimenumber

Current decode time in ms (video only)

decodeTimeAvgnumber

Average decode time in ms (video only)

processingDelaynumber

Current processing delay in ms (video only)

processingDelayAvgnumber

Average processing delay in ms (video only)

audioLevelnumber

Current audio level (0-1, audio only)

jitternumber

Jitter in seconds

jitterBuffernumber

Current jitter buffer delay in ms

jitterBufferAvgnumber

Average jitter buffer delay in ms

jitterBufferTargetnumber

Current target jitter buffer delay in ms

jitterBufferTargetAvgnumber

Average target jitter buffer delay in ms

latencynumber

Video latency in ms

latency1number<optional>
latency2number<optional>
lag100number

Video freeze rate at 100ms

lag150number

Video freeze rate at 150ms

nackDeltanumber

Period delta: NACK count in current collection period

firCountDeltanumber

Period delta: FIR count in current collection period

pliCountDeltanumber

Period delta: PLI count in current collection period

framesReceivedDeltanumber

Period delta: frames received in current collection period

framesDecodedDeltanumber

Period delta: frames decoded in current collection period

packetsReceivedDeltanumber

Period delta: packets received in current collection period

packetsLostDeltanumber

Period delta: packets lost in current collection period

stableFpsnumber

Stable FPS: 10s sliding window average, excluding 0 values (video only)

DiagnosisReport

Diagnosis Report

Type:
  • object
Properties
NameTypeAttributesDescription
diag_errorstring

Diagnosis error message, returns 'ok' if no error, otherwise error message

device_idstring

Field device ID

field_pidstring<optional>

Field device process ID

license_checkstring<optional>

Field device license check, returns 'ok' if passed, otherwise error message

field_mqtt_connectstring<optional>

Field device MQTT connection status, returns 'ok' if connected, otherwise error message

remote_mqtt_connectstring

Remote device MQTT connection status, returns 'ok' if connected, otherwise error message

resultArray

Video stream diagnosis reports

result[].stream_idnumber

Video stream ID

result[].fieldobject<optional>

Field device video stream diagnosis report

Properties
NameTypeDescription
field_modestring

Field device service mode

signal_connectstring

Field device signaling connection status, returns 'ok' if connected, otherwise error message

media_connectstring

Field device media connection status, returns 'ok' if connected, otherwise error message

video_transferstring

Field device video transfer status, returns 'ok' if normal, otherwise error message

video_capturestring

Field device video capture status, returns 'ok' if normal, otherwise error message

video_encodestring

Field device video encode status, returns 'ok' if normal, otherwise error message

rttArray.<number>

Field device RTT statistics in ms, 2-second interval

lostArray.<number>

Field device packet loss rate statistics, 2-second interval

bpsArray.<number>

Field device bitrate statistics in kbps, 2-second interval

fpsArray.<number>

Field device frame rate statistics, 2-second interval

result[].remoteobject<optional>

Remote device video stream diagnosis report

Properties
NameTypeDescription
remote_modestring

Remote device service mode

signal_connectstring

Remote device signaling connection status, returns 'ok' if connected, otherwise error message

media_connectstring

Remote device media connection status, returns 'ok' if connected, otherwise error message

video_transferstring

Remote device video transfer status, returns 'ok' if normal, otherwise error message

video_decodestring

Remote device video decode status, returns 'ok' if normal, otherwise error message

lag_k100number

Remote device 100ms freeze rate

lag_k150number

Remote device 150ms freeze rate

rttArray.<number>

Remote device RTT statistics in ms, 2-second interval

lostArray.<number>

Remote device packet loss rate statistics, 2-second interval

bpsArray.<number>

Remote device bitrate statistics in kbps, 2-second interval

fpsArray.<number>

Remote device frame rate statistics, 2-second interval

latencyArray.<number>

Remote device latency statistics in ms, 2-second interval

webrtc_statsArray.<WebRTCStats>

Remote device complete statistics, 2-second interval

OnEventWebRTCStatsResponse

WebRTC Stats Callback

Type:
  • object
Properties
NameTypeDescription
type'webrtcStats'
dataArray.<WebRTCStats>

OnEventGatewayStatsResponse

Gateway Stats Callback

Type:
  • object
Properties
NameTypeDescription
type'gatewayStats'
dataobject
Properties
NameTypeDescription
fieldDeviceIdstring
statsany

OnEventLocalTrackUnpublishedResponse

Local Audio Track Unpublish Callback

Type:
  • object
Properties
NameTypeDescription
type'localTrackUnpublished'
dataObject

OnEventResponse

OnEvent Response