WebRTC OfferToReceiveAudio error in Firefox

后端 未结 2 720
[愿得一人]
[愿得一人] 2020-11-27 08:20

I\'m developing a simple example to test WebRTC, and I\'ve found the following strange behaviour.

When using Chrome, the media constraints are specified as:

2条回答
  •  旧巷少年郎
    2020-11-27 08:55

    In the specs here:

    https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC/WebRTC_basics

    I see that the constraints should be in the following format:

    var constraints = {
        mandatory: {
            OfferToReceiveAudio: true,
            OfferToReceiveVideo: true
        }
    };
    

    Chrome only supports that format.

    you can refer to this discussion for same issue:

    WebRTC - getting 'malformed constraints object' from Chrome but not Firefox

提交回复
热议问题