Reputation: 1088
i always get following error when i'm trying to start the ionic camera-preview:
ERROR Error: Uncaught (in promise): No preview
I updated all dependencies, added the provider etc. but i don't get it running, hope anyone can help me =)
The CameraPreviewOptions are copied from the example in the docs.
this.cameraPreview.startCamera(this.cameraPreviewOpts).then(
(res) => {
console.log(res)
},
(err) => {
console.log(err)
});
Upvotes: 1
Views: 2411
Reputation: 2744
I had the same issue like you,
The following instructions did the trick for me:
start and then show the camera-preview in the ionViewCanEnter()
lifecycle function.
You have also to be carefull of hiding the camera-preview in the ionViewWillLeave()
lifecycle function. And also showing it again in the ionViewWillEnter()
lifecycle function. To be clean.
Hope it helps :)
Upvotes: 2