https://github.com/ourcodeworld/cordova-ourcodeworld-materialcamera
A cordova wrapper for the Android Library Material Camera.
https://github.com/ourcodeworld/cordova-ourcodeworld-materialcamera
camera camera-api cordova-android-plugin material-design video video-recording
Last synced: 2 months ago
JSON representation
A cordova wrapper for the Android Library Material Camera.
- Host: GitHub
- URL: https://github.com/ourcodeworld/cordova-ourcodeworld-materialcamera
- Owner: ourcodeworld
- License: apache-2.0
- Created: 2017-02-01T11:36:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-16T05:46:33.000Z (over 7 years ago)
- Last Synced: 2025-01-20T03:56:28.315Z (4 months ago)
- Topics: camera, camera-api, cordova-android-plugin, material-design, video, video-recording
- Language: Java
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cordova-ourcodeworld-materialcamera
A cordova wrapper for the [Android Library Material Camera](https://github.com/afollestad/material-camera).
# Installation
Add the plugin using the following command in a terminal:
```bash
cordova plugin add https://github.com/ourcodeworld/cordova-ourcodeworld-materialcamera.git
```After the installation you will be able to use the `OurCodeWorld.MaterialCamera` object in the Window.
# Documentation
[Visit the official documentation of the plugin here](http://docs.ourcodeworld.com/projects/cordova-our-code-world-material-camera)
# Examples
The videoRecorder and camera object contains a lot of options, [please read the docs](http://docs.ourcodeworld.com/projects/cordova-our-code-world-material-camera).
## Take picture
```javascript
OurCodeWorld.MaterialCamera.camera
.qualityProfile("QUALITY_1080P")
.setLanguage("de")
.defaultToFrontFacing(true)
// Or save the output path:
//.saveDir("/storage/emulated/0/")
.allowRetry(true)
.startCamera({
success: function(Data){
console.info(Data);
//{ mode:"camera"
//outputFile: "file:///storage/emulated/0/Android/data/com.ourcodeworld.sandbox/cache/IMG_20170201_125644.jpg"
//status: "success"}
},
error: function(err){
console.error(Data);
},
none: function(){
console.log("The user started the camera, but didn't do anything :) ");
}
});
```## Video
```javascript
OurCodeWorld.MaterialCamera.videoRecorder
.setLanguage("en")
.defaultToFrontFacing(true)
.allowRetry(true)
.autoRecordWithDelayMs(5000)
.countdownMillis(20000)
.startVideoRecorder({
success: function(Data){
console.info(Data);
//{ mode:"video"
//outputFile: "file:///storage/emulated/0/Android/data/com.yourapp.appname/cache/VID_20170201_125241.mp4"
//status: "success"}
},
error: function(err){
console.error(Data);
},
none: function(){
console.log("The user started the camera, but didn't do anything :) ");
}
});
```---
# [LICENSE](/LICENSE.md)
###### Copyright 2016 Aidan Follestad
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.