Open Qaisarimran opened 8 years ago
Thanks Muaz, it work like a charm.
I have two more questions.
1) Is there any way to to broadcast shared screen and video combined in one window. 2) Is there any way i can get the name of peer connecting to the room
You can share both screen and video in parallel (in both Chrome & Firefox) and adjust the layout/UI to make sure video overlaps screen's bottom-right corner.
Multi-stream sharing can be handled with connection.session
object.
connection.session = {
audio: true,
video: true,
screen: true
};
connection.onstream = function(event) {
if(event.type === 'remote') {
if(event.isScreen) screenVideo.src = event.blobURL;
if(event.isVideo) smallVideo.src = event.blobURL;
}
};
You can get unique-userid
of the peer using connection.userid
.
You can pass extra data using connection.extra={}
. Each even is having event.extra
object.
You can directly access native RTCPeerConnection object using following snippet:
var nativePeer = connection.peers['remote-userid'].peer.connection;
nativePeer.getRemoteStreams();
nativePeer.getLocalStreams();
nativePeer.addStream(...);
nativePeer.removeStream(...);
nativePeer.localDescription;
nativePeer.remoteDescription
How i can close an open room. am using RTCMultiConnection
Am facing a problem that when i start a room am able to see everyone connecting the room (as am admin), but if my internet disconnect and when i come back i have to join again as a peer.
Am trying to create a private room in which multiple peer can connect to me. But they should be aware of other peers in the room.
Explaination. Any peer join the room should be visible to me only. Peer should only able to see me, not the other peers in the room.