Pārlūkot izejas kodu

Updates use of recording states, add some information texts and notifications.

master
damencho 10 gadus atpakaļ
vecāks
revīzija
4092d67853

+ 5
- 0
css/videolayout_default.css Parādīt failu

446
     background-position: center;
446
     background-position: center;
447
 }
447
 }
448
 
448
 
449
+.videoMessageFilter {
450
+    -webkit-filter: grayscale(.5) opacity(0.8);
451
+    filter: grayscale(.5) opacity(0.8);
452
+}
453
+
449
 .videoProblemFilter {
454
 .videoProblemFilter {
450
     -webkit-filter: blur(10px) grayscale(.5) opacity(0.8);
455
     -webkit-filter: blur(10px) grayscale(.5) opacity(0.8);
451
     filter: blur(10px) grayscale(.5) opacity(0.8);
456
     filter: blur(10px) grayscale(.5) opacity(0.8);

+ 1
- 1
index.html Parādīt failu

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

+ 6
- 0
lang/main.json Parādīt failu

240
         "FETCH_SESSION_ID": "Obtaining session-id...",
240
         "FETCH_SESSION_ID": "Obtaining session-id...",
241
         "GOT_SESSION_ID": "Obtaining session-id... Done",
241
         "GOT_SESSION_ID": "Obtaining session-id... Done",
242
         "GET_SESSION_ID_ERROR": "Get session-id error: "
242
         "GET_SESSION_ID_ERROR": "Get session-id error: "
243
+    },
244
+    "recording":
245
+    {
246
+        "toaster": "Currently recording!",
247
+        "pending": "Your recording will start as soon as another participant joins",
248
+        "on": "Recording has been started"
243
     }
249
     }
244
 }
250
 }

+ 22692
- 22594
libs/app.bundle.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 35
- 4
modules/UI/toolbars/Toolbar.js Parādīt failu

13
 var roomUrl = null;
13
 var roomUrl = null;
14
 var sharedKey = '';
14
 var sharedKey = '';
15
 var UI = null;
15
 var UI = null;
16
+var recordingToaster = null;
16
 
17
 
17
 var buttonHandlers = {
18
 var buttonHandlers = {
18
     "toolbar_button_mute": function () {
19
     "toolbar_button_mute": function () {
147
             function () { },
148
             function () { },
148
             ':input:first'
149
             ':input:first'
149
         );
150
         );
150
-    }, Toolbar.setRecordingButtonState, Toolbar.setRecordingButtonState);
151
+    }, Toolbar.setRecordingButtonState);
151
 }
152
 }
152
 
153
 
