function startRecord() {
r = plus.audio.getRecorder();
if(r == null) {
return;
}
console.log("1111");
r.record({
filename: '_doc/audio/'
}, function(p) {
console.log("2222");
if(auTime) {
clearTimeout(auTime);
}
plus.io.resolveLocalFileSystemURL(p, function(entry) {
createItem(entry, false);
files.push({
name: "audio0",
path: '_doc/audio/' + entry.name,
id: "audio-0"
});
console.log("3333");
}, function(e) {
console.log("file access error");
});
}, function(e) {
console.log("----error-----");
});
er.style.display = 'block';
//最多录1分钟
console.log("44444");
auTime = setTimeout(function() {
stopRecord();
console.log("5555");
}, 60000);
t = 0;
ri = setInterval(function() {
t++;
rt.innerText = timeToStr(t);
}, 1000);
}
DEBUG打印的结果为
[手机运行] 1111
[手机运行] 44444
wobulangg
有用,谢谢~
2018-09-17 19:41