How to add an Event handler to WebRTC object?
IMWebRTC objects
m_objWebRTC.OnEventSafe += M_objWebRTC_OnEventSafe; private void M_objWebRTC_OnEventSafe(string bsChannelID, string bsEventName, string bsEventParam, object pEventObject)
{
// your handler code
} m_objWebRTC.OnFrameSafe += M_objWebRTC_OnFrameSafe; private void M_objWebRTC_OnFrameSafe(string bsChannelID, object pMFrame)
{
// your handler code
}
MLive/MRenderer objects with WebRTC as "video" device. All events from internal WebRTC object will be redirected to MLive/MRenderer object instances and should be available as MLive/Renderer events.
m_objRenderer.OnEventSafe += M_objRenderer_OnEventSafe;
private void M_objRenderer_OnEventSafe(string bsChannelID, string bsEventName, string bsEventParam, object pEventObject)
{
// your handler code
}
m_objLive.OnEventSafe += M_objLive_OnEventSafe;
private void M_objLive_OnEventSafe(string bsChannelID, string bsEventName, string bsEventParam, object pEventObject)
{
// your handler code
}
Events list
Event name | Description |
---|---|
newframesource | new frame source initialized |
logged_out | signaling server logout |
joined_room | joined the room |
leaved_room | left the room |
network_failure | network connection problem |
connected | connected to peer |
disconnected | disconnected from peer |
connection_failed | a peer not able to connect to the remote peer |
reconnecting (attempt n) | current reconnect attempt count |
message | from another peer |