August 2017
Beginner
298 pages
7h 4m
English
Similar to the readyToCall event, SimpleWebRTC will fire a videoAdded event for every video it finds in the room with a callback function having the video object and the peer object containing the ID (the unique ID of that user).
Create a new method inside the Home class addRemoteVideo($video, peer), as follows:
class Home { ... addRemoteVideo($video, peer) { }}
Let's add another event handler for the videoAdded event, just as we did for the readToCall event:
webrtc.on('videoAdded', ($video, peer) => home.addRemoteVideo($video, peer)); ...
Read now
Unlock full access