首页 > 其他 > 详细

PhoneGap录像 以及 录音功能 简单代码实现

时间:2014-11-04 19:42:52      阅读:285      评论:0      收藏:0      [点我收藏+]

1,录音功能

navigator.device.capture.captureAudio(
    				            function(files){//成功回调函数
    				                  Ext.getCmp("video_files_mainview").config.param.sourceobj.startUpload(files[0].fullPath, 2);
    				            },
    				            function(error){//失败回调函数
//    				                navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
    				            }, {limit:1});//一次最多录制的文件个数

2,录像功能

 navigator.device.capture.captureVideo(
    				        function(files){//成功回调
//                                navigator.notification.alert(files[0].fullPath);
                                Ext.getCmp("video_files_mainview").config.param.sourceobj.startUpload(files[0].fullPath, 1);
    				        }, function(){//失败回调
//    				            navigator.notification.alert('错误码:' + err.code, null, 'Uh oh!');
    				        });

录音是调用本地录音机。

PhoneGap录像 以及 录音功能 简单代码实现

原文:http://blog.csdn.net/liuhenghui5201/article/details/40789151

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!