feat: Respect format's aspect ratio in Preview and add resizeMode prop (#1817)

* feat(preview): respect format's aspect ratio

* fix: code guidelines and previewSize in PreviewView

* feat: add resizeMode 'cover' and 'contain' on Android
This commit is contained in:
Maxime
2023-09-22 17:32:34 +02:00
committed by GitHub
parent 9add0eb571
commit c0b80b342b
8 changed files with 166 additions and 67 deletions

View File

@@ -111,6 +111,10 @@ export interface CameraProps extends ViewProps {
* Selects a given format. By default, the best matching format is chosen.
*/
format?: CameraDeviceFormat;
/**
* Specify how you want the preview to fit the container it's in
*/
resizeMode?: 'cover' | 'contain';
/**
* Specify the frames per second this camera should use. Make sure the given `format` includes a frame rate range with the given `fps`.
*