question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The "options" in "peer.call(id, stream, options) " should be documented.

See original GitHub issue

I saw the #126 before, but i think there is something meaningful in the peerconnection’s options. Because some problem confuses me when i tried to call the other peer with the audio only, i cannot received the video from that peer. After I search the google, I found that this situation happened because I don’t set the OfferToReceiveVideo to true, in webrtc constraints, it means if a caller only has the audio stream, the OfferToReceiveVideo is setting to false, even if the the callee answer a video stream, we won’t received it.

As soon as I set it like this:

    var options = {
        'constraints': {
            'mandatory': {
                'OfferToReceiveAudio': true,
                'OfferToReceiveVideo': true
            }
        }
    }
    var call = peer.call(otherPeer, callStream, options);

It finally works.

So I suggest that maybe we could document it in the Docs, or just set it as the default in the source code.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:5
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
TomaszRzucidlocommented, Jun 19, 2020
    var constraints = {
        'mandatory': {
            'OfferToReceiveAudio': true,
            'OfferToReceiveVideo': true
        },
        offerToReceiveAudio: 1,
        offerToReceiveVideo: 1,
    }

You shoud name your object like “constraints” and then: var call = peer.call(otherPeer, callStream, constraints);

2reactions
Redmegacommented, Jul 26, 2019

@afrokick Do you have an example of using RTCRtpTransceiver for this? I’m confused as to how it would be implemented with Peer.JS. I’m having a fairly common issue – Users with video disabled should still be able to participate – but when I connect that media stream, the users who only have audio can also only recieve audio.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PeerJS Documentation
PeerJS docs. PeerJS simplifies peer-to-peer data, video, and audio calls. This guide will show you the basic concepts of the PeerJS API.
Read more >
How do I set metadata in the PeerJs peer.call(id, stream ...
for calling a remote peer + attaching some metadata to the call: options = {metadata: {"type":"screensharing"}}; peer.call(remotePeerId, ...
Read more >
Answering a Call - Web APIs | MDN
Click call, submit the peer ID for the other browser and then answer the call. The final page should look like this: Two...
Read more >
JavaScript SDK | API Reference - SkyWay
The Peer class is a entry point for P2P connection and room connection. In order to use ECLWebRTC, Peer instance is necessary. #...
Read more >
Getting started with PeerJS - LogRocket Blog
Above, we've created an instance using the default settings. ... const call = peer.call("other-peer-id", stream); call.on("stream", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found