react-native-camera / react-native-camera

A Camera component for React Native. Also supports barcode scanning!
https://react-native-camera.github.io/react-native-camera/
9.64k stars 3.5k forks source link

include deviceOrientation and orientation in RecordResponse #1983

Closed n1ru4l closed 5 years ago

n1ru4l commented 5 years ago

Feature-Request

Describe the Feature

I am developing an app that records videos in the portrait mode. Therefore I force the orientation Portrait mode with the following code:

const options = {
  ...remainingOptions,
  orientation: 1
};

const result = await camera.recordAsync(options);

However I need to know the actual deviceOrientation when the video recording started on the JS Thread.

Possible Implementations Expose a new property deviceOrientation on the result returned by camera.recordAsync(options). This property includes the actual orientation of the device. Furthermore for integrity we can also add the videoOrientation property to the result.

@sibelius Are you okay with me implementing this feature?

const options = {
  ...remainingOptions,
  orientation: 1
};

const result = await camera.recordAsync(options);
console.log(result.videoOrientation, result.deviceOrientation);

Love react-native-camera? Please consider supporting our collective: πŸ‘‰ https://opencollective.com/react-native-camera/donate Want this feature to be resolved faster? Please consider adding a bounty to it https://issuehunt.io/repos/33218414

sibelius commented 5 years ago

I think we can provide this

n1ru4l commented 5 years ago

:tada: This issue has been resolved in version 1.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: