Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC: How to add stream after offer and answer?

I am working on webRTC video calling. I got datachannel successfully implemented. Now I would like to add video stream to the same peer connection.

I have read that stream should be added before answer and offer. Is there a way to add stream after answer or offer?

In case I have added stream before offer or answer, how could I stop streaming and start it again when needed?

Could there be any issues in maintaining so many streams?

like image 812
kongaraju Avatar asked Apr 15 '13 12:04

kongaraju


1 Answers

To add stream after creating complete signalling, the Peer connection should renegotiate with stream.

pc1.addstream(stream) 

Then once again create offer and send it to other Peer.

Remote peer will add stream and send answer SDP.

To stop streams:

stream.stop(); pc1.removeStream(stream); 
like image 194
kongaraju Avatar answered Oct 05 '22 17:10

kongaraju