-
-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow connection between Peers even if one is sending an empty or no stream object #727
Comments
Just don't specify stream on one of the sides. Send-only and receive-only connections are quite popular with WebRTC and are supported by simple-peer, so it should just work. In case it doesn't, you need to debug why that happens exactly and where. It sounds very suspicious if it works with streams both ways, but doesn't with one-way. |
I somehow constantly get an error if I do that
Any idea what could be wrong? |
Did you try send something bigger than 16kiB over data channel as a single message? |
Also you probably want to catch that and see what that error event actually is |
To the first question: I only send a video stream from one side and nothing from the other. I don't even use the data channel I'm trying to catch the error but I cannot find where it is exactly triggered. Any recommendations where to put it? To give you some context:
And sends a signal to the broadcaster. Then the broadcaster receives the signal and creates following peer:
That triggers the double response message and the error I posted earlier. |
You mean to try by making the same changes to the source code? I now noticed that even if I return an audio stream instead of video I get the same error. Weird. |
Do you mind posting all the signals that are passed into |
Sorry for taking so long for answering, totally forgot I had this issue open.. At the end I managed to make it work. It seems to be possible to have the stream coming only from one side, but only if that peer is the initiator. |
I have the same problem. Is there any way to start the stream negotiation from a non-initiator? |
I had the same problem as well. When I am adding only Audio on initiator and want to add Audio and Video on non-initiator it does not work. The Offer and Answer had no m=Video section. But now the Clue! Is this the right behavior? |
I'm having the same issue, I would like to have one person streaming and the others one viewing the stream, so, the viewer in my case is the initiator, and the streamer is the other peer. When the viewer attempt to connect, it sends the signal but I always get this error from the streamer point of view:
So I'm not sure if the streamer need to be the initiator and the viewer the other peer. As I understand this is how @marduzca solved de issue. |
I am experiencing the same issue. Setting up a peer with |
@stefanvanherwijnen I solved the issue with the solution that @marduzca commented on Sep 16. If one peer have a stream and the other does't not have it, the initiator should be the one that have the stream on it. Hope this help. I did this change and now no errors appears and everything is working good. But I think this is an issue, maybe in the next update someone fix it. |
@ajmc90 @t-mullen |
I was having trouble getting one-way streams working in Safari, and I discovered that I needed to call |
I'm having this kind of problem still. I couldn't get the listener side to work without giving any stream object. When I use an audio tag to provide the media stream, it works on a PC but not with Chrome on iPhone. When I switch back to an audio stream from the microphone, it works. |
I found the solution: when initializing SimplePeer, the initiator can offer not to receive Audio/Video from the other side: const peer = new SimplePeer({ initiator: true , offerOptions: { offerToReceiveAudio: false }, trickle: false, realAudioStream }); And receiver: const peer = new SimplePeer({ initiator: false , trickle: false });
end |
Currently my connection between peers only work if for instance both send the same type of stream (e.g. video). In a case scenario in which a main user wants to broadcast its video to others, you don't want the others to have to send video back, at least you would want to be able to return an empty stream to not saturate the bandwidth with unnecessary data.
Maybe you can already do this somehow, but at least in my case it didn't work with any of the ways I tried.
Thank you!
The text was updated successfully, but these errors were encountered: