|
@@ -687,27 +687,34 @@ var VideoLayout = {
|
687
|
687
|
/**
|
688
|
688
|
* On last N change event.
|
689
|
689
|
*
|
690
|
|
- * @param lastNEndpoints the list of last N endpoints
|
|
690
|
+ * @param endpointsLeavingLastN the list currently leaving last N
|
|
691
|
+ * endpoints
|
691
|
692
|
* @param endpointsEnteringLastN the list currently entering last N
|
692
|
693
|
* endpoints
|
693
|
694
|
*/
|
694
|
|
- onLastNEndpointsChanged (lastNEndpoints, endpointsEnteringLastN) {
|
695
|
|
-
|
696
|
|
- Object.keys(remoteVideos).forEach(
|
697
|
|
- id => {
|
698
|
|
- if (lastNEndpoints.length > 0
|
699
|
|
- && lastNEndpoints.indexOf(id) < 0
|
700
|
|
- || endpointsEnteringLastN.length > 0
|
701
|
|
- && endpointsEnteringLastN.indexOf(id) > 0) {
|
702
|
|
-
|
703
|
|
- let remoteVideo = (id) ? remoteVideos[id] : null;
|
704
|
|
- if (remoteVideo) {
|
705
|
|
- remoteVideo.updateView();
|
706
|
|
- if (remoteVideo.isCurrentlyOnLargeVideo())
|
707
|
|
- this.updateLargeVideo(id);
|
708
|
|
- }
|
709
|
|
- }
|
710
|
|
- });
|
|
695
|
+ onLastNEndpointsChanged (endpointsLeavingLastN, endpointsEnteringLastN) {
|
|
696
|
+ if (endpointsLeavingLastN) {
|
|
697
|
+ endpointsLeavingLastN.forEach(this._updateRemoteVideo, this);
|
|
698
|
+ }
|
|
699
|
+
|
|
700
|
+ if (endpointsEnteringLastN) {
|
|
701
|
+ endpointsEnteringLastN.forEach(this._updateRemoteVideo, this);
|
|
702
|
+ }
|
|
703
|
+ },
|
|
704
|
+
|
|
705
|
+ /**
|
|
706
|
+ * Updates remote video by id if it exists.
|
|
707
|
+ * @param {string} id of the remote video
|
|
708
|
+ * @private
|
|
709
|
+ */
|
|
710
|
+ _updateRemoteVideo(id) {
|
|
711
|
+ const remoteVideo = remoteVideos[id];
|
|
712
|
+ if (remoteVideo) {
|
|
713
|
+ remoteVideo.updateView();
|
|
714
|
+ if (remoteVideo.isCurrentlyOnLargeVideo()) {
|
|
715
|
+ this.updateLargeVideo(id);
|
|
716
|
+ }
|
|
717
|
+ }
|
711
|
718
|
},
|
712
|
719
|
|
713
|
720
|
/**
|