cordova-plugin-media-capture
1 安装插件
cordova plugin add cordova-plugin-media-capture
2 具体用法
```
<div class="item item-text-wrap text-center">
<button class="button button-dark" ng-click="captureVideo()">captureVideo</button>
</div>
$scope.captureVideo = function () {
var options = { limit: 1, duration: 15 };
// limit录制次数
$cordovaCapture.captureVideo(options).then(function (videoData) {
// Success! Video data is here
alert(videoData);
$scope.message = videoData
}, function (err) {
// An error occurred. Show a message to the user
});
}
```
注: 需在 app.js中引入 $cordovaCapture
网友评论