Open alberttsai opened 10 years ago
Dear Muaz-Khan, When trying the new updated desktopCapture (from the download.zip), the receiver side did not receive anything from sender. What I observed is once sender click the desktopCapture extension button, one more chrome tab show up in his own side and see his own screen. Am I doing anything wrong? My chrome is with Version 35.0.1916.17 dev-m.
Thanks for help. Albert
First of all, you can see that now desktopCapture experiment is upgraded to RTCMultiConnection-v1.7
.
Secondly, it is using most recent feature added in v1.7; i.e. room-description
callback returned by open
method along with dontTransmit:true
.
dontTransmit:true
can be used to override default room-transmission behaviour; i.e. onNewSession
will NEVER be fired in this case.
var roomDescriptions = connection.open( {
dontTransmit: true
} );
socketio.emit('room-description', roomDescriptions);
Your nodejs code can listen room-description
handler and uniquely identifies room using sessionid
:
// it is nodejs code
var globalRoomObject = {};
socket.on('room-description', function(roomDescriptions) {
globalRoomObject[roomDescriptions.sessionid] = roomDescriptions;
});
Now, lets say a new user opens a room-URL; you can check roomDescriptions
:
// it is nodejs code
socket.on('connection', function(socket) {
var roomid = socket.handshake.query.roomid;
if(globalRoomObject[roomid]) {
socket.emit('join-room', globalRoomObject[roomid]);
}
});
And target user's browser can observe join-room
event:
// client-side code
socket.on('join-room', function(roomDescriptions) {
connection.join( roomDescriptions );
});
And he will quickly join the room. He will not wait for onNewSession
also he will not call connect
method because join
method is enough for him.
Main trick in above code snippets is that you're sharing room-descriptions yourself using your own server implementations and your own techniques.
You're just caring about two methods: open
for initiator and join
for all roommates!
The URL that desktopCapture experiment opens is what where you can "privately" view your screen....you can share that URL via email or any mean. It means that others can't see your desktop without getting URL from you!
P.S. WebSocket messages are not encrypted that's why one can easily see some-common data using websocket logs in the chrome developer tools.
Dear Muaz Khan, By refering socketio-over-nodejs (https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs), I have replaced the signaling method "function openSignalingChannel(config) { } " for both desktop-capture.js and index.html in "desktopCapture" (https://www.webrtc-experiment.com/desktop-sharing/), to the following code, but it is not working, am I missing something?
Please kindly help, thank you.