added recording event that includes path

This commit is contained in:
Nicholas Wittstruck 2014-10-24 12:18:09 +02:00
parent 1602af0229
commit d108e0588e
2 changed files with 7 additions and 2 deletions

6
app.js
View File

@ -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]);
}
}
);

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);