Browse Source

Adds shared screen media type to presence. Removes unnecessary log msg.

master
paweldomas 11 years ago
parent
commit
a1a0f5d4cf
2 changed files with 16 additions and 3 deletions
  1. 16
    2
      app.js
  2. 0
    1
      desktopsharing.js

+ 16
- 2
app.js View File

@@ -483,7 +483,12 @@ $(document).bind('setLocalDescription.jingle', function (event, sid) {
483 483
     var i = 0;
484 484
     Object.keys(newssrcs).forEach(function (mtype) {
485 485
         i++;
486
-        connection.emuc.addMediaToPresence(i, mtype, newssrcs[mtype], directions[mtype]);
486
+        var type = mtype;
487
+        // Change video type to screen
488
+        if(mtype === 'video' && isUsingScreenStream) {
489
+            type = 'screen';
490
+        }
491
+        connection.emuc.addMediaToPresence(i, type, newssrcs[mtype], directions[mtype]);
487 492
     });
488 493
     if (i > 0) {
489 494
         connection.emuc.sendPresence();
@@ -597,8 +602,9 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {
597 602
         //console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
598 603
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
599 604
 
605
+        var type = ssrc.getAttribute('type');
600 606
         // might need to update the direction if participant just went from sendrecv to recvonly
601
-        if (ssrc.getAttribute('type') === 'video') {
607
+        if (type === 'video' || type === 'screen') {
602 608
             var el = $('#participant_'  + Strophe.getResourceFromJid(jid) + '>video');
603 609
             switch(ssrc.getAttribute('direction')) {
604 610
             case 'sendrecv':
@@ -610,6 +616,14 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {
610 616
                 //checkChangeLargeVideo(el);
611 617
                 break;
612 618
             }
619
+            // Camera video or shared screen ?
620
+            if (type === 'screen') {
621
+                // Shared screen
622
+                //console.info("Have screen ssrc from "+jid, ssrc);
623
+            } else {
624
+                // Camera video
625
+                //console.info("Have camera ssrc from "+jid, ssrc);
626
+            }
613 627
         }
614 628
     });
615 629
 

+ 0
- 1
desktopsharing.js View File

@@ -120,7 +120,6 @@ function newStreamCreated(stream) {
120 120
 
121 121
     var conferenceHandler = getConferenceHandler();
122 122
     if(conferenceHandler) {
123
-        console.info("Conference considered as started");
124 123
         // FIXME: will block switchInProgress on true value in case of exception
125 124
         conferenceHandler.switchStreams(stream, oldStream, streamSwitchDone);
126 125
     } else {

Loading…
Cancel
Save