Browse Source

Remove self and use this instead in conference.js

master
yanas 9 years ago
parent
commit
9ef43d1fe7
1 changed files with 10 additions and 12 deletions
  1. 10
    12
      conference.js

+ 10
- 12
conference.js View File

723
      * Setup interaction between conference and UI.
723
      * Setup interaction between conference and UI.
724
      */
724
      */
725
     _setupListeners () {
725
     _setupListeners () {
726
-        var self = this;
727
-
728
         // add local streams when joined to the conference
726
         // add local streams when joined to the conference
729
         room.on(ConferenceEvents.CONFERENCE_JOINED, () => {
727
         room.on(ConferenceEvents.CONFERENCE_JOINED, () => {
730
             APP.UI.mucJoined();
728
             APP.UI.mucJoined();
907
                 APP.UI.updateLocalStats(percent, stats);
905
                 APP.UI.updateLocalStats(percent, stats);
908
 
906
 
909
                 // send local stats to other users
907
                 // send local stats to other users
910
-                room.sendCommandOnce(self.commands.defaults.CONNECTION_QUALITY,
908
+                room.sendCommandOnce(this.commands.defaults.CONNECTION_QUALITY,
911
                 {
909
                 {
912
                     children: ConnectionQuality.convertToMUCStats(stats),
910
                     children: ConnectionQuality.convertToMUCStats(stats),
913
                     attributes: {
911
                     attributes: {
918
         );
916
         );
919
 
917
 
920
         // listen to remote stats
918
         // listen to remote stats
921
-        room.addCommandListener(self.commands.defaults.CONNECTION_QUALITY,
919
+        room.addCommandListener(this.commands.defaults.CONNECTION_QUALITY,
922
             (values, from) => {
920
             (values, from) => {
923
                 ConnectionQuality.updateRemoteStats(from, values);
921
                 ConnectionQuality.updateRemoteStats(from, values);
924
         });
922
         });
928
                 APP.UI.updateRemoteStats(id, percent, stats);
926
                 APP.UI.updateRemoteStats(id, percent, stats);
929
             });
927
             });
930
 
928
 
931
-        room.addCommandListener(self.commands.defaults.ETHERPAD, ({value}) => {
929
+        room.addCommandListener(this.commands.defaults.ETHERPAD, ({value}) => {
932
             APP.UI.initEtherpad(value);
930
             APP.UI.initEtherpad(value);
933
         });
931
         });
934
 
932
 
941
 
939
 
942
             APP.settings.setEmail(email);
940
             APP.settings.setEmail(email);
943
             APP.UI.setUserAvatar(room.myUserId(), email);
941
             APP.UI.setUserAvatar(room.myUserId(), email);
944
-            sendEmail(self.commands.defaults.EMAIL, email);
942
+            sendEmail(this.commands.defaults.EMAIL, email);
945
         });
943
         });
946
-        room.addCommandListener(self.commands.defaults.EMAIL, (data) => {
944
+        room.addCommandListener(this.commands.defaults.EMAIL, (data) => {
947
             APP.UI.setUserAvatar(data.attributes.id, data.value);
945
             APP.UI.setUserAvatar(data.attributes.id, data.value);
948
         });
946
         });
949
 
947
 
1088
             // send start and stop commands once, and remove any updates
1086
             // send start and stop commands once, and remove any updates
1089
             // that had left
1087
             // that had left
1090
             if (state === 'stop' || state === 'start' || state === 'playing') {
1088
             if (state === 'stop' || state === 'start' || state === 'playing') {
1091
-                room.removeCommand(self.commands.defaults.SHARED_VIDEO);
1092
-                room.sendCommandOnce(self.commands.defaults.SHARED_VIDEO, {
1089
+                room.removeCommand(this.commands.defaults.SHARED_VIDEO);
1090
+                room.sendCommandOnce(this.commands.defaults.SHARED_VIDEO, {
1093
                     value: url,
1091
                     value: url,
1094
                     attributes: {
1092
                     attributes: {
1095
                         state: state,
1093
                         state: state,
1101
             else {
1099
             else {
1102
                 // in case of paused, in order to allow late users to join
1100
                 // in case of paused, in order to allow late users to join
1103
                 // paused
1101
                 // paused
1104
-                room.removeCommand(self.commands.defaults.SHARED_VIDEO);
1105
-                room.sendCommand(self.commands.defaults.SHARED_VIDEO, {
1102
+                room.removeCommand(this.commands.defaults.SHARED_VIDEO);
1103
+                room.sendCommand(this.commands.defaults.SHARED_VIDEO, {
1106
                     value: url,
1104
                     value: url,
1107
                     attributes: {
1105
                     attributes: {
1108
                         state: state,
1106
                         state: state,
1113
             }
1111
             }
1114
         });
1112
         });
1115
         room.addCommandListener(
1113
         room.addCommandListener(
1116
-            self.commands.defaults.SHARED_VIDEO, ({value, attributes}, id) => {
1114
+            this.commands.defaults.SHARED_VIDEO, ({value, attributes}, id) => {
1117
 
1115
 
1118
                 if (attributes.state === 'stop') {
1116
                 if (attributes.state === 'stop') {
1119
                     APP.UI.stopSharedVideo(id, attributes);
1117
                     APP.UI.stopSharedVideo(id, attributes);

Loading…
Cancel
Save