소스 검색

Fixes call to undefined method(which fixes crash on lastN switch and when clicking contact on the contactlist).

j8
paweldomas 10 년 전
부모
커밋
420bbe136c
4개의 변경된 파일71개의 추가작업 그리고 64개의 파일을 삭제
  1. 1
    1
      index.html
  2. 35
    36
      libs/app.bundle.js
  3. 33
    25
      modules/UI/videolayout/RemoteVideo.js
  4. 2
    2
      modules/UI/videolayout/VideoLayout.js

+ 1
- 1
index.html 파일 보기

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=101"></script>
25
+    <script src="libs/app.bundle.js?v=102"></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">

+ 35
- 36
libs/app.bundle.js 파일 보기

9511
         this.VideoLayout.updateRemovedVideo(this.resourceJid);
9511
         this.VideoLayout.updateRemovedVideo(this.resourceJid);
9512
 };
9512
 };
9513
 
9513
 
9514
+RemoteVideo.prototype.waitForPlayback = function (stream) {
9515
+
9516
+    var isVideo = stream.getVideoTracks().length > 0;
9517
+    if (!isVideo || stream.id === 'mixedmslabel') {
9518
+        return;
9519
+    }
9520
+
9521
+    var self = this;
9522
+    var sel = this.VideoLayout.getPeerVideoSel(this.resourceJid);
9523
+
9524
+    // Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
9525
+    // when video playback starts
9526
+    var onPlayingHandler = function () {
9527
+        // FIXME: why do i have to do this for FF?
9528
+        if (RTCBrowserType.isFirefox()) {
9529
+            APP.RTC.attachMediaStream(sel, stream);
9530
+        }
9531
+        if (RTCBrowserType.isTemasysPluginUsed()) {
9532
+            sel = $('#' + newElementId);
9533
+        }
9534
+        self.VideoLayout.videoactive(sel, self.resourceJid);
9535
+        sel[0].onplaying = null;
9536
+        if (RTCBrowserType.isTemasysPluginUsed()) {
9537
+            // 'currentTime' is used to check if the video has started
9538
+            // and the value is not set by the plugin, so we do it
9539
+            sel[0].currentTime = 1;
9540
+        }
9541
+    };
9542
+    sel[0].onplaying = onPlayingHandler;
9543
+};
9544
+
9514
 RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream, thessrc) {
9545
 RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream, thessrc) {
9515
     if (!this.container)
9546
     if (!this.container)
9516
         return;
9547
         return;
9526
     sel.hide();
9557
     sel.hide();
9527
 
9558
 
9528
     // If the container is currently visible we attach the stream.
9559
     // If the container is currently visible we attach the stream.
9529
-    if (!isVideo
9530
-        || (this.container.offsetParent !== null && isVideo)) {
9531
-
9532
-        // Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
9533
-        // when video playback starts
9534
-        if (isVideo && stream.id !== 'mixedmslabel') {
9535
-            var onPlayingHandler = function () {
9536
-                // FIXME: why do i have to do this for FF?
9537
-                if (RTCBrowserType.isFirefox()) {
9538
-                    APP.RTC.attachMediaStream(sel, stream);
9539
-                }
9540
-                if (RTCBrowserType.isTemasysPluginUsed()) {
9541
-                    sel = $('#' + newElementId);
9542
-                }
9543
-                self.VideoLayout.videoactive(sel, self.resourceJid);
9544
-                sel[0].onplaying = null;
9545
-                if (RTCBrowserType.isTemasysPluginUsed()) {
9546
-                    // 'currentTime' is used to check if the video has started
9547
-                    // and the value is not set by the plugin, so we do it
9548
-                    sel[0].currentTime = 1;
9549
-                }
9550
-            };
9551
-            sel[0].onplaying = onPlayingHandler;
9552
-        }
9560
+    if (!isVideo || (this.container.offsetParent !== null && isVideo)) {
9561
+        waitForPlayback(stream);
9553
 
9562
 
9554
         APP.RTC.attachMediaStream(sel, stream);
9563
         APP.RTC.attachMediaStream(sel, stream);
9555
     }
9564
     }
9556
 
9565
 
9557
-    var self = this;
9558
     stream.onended = function () {
9566
     stream.onended = function () {
9559
         console.log('stream ended', this);
9567
         console.log('stream ended', this);
9560
 
9568
 
10595
         }
10603
         }
10596
 
10604
 
10597
         var resource = Strophe.getResourceFromJid(jid);
10605
         var resource = Strophe.getResourceFromJid(jid);
10598
-        var videoSel = VideoLayout.getVideoSelector(resource);
10606
+        var videoSel = VideoLayout.getPeerVideoSel(resource);
10599
         if (videoSel.length > 0) {
10607
         if (videoSel.length > 0) {
10600
             var videoThumb = videoSel[0];
10608
             var videoThumb = videoSel[0];
10601
             // It is not always the case that a videoThumb exists (if there is
10609
             // It is not always the case that a videoThumb exists (if there is
10833
 
10841
 
10834
                         updateLargeVideo = false;
10842
                         updateLargeVideo = false;
10835
                     }
10843
                     }
10836
-                    remoteVideos[resourceJid].waitForRemoteVideo(sel, mediaStream.ssrc, mediaStream.stream);
10844
+                    remoteVideos[resourceJid].waitForPlayback(mediaStream.stream);
10837
                 }
10845
                 }
10838
             });
10846
             });
10839
         }
10847
         }
14370
     });
14378
     });
