Contributed with Alan Ford <alan-at-pexip.com>:
For developers using PexRTC to build their own WebRTC applications, three new event callbacks were created which can be used to call out to the callstats.io API. These callbacks are:
PexRTC.event_newPC = function(pc, uuid, conf, call_type)
, where:
pc
: PeerConnection objectuuid
: unique identifier of this callconf
: conference namecall_type
: internal call type, may be ‘screen’ for screensharing, ‘audio_only’ for audio only.
PexRTC.event_event = function(pc, conf, ev)
, where:
pc
: PeerConnection objectconf
: conference nameev
: event; audioMute/audioUnmute/videoPause/videoResume/fabricTerminated
PexRTC.event_error = function(pc, conf, ev, err, sdp)
, where:
pc
: PeerConnection objectconf
: conference nameev
: the function in questionerr
: error from functionsdp
: sdp in question, if relevant
The zip file contains an edited
settings.js
, which adds ascripts
block (if you’re already using customisations, you can just add thisscripts
block to your existing customisations), and acsio.js
file which is imported to make the above calls to the callstats.io API. This will need to be edited to make use of your personal identifiers in thecallStats.initialize
call.