@RehatulAmbar wrote:
hi, I have tried to build Ionic recorder, I user cordova-plugin-media and it's installed successfully at command prompt, but "Media"(
var mediaRec = new Media(src
) in my controller is not definedhere is my controller :
`$scope.recordAudio = function() { var src = "mymedia.mp3"; var mediaRec = new Media(src, // success callback function() { console.log("recordAudio():Audio Success"); }, // error callback function(err) { console.log("recordAudio():Audio Error: "+ err.code); }); // Record audio mediaRec.startRecord(); // Stop recording after 10 seconds setTimeout(function() { mediaRec.stopRecord(); }, 10000); } // Play audio // $scope.playAudio=function(url) { // Play the audio file at url var my_media = new Media(url, // success callback function () { console.log("playAudio():Audio Success"); }, // error callback function (err) { console.log("playAudio():Audio Error: " + err); } ); // Play audio my_media.play(); }
I have tried to add that plugin again, I have tried to update the cordova, but it's does not work.
here is my eror :if someone know what should I do, please help~
thanks
Posts: 6
Participants: 3