You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to record something of 30 seconds. In my ionic controller I call the RecordService where your API is used to record, everything works, but I want to return something to my controller once the success function is done... How can I do that?
SERVICE:
.service('RecordService',function(UsersModel,Backand,$cordovaMedia,$q,$cordovaFile,$state){varservice=this;service.record=function(){returnwindow.plugins.audioRecorderAPI.record(function(savedFilePath){varfileName=savedFilePath.split('/')[savedFilePath.split('/').length-1];// Store filename in user object in databaseBackand.getUserDetails().then(function(result){UsersModel.fetch(result.userId).then(function(user){user.data.music=fileName;UsersModel.update(result.userId,user.data).then(function(updatedUser){console.log(updatedUser);returnsavedFilePath;})},function(error){console.log(error);})},function(error){console.log(error);});},function(error){console.log("Kapot: "+msg);returnerror;},30);}})
CONTROLLER:
functionrecord(){rec.recording=true;startTimer();RecordService.record()// Here do something like .then(function() {bla bla}) ?;}
The text was updated successfully, but these errors were encountered:
I want to record something of 30 seconds. In my ionic controller I call the RecordService where your API is used to record, everything works, but I want to return something to my controller once the success function is done... How can I do that?
SERVICE:
CONTROLLER:
The text was updated successfully, but these errors were encountered: