diff --git a/app.js b/app.js index b7f7bb703..82bf785dc 100644 --- a/app.js +++ b/app.js @@ -1033,13 +1033,17 @@ function toggleRecording() { Toolbar.toggleRecordingButtonState(); focus.setRecording(!oldState, recordingToken, - function (state) { + function (state, result) { 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]); + } } ); diff --git a/libs/colibri/colibri.focus.js b/libs/colibri/colibri.focus.js index 278d85246..2757b4396 100644 --- a/libs/colibri/colibri.focus.js +++ b/libs/colibri/colibri.focus.js @@ -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);