TRROMediaObserver 回调函数
Methods
onMqttConnectionState(param) → {function}
MQTT 连接状态回调
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object |
Properties
|
Returns:
- Type
- function
onSignalingState(param, roomId) → {function}
信令状态回调
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | |
roomId |
string | 信令房间 ID |
param.state |
string | socket.io-client 内置事件,具体可以参考 https://socket.io/docs/v2/client-api/#events |
param.data |
Object | socket.io-client 内置事件的相关参数,具体可以参考 https://socket.io/docs/v2/client-api/#events |
Returns:
- Type
- function
onPeerConnectionState(param) → {function}
peer connection 连接改变回调
CONNECTED = 0 连接成功
NEW = 1 新建连接
CONNECTING = 2 连接中
FAILED = 3 连接失败
DISCONNECTED = 4 连接断开
CLOSED = 5 主动关闭
RECONNECTING = 6 重连中
NOT_SUPPORT = 255 当前浏览器不支持 WebRTC
LIMIT_EXCEEDED = 256 当前 PeerConnection 连接数已达到浏览器上限
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 连接状态码 Properties
|
Returns:
- Type
- function
onConnected(param) → {function}
现场设备连接回调
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onDisconnected(param) → {function}
现场设备断开连接回调
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onTrackPublishState(param) → {function}
视频流 发布/取消发布 回调
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onControlData(param) → {function}
DataChannel 自定义消息 回调
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onKick(param) → {function}
剔除回调
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onPermissionStateChange(param) → {function}
权限信息回调
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onError(param) → {function}
错误通知
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 回调数据 Properties
|
Returns:
- Type
- function
onEvent(param) → {function}
事件回调
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
param |
OnEventResponse | 回调数据 Properties
|
Returns:
- Type
- function