153
 /**
154
 /**
548
     };
549
     };
549
 
550
 
550
     // Sets the state of the recording button
551
     // Sets the state of the recording button
551
-    my.setRecordingButtonState = function (isRecording) {
552
+    my.setRecordingButtonState = function (recordingState) {
552
         var selector = $('#recordButton');
553
         var selector = $('#recordButton');
553
-        if (isRecording) {
554
+
555
+        if (recordingState === 'on') {
554
             selector.removeClass("icon-recEnable");
556
             selector.removeClass("icon-recEnable");
555
             selector.addClass("icon-recEnable active");
557
             selector.addClass("icon-recEnable active");
556
-        } else {
558
+
559
+            $("#largeVideo").toggleClass("videoMessageFilter", true);
560
+            var recordOnKey = "recording.on";
561
+            $('#videoConnectionMessage').attr("data-i18n", recordOnKey);
562
+            $('#videoConnectionMessage').text(APP.translation.translateString(recordOnKey));
563
+
564
+            setTimeout(function(){
565
+                $("#largeVideo").toggleClass("videoMessageFilter", false);
566
+                $('#videoConnectionMessage').css({display: "none"});
567
+            }, 1500);
568
+
569
+            recordingToaster = messageHandler.notify(null, "recording.toaster", null,
570
+                null, null, {timeOut: 0, closeButton: null});
571
+        } else if (recordingState === 'off') {
557
             selector.removeClass("icon-recEnable active");
572
             selector.removeClass("icon-recEnable active");
558
             selector.addClass("icon-recEnable");
573
             selector.addClass("icon-recEnable");
574
+
575
+            $("#largeVideo").toggleClass("videoMessageFilter", false);
576
+            $('#videoConnectionMessage').css({display: "none"});
577
+
578
+            if (recordingToaster)
579
+                messageHandler.remove(recordingToaster);
580
+
581
+        } else if (recordingState === 'pending') {
582
+            selector.removeClass("icon-recEnable active");
583
+            selector.addClass("icon-recEnable");
584
+
585
+            $("#largeVideo").toggleClass("videoMessageFilter", true);
586
+            var recordPendingKey = "recording.pending";
587
+            $('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
588
+            $('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
589
+            $('#videoConnectionMessage').css({display: "block"});
559
         }
590
         }
560
     };
591
     };
561
 
592
 

+ 9
- 1
modules/UI/util/MessageHandler.js Parādīt failu

182
                 "'>" + APP.translation.translateString(displayNameKey);
182
                 "'>" + APP.translation.translateString(displayNameKey);
183
         }
183
         }
184
         displayNameSpan += "</span>";
184
         displayNameSpan += "</span>";
185
-        toastr.info(
185
+        return toastr.info(
186
             displayNameSpan + '<br>' +
186
             displayNameSpan + '<br>' +
187
             '<span class=' + cls + ' data-i18n="' + messageKey + '"' +
187
             '<span class=' + cls + ' data-i18n="' + messageKey + '"' +
188
                 (messageArguments?
188
                 (messageArguments?
193
             '</span>', null, options);
193
             '</span>', null, options);
194
     };
194
     };
195
 
195
 
196
+    /**
197
+     * Removes the toaster.
198
+     * @param toasterElement
199
+     */
200
+    my.remove = function(toasterElement) {
201
+        toasterElement.remove();
202
+    };
203
+
196
     return my;
204
     return my;
197
 }(messageHandler || {}));
205
 }(messageHandler || {}));
198
 
206
 

+ 26
- 12
modules/xmpp/recording.js Parādīt failu

19
  */
19
  */
20
 var jireconRid = null;
20
 var jireconRid = null;
21
 
21
 
22
+/**
23
+ * The callback to update the recording button. Currently used from colibri
24
+ * after receiving a pending status.
25
+ */
26
+var recordingStateChangeCallback = null;
27
+
22
 function setRecordingToken(token) {
28
 function setRecordingToken(token) {
23
     recordingToken = token;
29
     recordingToken = token;
24
 }
30
 }
30
 
36
 
31
     var iq = $iq({to: config.hosts.jirecon, type: 'set'})
37
     var iq = $iq({to: config.hosts.jirecon, type: 'set'})
32
         .c('recording', {xmlns: 'http://jitsi.org/protocol/jirecon',
38
         .c('recording', {xmlns: 'http://jitsi.org/protocol/jirecon',
33
-            action: state ? 'start' : 'stop',
39
+            action: (state === 'on') ? 'start' : 'stop',
34
             mucjid: connection.emuc.roomjid});
40
             mucjid: connection.emuc.roomjid});
35
-    if (!state){
41
+    if (state === 'off'){
36
         iq.attrs({rid: jireconRid});
42
         iq.attrs({rid: jireconRid});
37
     }
43
     }
38
 
44
 
44
             // TODO wait for an IQ with the real status, since this is
50
             // TODO wait for an IQ with the real status, since this is
45
             // provisional?
51
             // provisional?
46
             jireconRid = $(result).find('recording').attr('rid');
52
             jireconRid = $(result).find('recording').attr('rid');
47
-            console.log('Recording ' + (state ? 'started' : 'stopped') +
53
+            console.log('Recording ' + ((state === 'on') ? 'started' : 'stopped') +
48
                 '(jirecon)' + result);
54
                 '(jirecon)' + result);
49
             recordingEnabled = state;
55
             recordingEnabled = state;
