Selaa lähdekoodia

implementation of "start muted"

master
isymchych 9 vuotta sitten
vanhempi
commit
0262917aa6

+ 1
- 0
.gitattributes Näytä tiedosto

1
 *.bundle.js -text -diff
1
 *.bundle.js -text -diff
2
+lib-jitsi-meet.js -text -diff

+ 1
- 1
app.js Näytä tiedosto

1
-/* global $, JitsiMeetJS, config, interfaceConfig */
1
+/* global $, JitsiMeetJS, config */
2
 /* application specific logic */
2
 /* application specific logic */
3
 
3
 
4
 import "babel-polyfill";
4
 import "babel-polyfill";

+ 19
- 4
conference.js Näytä tiedosto

15
 const ConferenceEvents = JitsiMeetJS.events.conference;
15
 const ConferenceEvents = JitsiMeetJS.events.conference;
16
 const ConferenceErrors = JitsiMeetJS.errors.conference;
16
 const ConferenceErrors = JitsiMeetJS.errors.conference;
17
 
17
 
18
-let room, connection, localTracks, localAudio, localVideo;
19
-let roomLocker = createRoomLocker(room);
18
+let room, connection, localTracks, localAudio, localVideo, roomLocker;
20
 
19
 
21
 const Commands = {
20
 const Commands = {
22
     CONNECTION_QUALITY: "stats",
21
     CONNECTION_QUALITY: "stats",
223
         return room.isSIPCallingSupported();
222
         return room.isSIPCallingSupported();
224
     },
223
     },
225
     get membersCount () {
224
     get membersCount () {
226
-        return room.getParticipants().length; // FIXME maybe +1?
225
+        return room.getParticipants().length + 1;
226
+    },
227
+    get startAudioMuted () {
228
+        return room && room.isStartAudioMuted();
229
+    },
230
+    get startVideoMuted () {
231
+        return room && room.isStartVideoMuted();
227
     },
232
     },
228
     // used by torture currently
233
     // used by torture currently
229
     isJoined () {
234
     isJoined () {
241
     _createRoom () {
246
     _createRoom () {
242
         room = connection.initJitsiConference(APP.conference.roomName,
247
         room = connection.initJitsiConference(APP.conference.roomName,
243
             this._getConferenceOptions());
248
             this._getConferenceOptions());
249
+        roomLocker = createRoomLocker(room);
244
         this._room = room; // FIXME do not use this
250
         this._room = room; // FIXME do not use this
245
         this.localId = room.myUserId();
251
         this.localId = room.myUserId();
246
 
252
 
508
 
514
 
509
         APP.UI.addListener(UIEvents.START_MUTED_CHANGED,
515
         APP.UI.addListener(UIEvents.START_MUTED_CHANGED,
510
             (startAudioMuted, startVideoMuted) => {
516
             (startAudioMuted, startVideoMuted) => {
511
-                // FIXME start muted
517
+                room.setStartMuted(startAudioMuted, startVideoMuted);
518
+            }
519
+        );
520
+        room.on(
521
+            ConferenceEvents.START_MUTED,
522
+            function (startAudioMuted, startVideoMuted, initiallyMuted) {
523
+                APP.UI.onStartMutedChanged();
524
+                if (initiallyMuted) {
525
+                    APP.UI.notifyInitiallyMuted();
526
+                }
512
             }
527
             }
513
         );
528
         );
514
 
529
 

+ 1206
- 755
libs/lib-jitsi-meet.js
File diff suppressed because it is too large
Näytä tiedosto


+ 4
- 0
modules/UI/UI.js Näytä tiedosto

781
   }
781
   }
782
 };
782
 };
783
 
783
 
784
+UI.onStartMutedChanged = function () {
785
+    SettingsMenu.onStartMutedChanged();
786
+};
787
+
784
 module.exports = UI;
788
 module.exports = UI;

+ 48
- 50
modules/UI/side_pannels/settings/SettingsMenu.js Näytä tiedosto

2
 import UIUtil from "../../util/UIUtil";
2
 import UIUtil from "../../util/UIUtil";
3
 import UIEvents from "../../../../service/UI/UIEvents";
