瀏覽代碼

Recording related UI modifications.

master
yanas 9 年之前
父節點
當前提交
68994fbe74
共有 9 個檔案被更改,包括 75 行新增146 行删除
  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 查看文件

558
 
558
 
559
     _getConferenceOptions() {
559
     _getConferenceOptions() {
560
         let options = config;
560
         let options = config;
561
-        if(config.enableRecording) {
561
+        if(config.enableRecording && !config.recordingType) {
562
             options.recordingType = (config.hosts &&
562
             options.recordingType = (config.hosts &&
563
                 (typeof config.hosts.jirecon != "undefined"))?
563
                 (typeof config.hosts.jirecon != "undefined"))?
564
                 "jirecon" : "colibri";
564
                 "jirecon" : "colibri";
839
             APP.UI.changeDisplayName(id, displayName);
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
             if(status == "error") {
844
             if(status == "error") {
844
                 console.error(error);
845
                 console.error(error);
845
                 return;
846
                 return;
999
 
1000
 
1000
 
1001
 
1001
         // Starts or stops the recording for the conference.
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
         APP.UI.addListener(UIEvents.SUBJECT_CHANGED, (topic) => {
1007
         APP.UI.addListener(UIEvents.SUBJECT_CHANGED, (topic) => {

+ 1
- 16
css/main.css 查看文件

129
     -moz-transition: all .5s ease-in-out;
129
     -moz-transition: all .5s ease-in-out;
130
     transition: all .5s ease-in-out;
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
 a.button:hover,
133
 a.button:hover,
149
 a.bottomToolbarButton:hover {
134
 a.bottomToolbarButton:hover {
298
 }
283
 }
299
 
284
 
300
 .active {
285
 .active {
301
-    color: #00ccff;
286
+    background-color: #00ccff;
302
 }
287
 }
303
 
288
 
304
 .bottomToolbar_span>span {
289
 .bottomToolbar_span>span {

+ 30
- 0
css/videolayout_default.css 查看文件

488
     padding: 10px;
488
     padding: 10px;
489
     color: rgba(255,255,255,.5);
489
     color: rgba(255,255,255,.5);
490
     z-index: 10000;
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 查看文件

116
                     </span>
116
                     </span>
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>
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
                     <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>
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
                     <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>
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
                     <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>
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
                     <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">
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
                 </div>
154
                 </div>
155
                 <span id="videoConnectionMessage"></span>
155
                 <span id="videoConnectionMessage"></span>
156
                 <span id="videoResolutionLabel">HD</span>
156
                 <span id="videoResolutionLabel">HD</span>
157
+                <span id="recordingLabel" class="centeredVideoLabel"></span>
157
             </div>
158
             </div>
158
 
159
 
159
             <div id="remoteVideos">
160
             <div id="remoteVideos">

+ 22
- 5
lang/main.json 查看文件

51
         "mute": "Mute / Unmute",
51
         "mute": "Mute / Unmute",
52
         "videomute": "Start / stop camera",
52
         "videomute": "Start / stop camera",
53
         "authenticate": "Authenticate",
53
         "authenticate": "Authenticate",
54
-        "record": "Record",
54
+        "record": "Toggle recording",
55
         "lock": "Lock / unlock room",
55
         "lock": "Lock / unlock room",
56
         "invite": "Invite others",
56
         "invite": "Invite others",
57
         "chat": "Open / close chat",
57
         "chat": "Open / close chat",
178
         "joinAgain": "Join again",
178
         "joinAgain": "Join again",
179
         "Share": "Share",
179
         "Share": "Share",
180
         "Save": "Save",
180
         "Save": "Save",
181
+        "recording": "Recording",
181
         "recordingToken": "Enter recording token",
182
         "recordingToken": "Enter recording token",
182
         "Dial": "Dial",
183
         "Dial": "Dial",
183
         "sipMsg": "Enter SIP number",
184
         "sipMsg": "Enter SIP number",
205
         "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
         "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
         "feedbackQuestion": "How was your call?",
207
         "feedbackQuestion": "How was your call?",
207
         "thankYou": "Thank you for using __appName__!",
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
     "email":
218
     "email":
211
     {
219
     {
253
     },
261
     },
254
     "recording":
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 查看文件

14
 import CQEvents from '../../service/connectionquality/CQEvents';
14
 import CQEvents from '../../service/connectionquality/CQEvents';
15
 import EtherpadManager from './etherpad/Etherpad';
15
 import EtherpadManager from './etherpad/Etherpad';
16
 import SharedVideoManager from './shared_video/SharedVideo';
16
 import SharedVideoManager from './shared_video/SharedVideo';
17
+import Recording from "./recording/Recording";
17
 
18
 
18
 import VideoLayout from "./videolayout/VideoLayout";
19
 import VideoLayout from "./videolayout/VideoLayout";
19
 import FilmStrip from "./videolayout/FilmStrip";
20
 import FilmStrip from "./videolayout/FilmStrip";
359
     bindEvents();
360
     bindEvents();
360
     sharedVideoManager = new SharedVideoManager(eventEmitter);
361
     sharedVideoManager = new SharedVideoManager(eventEmitter);
361
     if (!interfaceConfig.filmStripOnly) {
362
     if (!interfaceConfig.filmStripOnly) {
362
-
363
         $("#videospace").mousemove(function () {
363
         $("#videospace").mousemove(function () {
364
             return ToolbarToggler.showToolbar();
364
             return ToolbarToggler.showToolbar();
365
         });
365
         });
366
         setupToolbars();
366
         setupToolbars();
367
         setupChat();
367
         setupChat();
368
+
369
+        // Initialise the recording module.
370
+        if (config.enableRecording)
371
+            Recording.init(eventEmitter, config.recordingType);
372
+
368
         // Display notice message at the top of the toolbar
373
         // Display notice message at the top of the toolbar
369
         if (config.noticeMessage) {
374
         if (config.noticeMessage) {
370
             $('#noticeText').text(config.noticeMessage);
375
             $('#noticeText').text(config.noticeMessage);
562
     VideoLayout.showModeratorIndicator();
567
     VideoLayout.showModeratorIndicator();
563
 
568
 
564
     Toolbar.showSipCallButton(isModerator);
569
     Toolbar.showSipCallButton(isModerator);
565
-    Toolbar.showRecordingButton(isModerator);
566
-    Toolbar.showSharedVideoButton(isModerator);
570
+    Recording.showRecordingButton(isModerator);
567
     SettingsMenu.showStartMutedOptions(isModerator);
571
     SettingsMenu.showStartMutedOptions(isModerator);
568
     SettingsMenu.showFollowMeOptions(isModerator);
572
     SettingsMenu.showFollowMeOptions(isModerator);
569
 
573
 
570
     if (isModerator) {
574
     if (isModerator) {
571
         messageHandler.notify(null, "notify.me", 'connected', "notify.moderator");
575
         messageHandler.notify(null, "notify.me", 'connected', "notify.moderator");
572
 
576
 
573
-        Toolbar.checkAutoRecord();
577
+        Recording.checkAutoRecord();
574
     }
578
     }
575
 };
579
 };
576
 
580
 
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
 UI.updateRecordingState = function (state) {
980
 UI.updateRecordingState = function (state) {
1006
-    Toolbar.updateRecordingState(state);
981
+    Recording.updateRecordingState(state);
1007
 };
982
 };
1008
 
983
 
1009
 UI.notifyTokenAuthFailed = function () {
984
 UI.notifyTokenAuthFailed = function () {

+ 4
- 73
modules/UI/toolbars/Toolbar.js 查看文件

6
 import UIEvents from '../../../service/UI/UIEvents';
6
 import UIEvents from '../../../service/UI/UIEvents';
7
 
7
 
8
 let roomUrl = null;
8
 let roomUrl = null;
9
-let recordingToaster = null;
10
 let emitter = null;
9
 let emitter = null;
11
 
10
 
12
 
11
 
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
 const buttonHandlers = {
45
 const buttonHandlers = {
92
     "toolbar_button_mute": function () {
46
     "toolbar_button_mute": function () {
93
         if (APP.conference.audioMuted) {
47
         if (APP.conference.audioMuted) {
107
             emitter.emit(UIEvents.VIDEO_MUTED, true);
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
     "toolbar_button_security": function () {
64
     "toolbar_button_security": function () {
115
         emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
65
         emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
116
     },
66
     },
250
      */
200
      */
251
     unlockLockButton () {
201
     unlockLockButton () {
252
         if ($("#toolbar_button_security").hasClass("icon-security-locked"))
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
      */
209
      */
259
     lockLockButton () {
210
     lockLockButton () {
260
         if ($("#toolbar_button_security").hasClass("icon-security"))
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
         }
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
     // Shows or hides the 'shared video' button.
234
     // Shows or hides the 'shared video' button.
292
     showSharedVideoButton (show) {
235
     showSharedVideoButton (show) {
293
         if (UIUtil.isButtonEnabled('sharedvideo') && show) {
236
         if (UIUtil.isButtonEnabled('sharedvideo') && show) {
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
     // checks whether desktop sharing is enabled and whether
243
     // checks whether desktop sharing is enabled and whether
309
     // we have params to start automatically sharing
244
     // we have params to start automatically sharing
310
     checkAutoEnableDesktopSharing () {
245
     checkAutoEnableDesktopSharing () {
382
         }
317
         }
383
     },
318
     },
384
 
319
 
385
-    updateRecordingState (state) {
386
-        setRecordingButtonState(state);
387
-    },
388
-
389
     /**
320
     /**
390
      * Marks video icon as muted or not.
321
      * Marks video icon as muted or not.
391
      * @param {boolean} muted if icon should look like muted or not
322
      * @param {boolean} muted if icon should look like muted or not

+ 1
- 5
modules/UI/util/UIUtil.js 查看文件

123
     },
123
     },
124
 
124
 
125
     isButtonEnabled: function (name) {
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
     hideDisabledButtons: function (mappings) {
129
     hideDisabledButtons: function (mappings) {

+ 1
- 1
service/UI/UIEvents.js 查看文件

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

Loading…
取消
儲存