|
下面是自己的代码,用这个页面的demo也试了,一样的情况
var videoRecorder;
var isRecord = false;
apiready = function() {
var fixStatusBarHeader = $api.dom('.fix-status-bar-header');
// $api.fixStatusBar(fixStatusBarHeader);
fixStatusBarH = $api.offset(fixStatusBarHeader).h;
videoRecorder = api.require('videoRecorder');
var _param = null;
if (api.systemType == "ios") {
_param = {
rect: {
x: 0,
y: fixStatusBarH,
w: $api.winWidth,
h: $api.dom('.main').offsetHeight
},
fps: 24,
size: {
w: 720,
h: 1280
},
quality: "720p",
saveToAlbum: false,
save: {
path: 'fs://videoRecorder',
name: new Date().getTime() + '',
type: 'mpeg4'
}
}
} else {
_param = {
rect: {
x: 0,
y: fixStatusBarH,
w: $api.winWidth,
// hapi.winHeight
h: $api.dom('.main').offsetHeight
},
quality: "480p",
saveToAlbum: false,
save: {
path: 'fs://videoRecorder',
name: 'video',
type: 'mpeg4'
}
}
}
videoRecorder.open(_param, function(ret) {
if (ret) {
if(ret.eventType=='show'){
// console.log('---start record');
// videoRecorder.start({
// timer: 10
// });
}
else{
alert(JSON.stringify(ret));
}
// alert(JSON.stringify(ret));
}
});
$('.video-btn').click(function() {
if (!isRecord) {
isRecord = true;
$(this).attr('src', '../image/video_record_stop.png');
videoRecorder.start({
// timer: 10
});
} else {
isRecord = false;
$(this).attr('src', '../image/video_record_start.png');
videoRecorder.stop();
}
});
}; |
|