Fix recorder state and moderator restart

This commit is contained in:
yanas 2016-05-03 15:05:09 -05:00
parent ab67b42eb9
commit c07060c9cd
2 changed files with 19 additions and 7 deletions

View File

@ -460,6 +460,18 @@ export default {
return this._room
&& this._room.myUserId();
},
/**
* Indicates if recording is supported in this conference.
*/
isRecordingSupported() {
return this._room && this._room.isRecordingSupported();
},
/**
* Returns the recording state or undefined if the room is not defined.
*/
getRecordingState() {
return (this._room) ? this._room.getRecordingState() : undefined;
},
/**
* Will be filled with values only when config.debug is enabled.
* Its used by torture to check audio levels.

View File

@ -30,7 +30,7 @@ import BottomToolbar from '../toolbars/BottomToolbar';
*/
function _isRecordingButtonEnabled() {
return interfaceConfig.TOOLBAR_BUTTONS.indexOf("recording") !== -1
&& config.enableRecording;
&& config.enableRecording && APP.conference.isRecordingSupported();
}
/**
@ -211,7 +211,7 @@ var Status = {
/**
* Manages the recording user interface and user experience.
* @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
* setRecordingButtonState, checkAutoRecord}}
* updateRecordingUI, checkAutoRecord}}
*/
var Recording = {
/**
@ -219,8 +219,8 @@ var Recording = {
*/
init (emitter, recordingType) {
this.eventEmitter = emitter;
// Use recorder states directly from the library.
this.currentState = Status.UNAVAILABLE;
this.updateRecordingState(APP.conference.getRecordingState());
this.initRecordingButton(recordingType);
@ -326,17 +326,17 @@ var Recording = {
return;
// If there's no state change, we ignore the update.
if (this.currentState === recordingState)
if (!recordingState || this.currentState === recordingState)
return;
this.setRecordingButtonState(recordingState);
this.updateRecordingUI(recordingState);
},
/**
* Sets the state of the recording button.
* @param recordingState gives us the current recording state
*/
setRecordingButtonState (recordingState) {
updateRecordingUI (recordingState) {
let buttonSelector = $('#toolbar_button_record');
let labelSelector = $('#recordingLabel');