Browse Source

Fixes issue with switching to the screen stream before conference starts(when we're still alone in the room).

j8
paweldomas 9 years ago
parent
commit
6ec7be09f2

+ 1
- 1
index.html View File

22
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
22
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
23
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
23
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
24
     <script src="interface_config.js?v=5"></script>
24
     <script src="interface_config.js?v=5"></script>
25
-    <script src="libs/app.bundle.js?v=97"></script>
25
+    <script src="libs/app.bundle.js?v=98"></script>
26
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
26
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
27
     <link rel="stylesheet" href="css/font.css?v=7"/>
27
     <link rel="stylesheet" href="css/font.css?v=7"/>
28
     <link rel="stylesheet" href="css/toastr.css?v=1">
28
     <link rel="stylesheet" href="css/toastr.css?v=1">

+ 13
- 7
libs/app.bundle.js View File

1325
         this.localVideo = this.createLocalStream(videoStream, "video", true, type);
1325
         this.localVideo = this.createLocalStream(videoStream, "video", true, type);
1326
         // Stop the stream to trigger onended event for old stream
1326
         // Stop the stream to trigger onended event for old stream
1327
         oldStream.stop();
1327
         oldStream.stop();
1328
+
1329
+        this.switchVideoStreams(videoStream, oldStream);
1330
+
1328
         APP.xmpp.switchStreams(videoStream, oldStream,localCallback);
1331
         APP.xmpp.switchStreams(videoStream, oldStream,localCallback);
1329
     },
1332
     },
1330
     changeLocalAudio: function (stream, callback) {
1333
     changeLocalAudio: function (stream, callback) {
8591
 
8594
 
8592
         localVideoThumbnail.changeVideo(stream, isMuted);
8595
         localVideoThumbnail.changeVideo(stream, isMuted);
8593
 
8596
 
8594
-        LargeVideo.updateLargeVideo(APP.xmpp.myResource());
8597
+        LargeVideo.updateLargeVideo(
8598
+            APP.xmpp.myResource(),
8599
+            /* force update only before conference starts */
8600
+            !APP.xmpp.isConferenceInProgress());
8595
 
8601
 
8596
     };
8602
     };
8597
 
8603
 
12768
             self.peerconnection.addStream(new_stream);
12774
             self.peerconnection.addStream(new_stream);
12769
     }
12775
     }
12770
 
12776
 
12771
-    if(!isAudio)
12772
-    APP.RTC.switchVideoStreams(new_stream, oldStream);
12773
-
12774
     // Conference is not active
12777
     // Conference is not active