3
 import UIEvents from "../../../../service/UI/UIEvents";
4
 import languages from "../../../../service/translation/languages";
4
 import languages from "../../../../service/translation/languages";
5
+import Settings from '../../../settings/Settings';
5
 
6
 
6
 function generateLanguagesSelectBox() {
7
 function generateLanguagesSelectBox() {
7
     var currentLang = APP.translation.getCurrentLanguage();
8
     var currentLang = APP.translation.getCurrentLanguage();
21
 }
22
 }
22
 
23
 
23
 
24
 
24
-const SettingsMenu = {
25
+export default {
26
+    init (emitter) {
27
+        function update() {
28
+            let displayName = UIUtil.escapeHtml($('#setDisplayName').val());
25
 
29
 
26
-    init: function (emitter) {
27
-        this.emitter = emitter;
30
+            if (displayName && Settings.getDisplayName() !== displayName) {
31
+                emitter.emit(UIEvents.NICKNAME_CHANGED, displayName);
32
+            }
28
 
33
 
29
-        var startMutedSelector = $("#startMutedOptions");
30
-        startMutedSelector.before(generateLanguagesSelectBox());
31
-        APP.translation.translateElement($("#languages_selectbox"));
32
-        $('#settingsmenu>input').keyup(function(event){
33
-            if(event.keyCode === 13) {//enter
34
-                SettingsMenu.update();
34
+            let language = $("#languages_selectbox").val();
35
+            if (language !== Settings.getLanguage()) {
36
+                emitter.emit(UIEvents.LANG_CHANGED, language);
37
+            }
38
+
39
+            let email = UIUtil.escapeHtml($('#setEmail').val());
40
+            if (email !== Settings.getEmail()) {
41
+                emitter.emit(UIEvents.EMAIL_CHANGED, email);
35
             }
42
             }
36
-        });
37
 
43
 
38
-        if (APP.conference.isModerator) {
39
-            startMutedSelector.css("display", "block");
40
-        } else {
41
-            startMutedSelector.css("display", "none");
44
+            let startAudioMuted = $("#startAudioMuted").is(":checked");
45
+            let startVideoMuted = $("#startVideoMuted").is(":checked");
46
+            if (startAudioMuted !== APP.conference.startAudioMuted
47
+                || startVideoMuted !== APP.conference.startVideoMuted) {
48
+                emitter.emit(
49
+                    UIEvents.START_MUTED_CHANGED,
50
+                    startAudioMuted,
51
+                    startVideoMuted
52
+                );
53
+            }
42
         }
54
         }
43
 
55
 
44
-        $("#updateSettings").click(function () {
45
-            SettingsMenu.update();
56
+        let startMutedBlock = $("#startMutedOptions");
57
+        startMutedBlock.before(generateLanguagesSelectBox());
58
+        APP.translation.translateElement($("#languages_selectbox"));
59
+
60
+        this.onRoleChanged();
61
+        this.onStartMutedChanged();
62
+
63
+        $("#updateSettings").click(update);
64
+        $('#settingsmenu>input').keyup(function(event){
65
+            if (event.keyCode === 13) {//enter
66
+                update();
67
+            }
46
         });
68
         });
47
     },
69
     },
48
 
70
 
49
-    onRoleChanged: function () {
71
+    onRoleChanged () {
50
         if(APP.conference.isModerator) {
72
         if(APP.conference.isModerator) {
51
             $("#startMutedOptions").css("display", "block");
73
             $("#startMutedOptions").css("display", "block");
52
         }
74
         }
55
         }
77
         }
56
     },
78
     },
57
 
79
 
