Peerjs: Multiple streams per MediaConnection

Created on 21 Mar 2019  ·  5Comments  ·  Source: peers/peerjs

Hi. I found a PR #132 related to my issue.

I want to send video+audio+screen.

What do you advice?

Most helpful comment

Ok, I found a trick https://blog.mozilla.org/webrtc/warm-up-with-replacetrack/

I have one stream with 3 'empty' tracks - audio, video and screen.

Next, I call method 'call' and then have senders:
const [audioSender, videoSender, screenSender]= call.peerConnection.getSenders();

just replace track via audio.replaceTrack(null|audioTrack) to mute/unmute

All 5 comments

Ok, I found a trick https://blog.mozilla.org/webrtc/warm-up-with-replacetrack/

I have one stream with 3 'empty' tracks - audio, video and screen.

Next, I call method 'call' and then have senders:
const [audioSender, videoSender, screenSender]= call.peerConnection.getSenders();

just replace track via audio.replaceTrack(null|audioTrack) to mute/unmute

Any sample code snippet with peerjs will be helpful for newbie webrtc people :)

Thanks in advance !

New news, I'll be releasing a new version of PeerJS next week, completely rewritten, using a much simpler concept, and it will not need a PeerServer. So wait few days.

The new concept is based on rooms, a Room is the only thing that exists, so if you want to call someone, just go into a random ID room that both peers share. If what you want is multiple connections, just enter into a room with more people, that simple.

Here is an early test: https://dist-9yeo4sucs.now.sh/ (just enter the same room name PD: there is no UI feedback)

The getUserMedia is inside the librayr, but I'll take it out probably.

So just wait few days until next week :)

great news .. ! awaiting for new version . Where can i see the updates related to new release

The branch is ready https://github.com/peers/peerjs/tree/v2.0.0
You can join to a Telegram group if you want to discuss or ask for anything related to PeerJS: tg://join?invite=ENhPuhTvhm8WlIxTjQf7Og

Was this page helpful?
0 / 5 - 0 ratings

Related issues

veezo2007pk picture veezo2007pk  ·  7Comments

geraldsamosir picture geraldsamosir  ·  6Comments

bilo1967 picture bilo1967  ·  7Comments

fresheneesz picture fresheneesz  ·  10Comments

l2aelba picture l2aelba  ·  3Comments