50
-            if (!state){
56
+            if (state === 'off'){
51
                 jireconRid = null;
57
                 jireconRid = null;
52
             }
58
             }
53
 
59
 
73
         function (result) {
79
         function (result) {
74
             console.log('Set recording "', state, '". Result:', result);
80
             console.log('Set recording "', state, '". Result:', result);
75
             var recordingElem = $(result).find('>conference>recording');
81
             var recordingElem = $(result).find('>conference>recording');
76
-            var newState = ('true' === recordingElem.attr('state'));
82
+            var newState = recordingElem.attr('state');
77
 
83
 
78
             recordingEnabled = newState;
84
             recordingEnabled = newState;
79
             callback(newState);
85
             callback(newState);
86
+
87
+            if (newState === 'pending' && recordingStateChangeCallback == null) {
88
+                recordingStateChangeCallback = callback;
89
+                connection.addHandler(function(iq){
90
+                    var state = $(iq).find('recording').attr('state');
91
+                    if (state)
92
+                        recordingStateChangeCallback(state);
93
+                }, 'http://jitsi.org/protocol/colibri', 'iq', null, null, null);
94
+            }
80
         },
95
         },
81
         function (error) {
96
         function (error) {
82
             console.warn(error);
97
             console.warn(error);
94
 }
109
 }
95
 
110
 
96
 var Recording = {
111
 var Recording = {
97
-    toggleRecording: function (tokenEmptyCallback,
98
-                               startingCallback, startedCallback, connection) {
112
+    toggleRecording: function (tokenEmptyCallback, recordingStateChangeCallback, connection) {
99
         if (!Moderator.isModerator()) {
113
         if (!Moderator.isModerator()) {
100
             console.log(
114
             console.log(
101
                     'non-focus, or conference not yet organized:' +
115
                     'non-focus, or conference not yet organized:' +
108
         if (!recordingToken && !useJirecon) {
122
         if (!recordingToken && !useJirecon) {
109
             tokenEmptyCallback(function (value) {
123
             tokenEmptyCallback(function (value) {
110
                 setRecordingToken(value);
124
                 setRecordingToken(value);
111
-                self.toggleRecording(tokenEmptyCallback,
112
-                    startingCallback, startedCallback, connection);
125
+                self.toggleRecording(tokenEmptyCallback, recordingStateChangeCallback, connection);
113
             });
126
             });
114
 
127
 
115
             return;
128
             return;
116
         }
129
         }
117
 
130
 
118
         var oldState = recordingEnabled;
131
         var oldState = recordingEnabled;
119
-        startingCallback(!oldState);
120
-        setRecording(!oldState,
132
+        var newState = (oldState === 'off' || !oldState) ? 'on' : 'off';
133
+
134
+        setRecording(newState,
121
             recordingToken,
135
             recordingToken,
122
             function (state) {
136
             function (state) {
123
                 console.log("New recording state: ", state);
137
                 console.log("New recording state: ", state);
143
                     // have been wrong
157
                     // have been wrong
144
                     setRecordingToken(null);
158
                     setRecordingToken(null);
145
                 }
159
                 }
146
-                startedCallback(state);
160
+                recordingStateChangeCallback(state);
147
 
161
 
148
             },
162
             },
149
             connection
163
             connection

+ 2
- 2
modules/xmpp/xmpp.js Parādīt failu

434
         return true;
434
         return true;
435
     },
435
     },
436
     toggleRecording: function (tokenEmptyCallback,
436
     toggleRecording: function (tokenEmptyCallback,
437
-                               startingCallback, startedCallback) {
437
+                               recordingStateChangeCallback) {
438
         Recording.toggleRecording(tokenEmptyCallback,
438
         Recording.toggleRecording(tokenEmptyCallback,
439
-            startingCallback, startedCallback, connection);
439
+            recordingStateChangeCallback, connection);
440
     },
440
     },
441
     addToPresence: function (name, value, dontSend) {
441
     addToPresence: function (name, value, dontSend) {
442
         switch (name) {
442
         switch (name) {

Notiek ielāde…
Atcelt
Saglabāt