Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ function onStartClicked()
}
```

### stop
stop video preview, then CPU and Memory consumption will drop.<br>

```javascript
window.CanvasCamera.stop();
```

### takePicture
take a photo.<br>

Expand Down Expand Up @@ -256,6 +263,7 @@ CanvasCamera.PictureSourceType = {
<br/>

<input type="button" value="Take a picture" onclick="onTakePicture();" />
<input type="button" value="Stop preview" onclick="onStopPreview();" />


</div>
Expand Down Expand Up @@ -327,6 +335,12 @@ CanvasCamera.PictureSourceType = {
function onTakeSuccess(data) {
//
}

function onStopPreview() {
CanvasCamera.stop();
}


</script>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.keith.cordova.plugin.canvascamera"
version="1.0.0dev">
version="1.1.0">

<name>CanvasCamera</name>

Expand Down
4 changes: 4 additions & 0 deletions www/CanvasCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ cordova.define("cordova/plugin/CanvasCamera", function(require, exports, module)
cordova.exec(false, false, "CanvasCamera", "startCapture", [options]);
};

CanvasCamera.prototype.stop = function() {
cordova.exec(false, false, "CanvasCamera", "stopCapture", []);
};



CanvasCamera.prototype.capture = function(data) {
Expand Down