58
-    setStartMuted: function (audio, video) {
59
-        $("#startAudioMuted").attr("checked", audio);
60
-        $("#startVideoMuted").attr("checked", video);
61
-    },
62
-
63
-    update: function() {
64
-        // FIXME check if this values really changed:
65
-        // compare them with Settings etc.
66
-        var newDisplayName =
67
-                UIUtil.escapeHtml($('#setDisplayName').get(0).value);
68
-
69
-        if (newDisplayName) {
70
-            this.emitter.emit(UIEvents.NICKNAME_CHANGED, newDisplayName);
71
-        }
72
-
73
-        var language = $("#languages_selectbox").val();
74
-        this.emitter.emit(UIEvents.LANG_CHANGED, language);
75
-
76
-        var newEmail = UIUtil.escapeHtml($('#setEmail').get(0).value);
77
-        this.emitter.emit(UIEvents.EMAIL_CHANGED, newEmail);
78
-
79
-        var startAudioMuted = ($("#startAudioMuted").is(":checked"));
80
-        var startVideoMuted = ($("#startVideoMuted").is(":checked"));
81
-        this.emitter.emit(
82
-            UIEvents.START_MUTED_CHANGED, startAudioMuted, startVideoMuted
83
-        );
80
+    onStartMutedChanged () {
81
+        $("#startAudioMuted").attr("checked", APP.conference.startAudioMuted);
82
+        $("#startVideoMuted").attr("checked", APP.conference.startVideoMuted);
84
     },
83
     },
85
 
84
 
86
-    isVisible: function() {
85
+    isVisible () {
87
         return $('#settingsmenu').is(':visible');
86
         return $('#settingsmenu').is(':visible');
88
     },
87
     },
89
 
88
 
90
-    onDisplayNameChange: function(id, newDisplayName) {
89
+    onDisplayNameChange (id, newDisplayName) {
91
         if(id === 'localVideoContainer' || APP.conference.isLocalId(id)) {
90
         if(id === 'localVideoContainer' || APP.conference.isLocalId(id)) {
92
-            $('#setDisplayName').get(0).value = newDisplayName;
91
+            $('#setDisplayName').val(newDisplayName);
93
         }
92
         }
94
     },
93
     },
95
-    changeAvatar: function (thumbUrl) {
96
-        $('#avatar').get(0).src = thumbUrl;
94
+
95
+    changeAvatar (thumbUrl) {
96
+        $('#avatar').attr('src', thumbUrl);
97
     }
97
     }
98
 };
98
 };
99
-
100
-export default SettingsMenu;

+ 3
- 1
modules/UI/videolayout/VideoLayout.js Näytä tiedosto

157
         let {thumbWidth, thumbHeight} = this.calculateThumbnailSize();
157
         let {thumbWidth, thumbHeight} = this.calculateThumbnailSize();
158
         AudioLevels.updateAudioLevelCanvas(null, thumbWidth, thumbHeight);
158
         AudioLevels.updateAudioLevelCanvas(null, thumbWidth, thumbHeight);
159
 
159
 
160
-        localVideoThumbnail.changeVideo(stream);
160
+        if (!stream.isMuted()) {
161
+            localVideoThumbnail.changeVideo(stream);
162
+        }
161
 
163
 
162
         /* force update if we're currently being displayed */
164
         /* force update if we're currently being displayed */
163
         if (this.isCurrentlyOnLarge(localId)) {
165
         if (this.isCurrentlyOnLarge(localId)) {

+ 1
- 1
modules/desktopsharing/desktopsharing.js Näytä tiedosto

97
         } else {
97
         } else {
98
             type = "video";
98
             type = "video";
99
         }
99
         }
100
-        APP.createLocalTracks(type).then(function (tracks) {
100
+        APP.conference.createLocalTracks(type).then(function (tracks) {
101
             if (!tracks.length) {
101
             if (!tracks.length) {
102
                 if (type === 'desktop') {
102
                 if (type === 'desktop') {
103
                     getDesktopStreamFailed();
103
                     getDesktopStreamFailed();

+ 0
- 2
service/xmpp/XMPPEvents.js Näytä tiedosto

86
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
86
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
87
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
87
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
88
     FOCUS_DISCONNECTED: 'xmpp.focus_disconnected',
88
     FOCUS_DISCONNECTED: 'xmpp.focus_disconnected',
89
-    ROOM_JOIN_ERROR: 'xmpp.room_join_error',
90
-    ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
91
     // xmpp is connected and obtained user media
89
     // xmpp is connected and obtained user media
92
     READY_TO_JOIN: 'xmpp.ready_to_join'
90
     READY_TO_JOIN: 'xmpp.ready_to_join'
93
 };
91
 };

Loading…
Peruuta
Tallenna