I am trying to send the image data over a Data Channel, but it is not working.
When just getting the data from ctx.getImageData, I receive a string
This exception is caused by exceeding the bandwidth limit agreed upon in the session.
When creating the answer to the offer, you must edit the sessionDescription object that is part of the PeerConnection, to change the b=AS: parameter which contains the maximum bandwith in kb/s:
var Bandwidth = 5000;
sessionDescription.sdp = sessionDescription.sdp.replace(/b=AS:([0-9]+)/g, 'b=AS:'+Bandwidth+'\r\n');
alert(JSON.stringify(sessionDescription));
By default the value is 30kb/s.