through Wechat direct recording, local audio can be played. Format: msg_361529051018c8d439cd7c5101.amr, is recorded through jssdk, but local audio cannot be played. Format: msg__USER_FOR_WEBVIEW_JSAPI091530051018a873dcb5735104.amr, has added the words _ USER_FOR_WEBVIEW_JSAPI. Is it recorded through jssdk and need to be uploaded to Wechat server before the local recording file can be played?
var START,END,luyintime;var localId="";
var serverId="";
$(".startRecord button").on("touchstart",function(e){
e.preventDefault();
wx.startRecord({
success: function(){
START = new Date().getTime();
localStorage.rainAllowRecord = "true";
console.log("start",localId);
},
cancel: function () {
alert("");
return false;
}
});
})
$(".startRecord button").on("touchend",function(){
END = new Date().getTime();
//
luyintime=END - START;
if(luyintime < 3000){
END = 0;
START = 0;
wx.stopRecord({});
alert("3");
return false;
//3s
}else {
wx.stopRecord({
success: function (res) {
localId = res.localId;
console.log("end",localId);
//uploadluyin(localId,luyintime);
},
fail: function (res) {
alert(JSON.stringify(res));
}
});
}
})