WebRTC SCTP data channel's failure event
This event is fired only if WebRTC data channel fails to connect.
connection.onerror = function(event) { var remoteUserId = event.userid; var remoteUserFullName = event.extra.fullName; alert('unable to open data connection between you and ' + remoteUserFullName); };
parameter | description |
---|---|
userid |
unable to open data connection between you and this user-id
connection.onerror = function(event) { var remoteUserId = event.userid; }; |
extra |
extra information
connection.onerror = function(event) { var remoteUserFullName = event.extra.fullName; }; |
<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script> <script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script> <script> var connection = new RTCMultiConnection(); // this line is VERY_important connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/'; // if you want text chat connection.session = { data: true }; connection.onerror = function(event) { alert('unable to open data connection between you and ' + event.userid); }; connection.openOrJoin('your-room-id'); </script>