Skip to content

Commit

Permalink
use onsuccess and other suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
YushraJewon committed Jul 25, 2024
1 parent 0452c69 commit 1eef24e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/android/SimpleCameraPreview.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo

private boolean initVideoCallback(CallbackContext callbackContext) {
this.videoCallbackContext = callbackContext;
PluginResult result = new PluginResult(PluginResult.Status.OK, "video cb initialized");
PluginResult result = new PluginResult(PluginResult.Status.OK, "video callback initialized");
result.setKeepCallback(true);
this.videoCallbackContext.sendPluginResult(result);
return true;
Expand Down
11 changes: 5 additions & 6 deletions www/SimpleCameraPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ SimpleCameraPreview.startVideoCapture = function (onSuccess, onError) {
exec(
(info) => {
SimpleCameraPreview.videoInitialized = true;
this.videoCallback(info);
onSuccess(info);
} ,
(err) => {
this.videoCallback(null, err);
(err) => {
this.videoCallback(null, err);
},
"SimpleCameraPreview",
PLUGIN_NAME,
"initVideoCallback",
[]
);
}
exec(onSuccess, onError, PLUGIN_NAME, "startVideoCapture");
exec(() => {}, onError, PLUGIN_NAME, "startVideoCapture");
};

SimpleCameraPreview.stopVideoCapture = function (onSuccess, onError) {
Expand Down Expand Up @@ -78,4 +78,3 @@ SimpleCameraPreview.deviceHasUltraWideCamera = function (onSuccess, onError) {
};

module.exports = SimpleCameraPreview;

0 comments on commit 1eef24e

Please sign in to comment.