Browse Source

Recording related UI modifications.

master
yanas 9 years ago
parent
commit
68994fbe74
9 changed files with 75 additions and 146 deletions
  1. 5
    11
      conference.js
  2. 1
    16
      css/main.css
  3. 30
    0
      css/videolayout_default.css
  4. 2
    1
      index.html
  5. 22
    5
      lang/main.json
  6. 9
    34
      modules/UI/UI.js
  7. 4
    73
      modules/UI/toolbars/Toolbar.js
  8. 1
    5
      modules/UI/util/UIUtil.js
  9. 1
    1
      service/UI/UIEvents.js

+ 5
- 11
conference.js View File

@@ -558,7 +558,7 @@ export default {
558 558
 
559 559
     _getConferenceOptions() {
560 560
         let options = config;
561
-        if(config.enableRecording) {
561
+        if(config.enableRecording && !config.recordingType) {
562 562
             options.recordingType = (config.hosts &&
563 563
                 (typeof config.hosts.jirecon != "undefined"))?
564 564
                 "jirecon" : "colibri";
@@ -839,7 +839,8 @@ export default {
839 839
             APP.UI.changeDisplayName(id, displayName);
840 840
         });
841 841
 
842
-        room.on(ConferenceEvents.RECORDING_STATE_CHANGED, (status, error) => {
842
+        room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => {
843
+            console.log("Received recorder status change: ", status, error);
843 844
             if(status == "error") {
844 845
                 console.error(error);
845 846
                 return;
@@ -999,15 +1000,8 @@ export default {
999 1000
 
1000 1001
 
1001 1002
         // Starts or stops the recording for the conference.
1002
-        APP.UI.addListener(UIEvents.RECORDING_TOGGLE, (predefinedToken) => {
1003
-            if (predefinedToken) {
1004
-                room.toggleRecording({token: predefinedToken});
1005
-                return;
1006
-            }
1007
-            APP.UI.requestRecordingToken().then((token) => {
1008
-                room.toggleRecording({token: token});
1009
-            });
1010
-
1003
+        APP.UI.addListener(UIEvents.RECORDING_TOGGLED, (options) => {
1004
+            room.toggleRecording(options);
1011 1005
         });
1012 1006
 
1013 1007
         APP.UI.addListener(UIEvents.SUBJECT_CHANGED, (topic) => {

+ 1
- 16
css/main.css View File

@@ -129,21 +129,6 @@ html, body{
129 129
     -moz-transition: all .5s ease-in-out;
130 130
     transition: all .5s ease-in-out;
131 131
 }
132
-/*#ffde00*/
133
-#toolbar_button_record.active {
134
-    -webkit-text-shadow:    -1px 0 10px #00ccff,
135
-    0 1px 10px #00ccff,
136
-    1px 0 10px #00ccff,
137
-    0 -1px 10px #00ccff;
138
-    -moz-text-shadow:   1px 0 10px #00ccff,
139
-    0 1px 10px #00ccff,
140
-    1px 0 10px #00ccff,
141
-    0 -1px 10px #00ccff;
142
-    text-shadow:    -1px 0 10px #00ccff,
143
-    0 1px 10px #00ccff,
144
-    1px 0 10px #00ccff,
145
-    0 -1px 10px #00ccff;
146
-}
147 132
 
148 133
 a.button:hover,
149 134
 a.bottomToolbarButton:hover {
@@ -298,7 +283,7 @@ div.feedbackButton:hover {
298 283
 }
299 284
 
300 285
 .active {
301
-    color: #00ccff;
286
+    background-color: #00ccff;
302 287
 }
303 288
 
304 289
 .bottomToolbar_span>span {

+ 30
- 0
css/videolayout_default.css View File

@@ -488,4 +488,34 @@
488 488
     padding: 10px;
489 489
     color: rgba(255,255,255,.5);
490 490
     z-index: 10000;
491
+}
492
+
493
+.centeredVideoLabel {
494
+    display: none;
495
+    position: absolute;
496
+    bottom: 45%;
497
+    top: auto;
498
+    right: auto;
499
+    left: auto;
500
+    line-height: 28px;
501
+    height: 28px;
502
+    width: auto;
503
+    padding: 5px;
504
+    margin-right: auto;
505
+    margin-left: auto;
506
+    background: rgba(0,0,0,.5);
507
+    color: #FFF;
508
+    z-index: 10000;
509
+    border-radius: 4px;
510
+    -webkit-transition: all 2s 2s linear;
511
+    transition: all 2s 2s linear;
512
+}
513
+
514
+.moveToCorner {
515
+    top: 5px;
516
+    right: 5px;
517
+    margin-right: 0px;
518
+    margin-left: auto;
519
+    background: rgba(0,0,0,.3);
520
+    color: rgba(255,255,255,.5);
491 521
 }

+ 2
- 1
index.html View File

@@ -116,7 +116,7 @@
116 116
                     </span>
117 117
                     <a class="button icon-microphone" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute"></a>
118 118
                     <a class="button icon-camera" id="toolbar_button_camera" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleVideoPopover" data-i18n="[content]toolbar.videomute" content="Start / stop camera"></a>
119
-                    <a class="button icon-recEnable" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.record" content="Record" style="display: none"></a>
119
+                    <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.record" content="Record" style="display: none"></a>
120 120
                     <a class="button icon-security" id="toolbar_button_security" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.lock" content="Lock / unlock room"></a>
121 121
                     <a class="button icon-link" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.invite" content="Invite others"></a>
122 122
                     <a class="button icon-chat" id="toolbar_button_chat" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="bottom" data-i18n="[content]toolbar.chat" content="Open / close chat">
@@ -154,6 +154,7 @@
154 154
                 </div>
155 155
                 <span id="videoConnectionMessage"></span>
156 156
                 <span id="videoResolutionLabel">HD</span>
157
+                <span id="recordingLabel" class="centeredVideoLabel"></span>
157 158
             </div>
158 159
 
159 160
             <div id="remoteVideos">

+ 22
- 5
lang/main.json View File

@@ -51,7 +51,7 @@
51 51
         "mute": "Mute / Unmute",
52 52
         "videomute": "Start / stop camera",
53 53
         "authenticate": "Authenticate",
54
-        "record": "Record",
54
+        "record": "Toggle recording",
55 55
         "lock": "Lock / unlock room",
56 56
         "invite": "Invite others",
57 57
         "chat": "Open / close chat",
@@ -178,6 +178,7 @@
178 178
         "joinAgain": "Join again",
179 179
         "Share": "Share",
180 180
         "Save": "Save",
181
+        "recording": "Recording",
181 182
         "recordingToken": "Enter recording token",
182 183
         "Dial": "Dial",
183 184
         "sipMsg": "Enter SIP number",
@@ -205,7 +206,14 @@
205 206
         "firefoxExtensionPrompt": "You need to install a Firefox extension in order to use screen sharing. Please try again after you <a href='__url__'>get it from here</a>!",
206 207
         "feedbackQuestion": "How was your call?",
207 208
         "thankYou": "Thank you for using __appName__!",
208
-        "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?"
209
+        "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?",
210
+        "liveStreaming": "Live Streaming",
211
+        "streamKey": "Stream name/key",
212
+        "startLiveStreaming": "Start live streaming",
213
+        "stopStreamingWarning": "Are you sure you would like to stop the live streaming?",
214
+        "stopRecordingWarning": "Are you sure you would like to stop the recording?",
215
+        "stopLiveStreaming": "Stop live streaming",
216
+        "stopRecording": "Stop recording"
209 217
     },
210 218
     "email":
211 219
     {
@@ -253,8 +261,17 @@
253 261
     },
254 262
     "recording":
255 263
     {
256
-        "toaster": "Currently recording!",
257
-        "pending": "Your recording will start as soon as another participant joins",
258
-        "on": "Recording has been started"
264
+        "pending": "Recording waiting for a participant to join...",
265
+        "on": "Recording",
266
+        "off": "Recording stopped",
267
+        "failedToStart": "Recording failed to start"
268
+    },
269
+    "liveStreaming":
270
+    {
271
+        "pending": "Starting Live Stream...",
272
+        "on": "Live Streaming",
273
+        "off": "Live Streaming Stopped",
274
+        "unavailable": "The live streaming service is currently unavailable. Please try again later.",
275
+        "failedToStart": "Live streaming failed to start"
259 276
     }
260 277
 }

+ 9
- 34
modules/UI/UI.js View File

@@ -14,6 +14,7 @@ import UIEvents from "../../service/UI/UIEvents";
14 14
 import CQEvents from '../../service/connectionquality/CQEvents';
15 15
 import EtherpadManager from './etherpad/Etherpad';
16 16
 import SharedVideoManager from './shared_video/SharedVideo';
17
+import Recording from "./recording/Recording";
17 18
 
18 19
 import VideoLayout from "./videolayout/VideoLayout";
19 20
 import FilmStrip from "./videolayout/FilmStrip";
@@ -359,12 +360,16 @@ UI.start = function () {
359 360
     bindEvents();
360 361
     sharedVideoManager = new SharedVideoManager(eventEmitter);
361 362
     if (!interfaceConfig.filmStripOnly) {
362
-
363 363
         $("#videospace").mousemove(function () {
364 364
             return ToolbarToggler.showToolbar();
365 365
         });
366 366
         setupToolbars();
367 367
         setupChat();
368
+
369
+        // Initialise the recording module.
370
+        if (config.enableRecording)
371
+            Recording.init(eventEmitter, config.recordingType);
372
+
368 373
         // Display notice message at the top of the toolbar
369 374
         if (config.noticeMessage) {
370 375
             $('#noticeText').text(config.noticeMessage);
@@ -562,15 +567,14 @@ UI.updateLocalRole = function (isModerator) {
562 567
     VideoLayout.showModeratorIndicator();
563 568
 
564 569
     Toolbar.showSipCallButton(isModerator);
565
-    Toolbar.showRecordingButton(isModerator);
566
-    Toolbar.showSharedVideoButton(isModerator);
570
+    Recording.showRecordingButton(isModerator);
567 571
     SettingsMenu.showStartMutedOptions(isModerator);
568 572
     SettingsMenu.showFollowMeOptions(isModerator);
569 573
 
570 574
     if (isModerator) {
571 575
         messageHandler.notify(null, "notify.me", 'connected', "notify.moderator");
572 576
 
573
-        Toolbar.checkAutoRecord();
577
+        Recording.checkAutoRecord();
574 578
     }
575 579
 };
576 580
 
@@ -973,37 +977,8 @@ UI.requestFeedback = function () {
973 977
     });
974 978
 };
975 979
 
976
-/**
977
- * Request recording token from the user.
978
- * @returns {Promise}
979
- */
980
-UI.requestRecordingToken = function () {
981
-    let msg = APP.translation.generateTranslationHTML("dialog.recordingToken");
982
-    let token = APP.translation.translateString("dialog.token");
983
-    return new Promise(function (resolve, reject) {
984
-        messageHandler.openTwoButtonDialog(
985
-            null, null, null,
986
-            `<h2>${msg}</h2>
987
-             <input name="recordingToken" type="text"
988
-                    data-i18n="[placeholder]dialog.token"
989
-                    placeholder="${token}" autofocus>`,
990
-            false, "dialog.Save",
991
-            function (e, v, m, f) {
992
-                if (v && f.recordingToken) {
993
-                    resolve(UIUtil.escapeHtml(f.recordingToken));
994
-                } else {
995
-                    reject();
996
-                }
997
-            },
998
-            null,
999
-            function () { },
1000
-            ':input:first'
1001
-        );
1002
-    });
1003
-};
1004
-
1005 980
 UI.updateRecordingState = function (state) {
1006
-    Toolbar.updateRecordingState(state);
981
+    Recording.updateRecordingState(state);
1007 982
 };
1008 983
 
1009 984
 UI.notifyTokenAuthFailed = function () {

+ 4
- 73
modules/UI/toolbars/Toolbar.js View File

@@ -6,7 +6,6 @@ import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
6 6
 import UIEvents from '../../../service/UI/UIEvents';
7 7
 
8 8
 let roomUrl = null;
9
-let recordingToaster = null;
10 9
 let emitter = null;
11 10
 
12 11
 
@@ -43,51 +42,6 @@ function openLinkDialog () {
43 42
     );
44 43
 }
45 44
 
46
-// Sets the state of the recording button
47
-function setRecordingButtonState (recordingState) {
48
-    let selector = $('#toolbar_button_record');
49
-
50
-    if (recordingState === 'on') {
51
-        selector.removeClass("icon-recEnable");
52
-        selector.addClass("icon-recEnable active");
53
-
54
-        $("#largeVideo").toggleClass("videoMessageFilter", true);
55
-        let recordOnKey = "recording.on";
56
-        $('#videoConnectionMessage').attr("data-i18n", recordOnKey);
57
-        $('#videoConnectionMessage').text(APP.translation.translateString(recordOnKey));
58
-
59
-        setTimeout(function(){
60
-            $("#largeVideo").toggleClass("videoMessageFilter", false);
61
-            $('#videoConnectionMessage').css({display: "none"});
62
-        }, 1500);
63
-
64
-        recordingToaster = messageHandler.notify(
65
-            null, "recording.toaster", null,
66
-            null, null,
67
-            {timeOut: 0, closeButton: null, tapToDismiss: false}
68
-        );
69
-    } else if (recordingState === 'off') {
70
-        selector.removeClass("icon-recEnable active");
71
-        selector.addClass("icon-recEnable");
72
-
73
-        $("#largeVideo").toggleClass("videoMessageFilter", false);
74
-        $('#videoConnectionMessage').css({display: "none"});
75
-
76
-        if (recordingToaster) {
77
-            messageHandler.remove(recordingToaster);
78
-        }
79
-    } else if (recordingState === 'pending') {
80
-        selector.removeClass("icon-recEnable active");
81
-        selector.addClass("icon-recEnable");
82
-
83
-        $("#largeVideo").toggleClass("videoMessageFilter", true);
84
-        let recordPendingKey = "recording.pending";
85
-        $('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
86
-        $('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
87
-        $('#videoConnectionMessage').css({display: "block"});
88
-    }
89
-}
90
-
91 45
 const buttonHandlers = {
92 46
     "toolbar_button_mute": function () {
93 47
         if (APP.conference.audioMuted) {
@@ -107,10 +61,6 @@ const buttonHandlers = {
107 61
             emitter.emit(UIEvents.VIDEO_MUTED, true);
108 62
         }
109 63
     },
110
-    "toolbar_button_record": function () {
111
-        AnalyticsAdapter.sendEvent('toolbar.recording.toggled');
112
-        emitter.emit(UIEvents.RECORDING_TOGGLE);
113
-    },
114 64
     "toolbar_button_security": function () {
115 65
         emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
116 66
     },
@@ -250,7 +200,8 @@ const Toolbar = {
250 200
      */
251 201
     unlockLockButton () {
252 202
         if ($("#toolbar_button_security").hasClass("icon-security-locked"))
253
-            UIUtil.buttonClick("#toolbar_button_security", "icon-security icon-security-locked");
203
+            UIUtil.buttonClick("#toolbar_button_security",
204
+                                "icon-security icon-security-locked");
254 205
     },
255 206
 
256 207
     /**
@@ -258,7 +209,8 @@ const Toolbar = {
258 209
      */
259 210
     lockLockButton () {
260 211
         if ($("#toolbar_button_security").hasClass("icon-security"))
261
-            UIUtil.buttonClick("#toolbar_button_security", "icon-security icon-security-locked");
212
+            UIUtil.buttonClick("#toolbar_button_security",
213
+                                "icon-security icon-security-locked");
262 214
     },
263 215
 
264 216
     /**
@@ -279,15 +231,6 @@ const Toolbar = {
279 231
         }
280 232
     },
281 233
 
282
-    // Shows or hides the 'recording' button.
283
-    showRecordingButton (show) {
284
-        if (UIUtil.isButtonEnabled('recording') && show) {
285
-            $('#toolbar_button_record').css({display: "inline-block"});
286
-        } else {
287
-            $('#toolbar_button_record').css({display: "none"});
288
-        }
289
-    },
290
-
291 234
     // Shows or hides the 'shared video' button.
292 235
     showSharedVideoButton (show) {
293 236
         if (UIUtil.isButtonEnabled('sharedvideo') && show) {
@@ -297,14 +240,6 @@ const Toolbar = {
297 240
         }
298 241
     },
299 242
 
300
-    // checks whether recording is enabled and whether we have params
301
-    // to start automatically recording
302
-    checkAutoRecord () {
303
-        if (UIUtil.isButtonEnabled('recording') && config.autoRecord) {
304
-            emitter.emit(UIEvents.RECORDING_TOGGLE, UIUtil.escapeHtml(config.autoRecordToken));
305
-        }
306
-    },
307
-
308 243
     // checks whether desktop sharing is enabled and whether
309 244
     // we have params to start automatically sharing
310 245
     checkAutoEnableDesktopSharing () {
@@ -382,10 +317,6 @@ const Toolbar = {
382 317
         }
383 318
     },
384 319
 
385
-    updateRecordingState (state) {
386
-        setRecordingButtonState(state);
387
-    },
388
-
389 320
     /**
390 321
      * Marks video icon as muted or not.
391 322
      * @param {boolean} muted if icon should look like muted or not

+ 1
- 5
modules/UI/util/UIUtil.js View File

@@ -123,11 +123,7 @@
123 123
     },
124 124
 
125 125
     isButtonEnabled: function (name) {
126
-        var isEnabled = interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
127
-        if (name === 'recording') {
128
-            return isEnabled && config.enableRecording;
129
-        }
130
-        return isEnabled;
126
+        return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
131 127
     },
132 128
 
133 129
     hideDisabledButtons: function (mappings) {

+ 1
- 1
service/UI/UIEvents.js View File

@@ -62,7 +62,7 @@ export default {
62 62
     CONTACT_CLICKED: "UI.contact_clicked",
63 63
     HANGUP: "UI.hangup",
64 64
     LOGOUT: "UI.logout",
65
-    RECORDING_TOGGLE: "UI.recording_toggle",
65
+    RECORDING_TOGGLED: "UI.recording_toggled",
66 66
     SIP_DIAL: "UI.sip_dial",
67 67
     SUBJECT_CHANGED: "UI.subject_changed",
68 68
     VIDEO_DEVICE_CHANGED: "UI.video_device_changed",

Loading…
Cancel
Save