12775
     if(!oldSdp || !self.peerconnection) {
12778
     if(!oldSdp || !self.peerconnection) {
12776
         success_callback();
12779
         success_callback();
16846
     isExternalAuthEnabled: function () {
16849
     isExternalAuthEnabled: function () {
16847
         return Moderator.isExternalAuthEnabled();
16850
         return Moderator.isExternalAuthEnabled();
16848
     },
16851
     },
16852
+    isConferenceInProgress: function () {
16853
+        return connection && connection.jingle.activecall &&
16854
+            connection.jingle.activecall.peerconnection;
16855
+    },
16849
     switchStreams: function (stream, oldStream, callback, isAudio) {
16856
     switchStreams: function (stream, oldStream, callback, isAudio) {
16850
-        if (connection && connection.jingle.activecall) {
16857
+        if (this.isConferenceInProgress()) {
16851
             // FIXME: will block switchInProgress on true value in case of exception
16858
             // FIXME: will block switchInProgress on true value in case of exception
16852
             connection.jingle.activecall.switchStreams(stream, oldStream, callback, isAudio);
16859
             connection.jingle.activecall.switchStreams(stream, oldStream, callback, isAudio);
16853
         } else {
16860
         } else {
17085
         return connection.jingle.sessions;
17092
         return connection.jingle.sessions;
17086
     },
17093
     },
17087
     removeStream: function (stream) {
17094
     removeStream: function (stream) {
17088
-        if(!connection || !connection.jingle.activecall ||
17089
-            !connection.jingle.activecall.peerconnection)
17095
+        if (!this.isConferenceInProgress())
17090
             return;
17096
             return;
17091
         connection.jingle.activecall.peerconnection.removeStream(stream);
17097
         connection.jingle.activecall.peerconnection.removeStream(stream);
17092
     }
17098
     }

+ 3
- 0
modules/RTC/RTC.js View File

215
         this.localVideo = this.createLocalStream(videoStream, "video", true, type);
215
         this.localVideo = this.createLocalStream(videoStream, "video", true, type);
216
         // Stop the stream to trigger onended event for old stream
216
         // Stop the stream to trigger onended event for old stream
217
         oldStream.stop();
217
         oldStream.stop();
218
+
219
+        this.switchVideoStreams(videoStream, oldStream);
220
+
218
         APP.xmpp.switchStreams(videoStream, oldStream,localCallback);
221
         APP.xmpp.switchStreams(videoStream, oldStream,localCallback);
219
     },
222
     },
220
     changeLocalAudio: function (stream, callback) {
223
     changeLocalAudio: function (stream, callback) {

+ 4
- 1
modules/UI/videolayout/VideoLayout.js View File

64
 
64
 
65
         localVideoThumbnail.changeVideo(stream, isMuted);
65
         localVideoThumbnail.changeVideo(stream, isMuted);
66
 
66
 
67
-        LargeVideo.updateLargeVideo(APP.xmpp.myResource());
67
+        LargeVideo.updateLargeVideo(
68
+            APP.xmpp.myResource(),
69
+            /* force update only before conference starts */
70
+            !APP.xmpp.isConferenceInProgress());
68
 
71
 
69
     };
72
     };
70
 
73
 

+ 0
- 3
modules/xmpp/JingleSession.js View File

1020
             self.peerconnection.addStream(new_stream);
1020
             self.peerconnection.addStream(new_stream);
1021
     }
1021
     }
1022
 
1022
 
1023
-    if(!isAudio)
1024
-    APP.RTC.switchVideoStreams(new_stream, oldStream);
1025
-
1026
     // Conference is not active
1023
     // Conference is not active
1027
     if(!oldSdp || !self.peerconnection) {
1024
     if(!oldSdp || !self.peerconnection) {
1028
         success_callback();
1025
         success_callback();

+ 6
- 3
modules/xmpp/xmpp.js View File

362
     isExternalAuthEnabled: function () {
362
     isExternalAuthEnabled: function () {
363
         return Moderator.isExternalAuthEnabled();
363
         return Moderator.isExternalAuthEnabled();
364
     },
364
     },
365
+    isConferenceInProgress: function () {
366
+        return connection && connection.jingle.activecall &&
367
+            connection.jingle.activecall.peerconnection;
368
+    },
365
     switchStreams: function (stream, oldStream, callback, isAudio) {
369
     switchStreams: function (stream, oldStream, callback, isAudio) {
366
-        if (connection && connection.jingle.activecall) {
370
+        if (this.isConferenceInProgress()) {
367
             // FIXME: will block switchInProgress on true value in case of exception
371
             // FIXME: will block switchInProgress on true value in case of exception
368
             connection.jingle.activecall.switchStreams(stream, oldStream, callback, isAudio);
372
             connection.jingle.activecall.switchStreams(stream, oldStream, callback, isAudio);
369
         } else {
373
         } else {
601
         return connection.jingle.sessions;
605
         return connection.jingle.sessions;
602
     },
606
     },
603
     removeStream: function (stream) {
607
     removeStream: function (stream) {
604
-        if(!connection || !connection.jingle.activecall ||
605
-            !connection.jingle.activecall.peerconnection)
608
+        if (!this.isConferenceInProgress())
606
             return;
609
             return;
607
         connection.jingle.activecall.peerconnection.removeStream(stream);
610
         connection.jingle.activecall.peerconnection.removeStream(stream);
608
     }
611
     }

Loading…
Cancel
Save