muaz-khan / RTCMultiConnection

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
https://muazkhan.com:9001/
MIT License
2.56k stars 1.38k forks source link

sdp-error DOMException: Malformed constraints object. #613

Open Wemperer opened 6 years ago

Wemperer commented 6 years ago

I'm writing this for future reference. For anyone who is integrating RTCMultiConnection into an Angular 2 / Angular 6 application do note there is some very strange bug that throws: sdp-error DOMException: Malformed constraints object. in Chrome when trying to establish video connection. The solution to this is to DISABLE adapterjs. (window.enableAdapter = false).

In trying to fix this error, I came across a couple of old posts that say Chrome only accepts "offerToReceiveAudio" and "offerToReceiveVideo" and while RTCMultiConnection uses the format "OfferToReceiveAudio" and "OfferToReceiveAudio". Maybe this is what Adapter takes care of but inside an angular application it doesn't seem to make the adjustment.

DOMException: Malformed constraints object.

egarciahz commented 5 years ago

A similar error occurred in a MeteorJS application, the solution: dont including adapterjs, configure (enableAdapter = false) like global.

packages
 |_ media-package
    |_ client
       |_ packages
         |_ adapter.js

into the adapter.js file declare:

enableAdapter = false;