14371
     this.removessrc = [];
14379
     this.removessrc = [];
14372
 
14380
 
14373
-    // FIXME:
14374
-    // this was a hack for the situation when only one peer exists
14375
-    // in the conference.
14376
-    // check if still required and remove
14377
-    if (sdp.media[0])
14378
-        sdp.media[0] = sdp.media[0].replace('a=recvonly', 'a=sendrecv');
14379
-    if (sdp.media[1])
14380
-        sdp.media[1] = sdp.media[1].replace('a=recvonly', 'a=sendrecv');
14381
-
14382
     sdp.raw = sdp.session + sdp.media.join('');
14381
     sdp.raw = sdp.session + sdp.media.join('');
14383
     this.peerconnection.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp.raw}),
14382
     this.peerconnection.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp.raw}),
14384
         function() {
14383
         function() {

+ 33
- 25
modules/UI/videolayout/RemoteVideo.js 파일 보기

165
         this.VideoLayout.updateRemovedVideo(this.resourceJid);
165
         this.VideoLayout.updateRemovedVideo(this.resourceJid);
166
 };
166
 };
167
 
167
 
168
+RemoteVideo.prototype.waitForPlayback = function (stream) {
169
+
170
+    var isVideo = stream.getVideoTracks().length > 0;
171
+    if (!isVideo || stream.id === 'mixedmslabel') {
172
+        return;
173
+    }
174
+
175
+    var self = this;
176
+    var sel = this.VideoLayout.getPeerVideoSel(this.resourceJid);
177
+
178
+    // Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
179
+    // when video playback starts
180
+    var onPlayingHandler = function () {
181
+        // FIXME: why do i have to do this for FF?
182
+        if (RTCBrowserType.isFirefox()) {
183
+            APP.RTC.attachMediaStream(sel, stream);
184
+        }
185
+        if (RTCBrowserType.isTemasysPluginUsed()) {
186
+            sel = $('#' + newElementId);
187
+        }
188
+        self.VideoLayout.videoactive(sel, self.resourceJid);
189
+        sel[0].onplaying = null;
190
+        if (RTCBrowserType.isTemasysPluginUsed()) {
191
+            // 'currentTime' is used to check if the video has started
192
+            // and the value is not set by the plugin, so we do it
193
+            sel[0].currentTime = 1;
194
+        }
195
+    };
196
+    sel[0].onplaying = onPlayingHandler;
197
+};
198
+
168
 RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream, thessrc) {
199
 RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream, thessrc) {
169
     if (!this.container)
200
     if (!this.container)
170
         return;
201
         return;
180
     sel.hide();
211
     sel.hide();
181
 
212
 
182
     // If the container is currently visible we attach the stream.
213
     // If the container is currently visible we attach the stream.
183
-    if (!isVideo
184
-        || (this.container.offsetParent !== null && isVideo)) {
185
-
186
-        // Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
187
-        // when video playback starts
188
-        if (isVideo && stream.id !== 'mixedmslabel') {
189
-            var onPlayingHandler = function () {
190
-                // FIXME: why do i have to do this for FF?
191
-                if (RTCBrowserType.isFirefox()) {
192
-                    APP.RTC.attachMediaStream(sel, stream);
193
-                }
194
-                if (RTCBrowserType.isTemasysPluginUsed()) {
195
-                    sel = $('#' + newElementId);
196
-                }
197
-                self.VideoLayout.videoactive(sel, self.resourceJid);
198
-                sel[0].onplaying = null;
199
-                if (RTCBrowserType.isTemasysPluginUsed()) {
200
-                    // 'currentTime' is used to check if the video has started
201
-                    // and the value is not set by the plugin, so we do it
202
-                    sel[0].currentTime = 1;
203
-                }
204
-            };
205
-            sel[0].onplaying = onPlayingHandler;
206
-        }
214
+    if (!isVideo || (this.container.offsetParent !== null && isVideo)) {
215
+        waitForPlayback(stream);
207
 
216
 
208
         APP.RTC.attachMediaStream(sel, stream);
217
         APP.RTC.attachMediaStream(sel, stream);
209
     }
218
     }
210
 
219
 
211
-    var self = this;
212
     stream.onended = function () {
220
     stream.onended = function () {
213
         console.log('stream ended', this);
221
         console.log('stream ended', this);
214
 
222
 

+ 2
- 2
modules/UI/videolayout/VideoLayout.js 파일 보기

475
         }
475
         }
476
 
476
 
477
         var resource = Strophe.getResourceFromJid(jid);
477
         var resource = Strophe.getResourceFromJid(jid);
478
-        var videoSel = VideoLayout.getVideoSelector(resource);
478
+        var videoSel = VideoLayout.getPeerVideoSel(resource);
479
         if (videoSel.length > 0) {
479
         if (videoSel.length > 0) {
480
             var videoThumb = videoSel[0];
480
             var videoThumb = videoSel[0];
481
             // It is not always the case that a videoThumb exists (if there is
481
             // It is not always the case that a videoThumb exists (if there is
713
 
713
 
714
                         updateLargeVideo = false;
714
                         updateLargeVideo = false;
715
                     }
715
                     }
716
-                    remoteVideos[resourceJid].waitForRemoteVideo(sel, mediaStream.ssrc, mediaStream.stream);
716
+                    remoteVideos[resourceJid].waitForPlayback(mediaStream.stream);
717
                 }
717
                 }
718
             });
718
             });
719
         }
719
         }

Loading…
취소
저장