Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Resolved
-
2.4.0
-
None
-
Cordova 6.3.1
Cordova-android 5.2.2
Cordova-iOS 4.2.1
cordova-plugin-media 2.4.0
Android 6.0.1(HTC)+iOS 9.3.5 13G36(ipad mini)
Description
I test many times,these are all my code,just use it directly
=====
function recordAudio() {
if (navigator.userAgent.match(/iPad|iPhone|iPod/i))
if (navigator.userAgent.match(/Android/i))
{ var extension = ".amr"; } var src = 'myrecording' + extension;
var mediaRec = new Media(src, function()
, function(err)
{ alert("recordAudio():Audio Error: " + err.code); });
mediaRec.startRecord();
setTimeout(function()
, 3000);
setTimeout(function() {
mediaRec.getCurrentPosition(function(position) {
if (position > -1)
},
function(e)
);
}, 5000);
}
=====
when in 3 seconds
Android︰it will alert "stop record" and "recordAudio():Audio Success"
iOS︰it will alert "stop record" and "recordAudio():Audio Success"
when in 5 seconds
Android︰it will alert "-0.001 sec"
iOS︰it will shut down immediately,no any alert trigger