TRROMediaObserver Interface
Methods
onMqttConnectionState(param) → {function}
MQTT connection state callback
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Properties
|
- Type:
- function
onSignalingState(param, roomId) → {function}
Signaling state callback
| Name | Type | Description |
|---|---|---|
param | Object | |
roomId | string | Signaling room ID |
param.state | string | socket.io-client built-in events, refer to: https://socket.io/docs/v2/client-api/#events |
param.data | Object | Parameters for socket.io-client built-in events, refer to: https://socket.io/docs/v2/client-api/#events |
- Type:
- function
onPeerConnectionState(param) → {function}
Peer connection state change callback
CONNECTED = 0 Connection successful
NEW = 1 New connection
CONNECTING = 2 Connecting
FAILED = 3 Connection failed
DISCONNECTED = 4 Connection disconnected
CLOSED = 5 Actively closed
RECONNECTING = 6 Reconnecting
NOT_SUPPORT = 255 Browser doesn't support WebRTC
LIMIT_EXCEEDED = 256 PeerConnection count has reached browser limit
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Connection state code Properties
|
- Type:
- function
onDataChannelState(param) → {void|function}
Data channel state callback
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Properties
|
- Type:
- void
- Type:
- function
onConnected(param) → {function}
Field device connection callback
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onDisconnected(param) → {function}
Field device disconnection callback
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onTrackPublishState(param) → {function}
Video stream publish/unpublish callback
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onControlData(param) → {function}
DataChannel custom message callback
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onKick(param) → {function}
Kickout callback
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onPermissionStateChange(param) → {function}
Permission state change callback
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onError(param) → {function}
Error notification
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
param | Object | Callback data Properties
|
- Type:
- function
onEvent(param) → {function}
Event callback
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
param | OnEventResponse | Callback data Properties
|
- Type:
- function