This commit is contained in:
Nicholas Wittstruck 2014-10-24 22:07:45 +00:00
commit 4b8073a9fc
2 changed files with 7 additions and 2 deletions

6
app.js
View File

@ -1034,13 +1034,17 @@ function toggleRecording() {
Toolbar.toggleRecordingButtonState();
focus.setRecording(!oldState,
recordingToken,
function (state) {
function (state, path) {
console.log("New recording state: ", state);
if (state == oldState) //failed to change, reset the token because it might have been wrong
{
Toolbar.toggleRecordingButtonState();
setRecordingToken(null);
}
else {
$(document).trigger('recordingstatechanged', [focus, state, path]);
}
}
);

View File

@ -197,9 +197,10 @@ ColibriFocus.prototype.setRecording = function(state, token, callback) {
console.log('Set recording "', state, '". Result:', result);
var recordingElem = $(result).find('>conference>recording');
var newState = ('true' === recordingElem.attr('state'));
var path = (newState) ? recordingElem.attr('path') : '';
self.recordingEnabled = newState;
callback(newState);
callback(newState, path);
},
function (error) {
console.warn(error);