浏览代码

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

master
paweldomas 11 年前
父节点
当前提交
a1a0f5d4cf
共有 2 个文件被更改,包括 16 次插入3 次删除
  1. 16
    2
      app.js
  2. 0
    1
      desktopsharing.js

+ 16
- 2
app.js 查看文件

483
     var i = 0;
483
     var i = 0;
484
     Object.keys(newssrcs).forEach(function (mtype) {
484
     Object.keys(newssrcs).forEach(function (mtype) {
485
         i++;
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
     if (i > 0) {
493
     if (i > 0) {
489
         connection.emuc.sendPresence();
494
         connection.emuc.sendPresence();
597
         //console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
602
         //console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
598
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
603
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
599
 
604
 
605
+        var type = ssrc.getAttribute('type');
600
         // might need to update the direction if participant just went from sendrecv to recvonly
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
             var el = $('#participant_'  + Strophe.getResourceFromJid(jid) + '>video');
608
             var el = $('#participant_'  + Strophe.getResourceFromJid(jid) + '>video');
603
             switch(ssrc.getAttribute('direction')) {
609
             switch(ssrc.getAttribute('direction')) {
604
             case 'sendrecv':
610
             case 'sendrecv':
610
                 //checkChangeLargeVideo(el);
616
                 //checkChangeLargeVideo(el);
611
                 break;
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 查看文件

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

正在加载...
取消
保存