nstudio / nativescript-camera-plus

MIT License
79 stars 50 forks source link

Camera still capturing after navigtion - NS6 with Angular #138

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi, I'm using Nativescript 6.5.3 with Angular, After navigation to other page, the camera is still capturing, If I go back via page.frame.goBack() the camera indeed stopping, actually I noticed it thanks to IOS 14 which show a small dot when camera is on, So I tried to download https://play.google.com/store/apps/details?id=you.in.spark.access.dots and saw the problem happens in Android too,

How can I release the camera ?

Thanks !

kriefsacha commented 3 years ago

Did you find a solution @Arturiko ?

arturikoX commented 3 years ago

Did you find a solution @Arturiko ?

Hi, I did : this._page.on(Page.unloadedEvent, () => { this.isCapturing = false; this.cam.disposeNativeView(); });

When cam is:

camLoaded(e: any): void { this.cam = e.object as CameraPlus; ... }

I think disposeNativeView is the secret..