glister commented on issue #678:
URL:
https://github.com/apache/cordova-plugin-camera/issues/678#issuecomment-923602070
@capc0
I took the same approach as @ita33 and it works well, run `cordova plugin
add cordova-plugin-camera-preview`.
Then do something along the lines of the following, where element is the dom
element you want to contain the photo preview.
```javascript
var targetPosition = element.getBoundingClientRect();
CameraPreview.startCamera({
x: targetPosition.left,
y: targetPosition.top,
width: targetPosition.width,
height: targetPosition.height,
//...other options
});
```
Then wire up your buttons to take a photo etc. Also don't forget to listen
to orientation change event so your camera repositions with your dom element
```javascript
window.removeEventListener('orientationchange', repositionCamera);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]