Skip to content

Commit

Permalink
add methods on js and plugin xml
Browse files Browse the repository at this point in the history
  • Loading branch information
YushraJewon committed Jun 11, 2024
1 parent f65d1b1 commit 464c41e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<framework src="androidx.camera:camera-camera2:1.1.0" />
<framework src="androidx.camera:camera-lifecycle:1.1.0" />
<framework src="androidx.camera:camera-view:1.1.0" />
<framework src="androidx.camera:camera-video:1.1.0" />

<source-file src="src/android/CameraPreviewFragment.java" target-dir="src/com/spoon/simplecamerapreview" />
<source-file src="src/android/SimpleCameraPreview.java" target-dir="src/com/spoon/simplecamerapreview" />
Expand Down
8 changes: 8 additions & 0 deletions www/SimpleCameraPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ SimpleCameraPreview.setSize = function (options, onSuccess, onError) {
exec(onSuccess, onError, PLUGIN_NAME, "setSize", [options]);
};

SimpleCameraPreview.startVideo = function (onSuccess, onError) {
exec(onSuccess, onError, PLUGIN_NAME, "startVideo", []);
};

SimpleCameraPreview.stopVideo = function (onSuccess, onError) {
exec(onSuccess, onError, PLUGIN_NAME, "stopVideo", []);
};

SimpleCameraPreview.torchSwitch = function (options, onSuccess, onError) {
exec(onSuccess, onError, PLUGIN_NAME, "torchSwitch", [options]);
};
Expand Down

0 comments on commit 464c41e

Please sign in to comment.