diff --git a/lang/main.json b/lang/main.json
index 24199d190..bcbca615a 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -51,7 +51,7 @@
"mute": "Mute / Unmute",
"videomute": "Start / stop camera",
"authenticate": "Authenticate",
- "record": "Record",
+ "record": "Toggle recording",
"lock": "Lock / unlock room",
"invite": "Invite others",
"chat": "Open / close chat",
@@ -179,6 +179,7 @@
"joinAgain": "Join again",
"Share": "Share",
"Save": "Save",
+ "recording": "Recording",
"recordingToken": "Enter recording token",
"Dial": "Dial",
"sipMsg": "Enter SIP number",
@@ -206,7 +207,14 @@
"firefoxExtensionPrompt": "You need to install a Firefox extension in order to use screen sharing. Please try again after you get it from here!",
"feedbackQuestion": "How was your call?",
"thankYou": "Thank you for using __appName__!",
- "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?"
+ "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?",
+ "liveStreaming": "Live Streaming",
+ "streamKey": "Stream name/key",
+ "startLiveStreaming": "Start live streaming",
+ "stopStreamingWarning": "Are you sure you would like to stop the live streaming?",
+ "stopRecordingWarning": "Are you sure you would like to stop the recording?",
+ "stopLiveStreaming": "Stop live streaming",
+ "stopRecording": "Stop recording"
},
"email":
{
@@ -254,8 +262,17 @@
},
"recording":
{
- "toaster": "Currently recording!",
- "pending": "Your recording will start as soon as another participant joins",
- "on": "Recording has been started"
+ "pending": "Recording waiting for a participant to join...",
+ "on": "Recording",
+ "off": "Recording stopped",
+ "failedToStart": "Recording failed to start"
+ },
+ "liveStreaming":
+ {
+ "pending": "Starting Live Stream...",
+ "on": "Live Streaming",
+ "off": "Live Streaming Stopped",
+ "unavailable": "The live streaming service is currently unavailable. Please try again later.",
+ "failedToStart": "Live streaming failed to start"
}
}
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 4e4a9d99f..ce3492332 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -14,6 +14,7 @@ import UIEvents from "../../service/UI/UIEvents";
import CQEvents from '../../service/connectionquality/CQEvents';
import EtherpadManager from './etherpad/Etherpad';
import SharedVideoManager from './shared_video/SharedVideo';
+import Recording from "./recording/Recording";
import VideoLayout from "./videolayout/VideoLayout";
import FilmStrip from "./videolayout/FilmStrip";
@@ -363,12 +364,16 @@ UI.start = function () {
bindEvents();
sharedVideoManager = new SharedVideoManager(eventEmitter);
if (!interfaceConfig.filmStripOnly) {
-
$("#videospace").mousemove(function () {
return ToolbarToggler.showToolbar();
});
setupToolbars();
setupChat();
+
+ // Initialise the recording module.
+ if (config.enableRecording)
+ Recording.init(eventEmitter, config.recordingType);
+
// Display notice message at the top of the toolbar
if (config.noticeMessage) {
$('#noticeText').text(config.noticeMessage);
@@ -566,15 +571,15 @@ UI.updateLocalRole = function (isModerator) {
VideoLayout.showModeratorIndicator();
Toolbar.showSipCallButton(isModerator);
- Toolbar.showRecordingButton(isModerator);
Toolbar.showSharedVideoButton(isModerator);
+ Recording.showRecordingButton(isModerator);
SettingsMenu.showStartMutedOptions(isModerator);
SettingsMenu.showFollowMeOptions(isModerator);
if (isModerator) {
messageHandler.notify(null, "notify.me", 'connected', "notify.moderator");
- Toolbar.checkAutoRecord();
+ Recording.checkAutoRecord();
}
};
@@ -977,37 +982,8 @@ UI.requestFeedback = function () {
});
};
-/**
- * Request recording token from the user.
- * @returns {Promise}
- */
-UI.requestRecordingToken = function () {
- let msg = APP.translation.generateTranslationHTML("dialog.recordingToken");
- let token = APP.translation.translateString("dialog.token");
- return new Promise(function (resolve, reject) {
- messageHandler.openTwoButtonDialog(
- null, null, null,
- `
${msg}
- `,
- false, "dialog.Save",
- function (e, v, m, f) {
- if (v && f.recordingToken) {
- resolve(UIUtil.escapeHtml(f.recordingToken));
- } else {
- reject();
- }
- },
- null,
- function () { },
- ':input:first'
- );
- });
-};
-
UI.updateRecordingState = function (state) {
- Toolbar.updateRecordingState(state);
+ Recording.updateRecordingState(state);
};
UI.notifyTokenAuthFailed = function () {
diff --git a/modules/UI/recording/Recording.js b/modules/UI/recording/Recording.js
new file mode 100644
index 000000000..3c55d749d
--- /dev/null
+++ b/modules/UI/recording/Recording.js
@@ -0,0 +1,289 @@
+/* global APP, $, config, interfaceConfig */
+/*
+ * Copyright @ 2015 Atlassian Pty Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import UIEvents from "../../../service/UI/UIEvents";
+import UIUtil from '../util/UIUtil';
+
+/**
+ * Recording.
+ */
+let recordingToaster = null;
+
+function _isRecordingButtonEnabled() {
+ return interfaceConfig.TOOLBAR_BUTTONS.indexOf("recording") !== -1
+ && config.enableRecording;
+}
+
+/**
+ * Request live stream token from the user.
+ * @returns {Promise}
+ */
+function _requestLiveStreamId() {
+ let msg = APP.translation.generateTranslationHTML("dialog.liveStreaming");
+ let token = APP.translation.translateString("dialog.streamKey");
+ return new Promise(function (resolve, reject) {
+ APP.UI.messageHandler.openTwoButtonDialog(
+ null, null, null,
+ `
${msg}
+ `,
+ false, "dialog.startLiveStreaming",
+ function (e, v, m, f) {
+ if (v && f.streamId) {
+ resolve(UIUtil.escapeHtml(f.streamId));
+ } else {
+ reject();
+ }
+ },
+ null,
+ function () { },
+ ':input:first'
+ );
+ });
+}
+
+/**
+ * Request recording token from the user.
+ * @returns {Promise}
+ */
+function _requestRecordingToken () {
+ let msg = APP.translation.generateTranslationHTML("dialog.recordingToken");
+ let token = APP.translation.translateString("dialog.token");
+
+ return new Promise(function (resolve, reject) {
+ APP.UI.messageHandler.openTwoButtonDialog(
+ null, null, null,
+ `