Commit 80ee1c9b authored by 李晓兵's avatar 李晓兵

''

parent be12c4bc
......@@ -59,8 +59,8 @@ import Jpush from './scripts/jpushService'
import Jmessage from './scripts/jmessageService'
// if (process.env.CONFIG_ENV === 'uat') {
//const VConsole = require('vconsole')
// new VConsole() // eslint-disable-line
const VConsole = require('vconsole')
new VConsole() // eslint-disable-line
// }
Vue.use(componentInstall)
......
......@@ -88,6 +88,51 @@ export default {
}
hlsUtil.captureVideo(onSuccess, onError)
},
/* vm.videoCapture = function () {
document.addEventListener("deviceready", function () {
var options = {};
//平台判断
if (ionic.Platform.isAndroid()) {
options = {
//quality: 1, //0代表低质量压缩,1代表高质量压缩
duration: 5 * 60 * 1000, //控制视频录制长度,当到达这个长度也会停止录制,单位:毫秒
audioBitRate: -2, //视频比特率
audioChannels: 1, //声道数量
audioSampleRate: -2, //采样率
videoBitRate: -4, //音频比特率
maxFileLength: 50, //mb 录制的最大文件大小
videoFrameRate: 24, //帧数 一秒内多少个画面,画面越少越卡,但是文件大小也越小
maxQuality: "MAX_480P" //录频分辨率
};
} else if (ionic.Platform.isIOS()) {
options = {
quality: 1, //0代表低质量压缩,1代表高质量压缩
duration: 120 //控制视频录制长度,当到达这个长度也会停止录制,单位:秒
};
}
navigator.device.capture.captureVideo(onSuccess, onFail, options);
function onSuccess(mediaFiles) {
var mediaFile = mediaFiles[0];
alert("录制成功!" + ",文件名:" + mediaFile.name + ",文件大小:" + mediaFile.size +
",localURL地址:" + mediaFile.localURL + ",fullPath地址:" + mediaFile.fullPath);
if (mediaFile.size > (1024 * 1024 * 50)) {
defer.reject('录制失败,视频大小不能超过50M!');
} else {
mediaFile.desc = 'media';
//alert(mediaFile);
}
}
function onFail(message) {
alert('录制失败' + message);
}
}, false);
};*/
succesCall () { // 录制成功后进行检测
let vm = this
let url = process.env.ocrPath + '/baidu/ocr/videoFaceliveness'
......
......@@ -311,8 +311,14 @@ export default {
* 录制视频
*/
captureVideo: function(onSuccess, onError){
var option = {
//本设置录制的视频尺寸为10s 4-5mb,清晰度较好
duration: 10*1000, //10s
cameraDirection: window.MediaCapture.CAMERA_FRONT
}
if (typeof onSuccess === 'function' && typeof onError === 'function') {
navigator.device.capture.captureVideo(onSuccess, onError, {duration: 15});
navigator.device.capture.captureVideo(onSuccess, onError, option);
} else{
window.hlsPopup.showLongBottom('参数有误!')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment