Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229594

How incorporate a-frame in ionic?

$
0
0

ammm,
well, I worked the camera with the camera plugin preview,

  1. $ ionic cordova plugin add cordova-plugin-camera-preview
    $ npm install --save @ionic-native/camera-preview

2.import in your app.module and provider Camerapreview
3. i used this code in constructor in my case home.ts

	this.cameraPreview.switchCamera();

	let cameraPreviewOpts: CameraPreviewOptions = {
	  x: 0,
	  y: 0,
	  width: window.screen.width,
	  height: window.screen.height,
	  camera: 'rear',
	  tapPhoto: true,
	  previewDrag: true,
	  toBack: true,
	  alpha: 1
	}


	this.cameraPreview.startCamera(cameraPreviewOpts).then(
		(res) => {
		console.log(res)
		},
		(err) => {
		console.log(err)
	});

build, now should working , regards.


Viewing all articles
Browse latest Browse all 229594

Trending Articles