Answer the question
In order to leave comments, you need to log in
How to make WEBRTC work?
Hi all!
I've been struggling with webrtc for a day now.
1) Found an interesting solution through signalhub and webrtc-swarm
navigator.mediaDevices.getUserMedia({
video: this.roomData.video,
audio: this.roomData.audio
})
.then(stream => {
this.loader = false;
let hub = signalhub(`room:${this.roomData.id}`, [
`${this.host || 'http://localhost'}:6003`
]);
this.swarm = new createSwarm(hub, {
stream: stream
});
this.swarm.on('peer', (peer, id) => {
this.$refs.video.srcObject = peer.stream;
this.$refs.video.play();
});
this.swarm.on('disconnect', (peer, id) => {
this.deletePeer(id);
});
});
this.swarm.on('peer', (peer, id) => {});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question