Skip to content

Commit fe773cc

Browse files
committed
closes #4
1 parent 7204d08 commit fe773cc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/camera-plus.android.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ export class CameraPlus extends CameraPlusBase {
392392
}
393393
}
394394

395-
private _prepareVideoRecorder(options?: IVideoOptions): boolean {
395+
private _prepareVideoRecorder(options?: IVideoOptions) {
396396
if (!this._mediaRecorder) {
397397
this._mediaRecorder = new android.media.MediaRecorder() as android.media.MediaRecorder;
398398
CLog(`this._mediaRecorder`, this._mediaRecorder);
@@ -467,7 +467,7 @@ export class CameraPlus extends CameraPlusBase {
467467
const hasStoragePerm = this.hasStoragePermissions();
468468
if (!hasStoragePerm) {
469469
CLog(`Application does not have storage permission to save file.`);
470-
return;
470+
return null;
471471
}
472472

473473
fileName = `VID_${Date.now()}.mp4`;
@@ -887,7 +887,7 @@ export class CameraPlus extends CameraPlusBase {
887887
public getFlashMode() {
888888
if (this.camera === null || this.camera === undefined) {
889889
CLog("no camera");
890-
return;
890+
return null;
891891
}
892892

893893
const params = this.camera.getParameters();
@@ -995,11 +995,14 @@ export class CameraPlus extends CameraPlusBase {
995995
this._toggleCamBtn.setImageResource(switchCameraDrawable);
996996
const shape = CamHelpers.createTransparentCircleDrawable();
997997
this._toggleCamBtn.setBackgroundDrawable(shape);
998-
this._toggleCamBtn.setOnClickListener({
999-
onClick: (view: android.view.View) => {
1000-
this.toggleCamera();
1001-
}
1002-
});
998+
this._toggleCamBtn.setOnClickListener(
999+
new android.view.View.OnClickListener({
1000+
onClick: (view: android.view.View) => {
1001+
this.toggleCamera();
1002+
}
1003+
})
1004+
);
1005+
10031006
const toggleCamParams = new android.widget.RelativeLayout.LayoutParams(
10041007
WRAP_CONTENT,
10051008
WRAP_CONTENT

0 commit comments

Comments
 (0)