* Android tap-to-focus and improved (continuous) auto-focus
Tap-to-focus
- On tap, compute focus area around motion event's location, and pass this to the camera parameters
as the new focus area.
- Adds RCTCameraUtils.java file, so far with only a single function that helps compute the focus area
from a motion event. This file can serve as a location for utility constants and functions for the
rest of the app, where such things can be extracted out.
Improved (continuous) auto-focus
- Use FOCUS_MODE_CONTINUOUS_PICTURE/VIDEO when possible to enable continuous auto-focus; fall back to
FOCUS_MODE_AUTO otherwise, if able.
Other changes
- Update README to specify differences between iOS and Android for focus and zoom functionality.
- Update AndroidManifest with more thorough list of permissions and features.
- Update Example package.json react and react-native dependencies to match root package's package.json.
* Example: default empty onFocusChanged callback
- Enables default tap-to-focus behavior in Example app, facilitating
testing of focus features in the Example app
* Update compileSdkVersion to 25 and buildToolsVersion to 25.0.2
Best to keep these up-to-date. Doesn't affect backwards compatibility.
* Add buildToolsVersion requirement of 25.0.2.
* * removed some of the re-parsing of the output image byte array
* removed re-saving of output file
* moved image processing onto an async task to allow camera to be used while processing is running
* added jpeg compression support for android
* move explanation to correct bit of docs
* writing metadata.location (lat and lon coords only) to the exif data... and returning the internal url for the new image (which can be used in conjunction with the RN CameraRoll)
* just a tidy up to remove some duplication and fix some logging (no functional changes)
* oops, fix typo
* docs
* added mediaUri to ios so its the same as android
* Add video/audio authorization check for Android
This only checks for the permission and no request is made. `PermissionAndroid` in recent React Native or manually asking it from native code can still be used.
* Add checkDeviceAuthorizationStatus
* Add 1080p, 720p, and 480p capture qualities.
* Minor improvements for picture/video sizing.
- Minor refactoring for getting supported sizes (DRY).
- Add explicit pictureSize setting for 480p/720p/1080p in still/picture mode.
* Use util.Size objects for 480p/720p/1080p sizing.
- Note using Camera.Size objects would require a camera instance prior to creating the
size objects, which would be manageable but not too clean.
* Remove 480p for iOS; 16:9/HD aspect ratio for Android 480p
- iOS only has a 640x480 480p-like AVCaptureSessionPreset, which is not the typical 16:9/HD aspect ratio
desired. Removing this option as a result of this.
- Android 480p updated to use 16:9/HD aspect ratio.
* Add notes for (in)exact sizing for 1080p/720p/480p
* Re-add 480p on iOS, more notes on resolutions.
- Add notes on non-HD-aspect-ratio for iOS 480p.
- Add more explanation of variable resolution/sizes, especially for 480p on Android.
* Use custom Resolution class to hold 480p/720p/1080p resolution sizes
- Mistakenly used util.Size class before, which was not added until Android API level 21 (current
min is 16).
Android MediaRecorder:
- Most importantly, call Camera.unlock() before setting the camera on the
MediaRecorder instance, and release() not just reset() when releasing the MediaRecorder
instance!
- Add comments and notes for preparing and releasing MediaRecorder instance.
- Add onError callback for errors during recording session.
RCTCameraViewManager, RCTCamera, RCTCameraViewFinder, RCTCameraView:
- Implement setCaptureMode, preparing camera based on captureMode. Currently, the only step that
needs to be taken here is setting the recording hint for videos.
- Handle setting _captureMode instance variable where applicable.
Sizing
- Determine ViewFinder supported sizes based on actual captureMode (i.e., get supported picture
sizes when in still capture mode, and get supported video sizes when in video capture mode).
Output files:
- Get appropriate external storage public directory based on media type (image or video).
- Minor variable renaming to indicate that both images or videos can be saved.
README:
- Update captureTarget to indicate that cameraRoll is the actual default for both systems.
- Small clarification for output data type for deprecated memory captureTarget output.
* Add mirrorImage support for Android
* Release resources after mirroring
* Mirror image only for TYPE_FRONT
* Remove unnecessary annotation
* Document mirrorImage for Android
* Improved compression and error handling
* Add support for mirroring on Android back camera too
* Add mirrorImage support for Android
* Release resources after mirroring
* Mirror image only for TYPE_FRONT
* Remove unnecessary annotation
* Document mirrorImage for Android
* Improved compression and error handling
* Add support for mirroring on Android back camera too
* Initial commit with Android video support
* stopCapture now works
* Bug fixes and parameter enhancements. README updated.
* Modified stopCapture parameter count to match iOS
* fixed promise bug on stopCapture
* Update RCTCameraModule.java
In Android preview and recording sizes are different, which can cause an error. This fix detects the difference and chooses a recording resolution that matches.
* Update RCTCameraModule.java
* Update RCTCamera.java
Creating video functions in style/convention of existing
* Update RCTCameraModule.java
Use new functions for adjusting video capture size and quality
* Update RCTCameraModule.java
Fixes issue where file not video playable (readable) on older devices
* Update AndroidManifest.xml
Since we're reading and writing video and pictures, need permissions for it.
* Fixed upside down camera (on some platforms), and misc bugs and crashes
* Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata
* To make merge nicer, temporarily reverting "Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata"
This reverts commit 9ea1ad409c7e6121cf0197172e752b7523d4b092.
* Fixed merge & brought back all improvements from 9ea1ad4
* Fixed logic for video -> camera roll
* Updates
* Uncommenting setProfile
* Fix support for React Native 0.25
* Renamed Camera to index
* * Fix after merge android recording
* * Fixed android camera roll file saving
* Added recording to example
* * Android promise rejections with exceptions
* Fixed preview, video and photo sizes
* Android recording result in new, javascript object, format
* * Removed example.index.android.js as there is Example project
* * Readme for example
* don't force a specific codec
* always use cache dir
* * Using MediaScannerConnection instead of ACTION_MEDIA_SCANNER_SCAN_FILE intent
* * As described in https://github.com/lwansbrough/react-native-camera/pull/262#issuecomment-239622268:
- fixed video the wrong direction and recoder start fail at "low,medium" on the nexus 5 x
* Fix minor orientation bug with front recording on android
* (Android) Made video stop on activity pause
* Revert "Merge pull request #6 from Reaction-Framework/marcejohnson-master"
This reverts commit 8729c65a72af2afc8297e4a4de3c07a54da11580, reversing
changes made to 50416eb0daae447b822307f257c31a1cbc240a2c.
* Revert "Revert "Merge pull request #6 from Reaction-Framework/marcejohnson-master""
This reverts commit 4b87b48c7bd92840566ad76c96961325c2291ee0.
* replace System.console with Log.e (#390)
* Initial commit with Android video support
* stopCapture now works
* Bug fixes and parameter enhancements. README updated.
* Modified stopCapture parameter count to match iOS
* fixed promise bug on stopCapture
* Update RCTCameraModule.java
In Android preview and recording sizes are different, which can cause an error. This fix detects the difference and chooses a recording resolution that matches.
* Update RCTCameraModule.java
* Update RCTCamera.java
Creating video functions in style/convention of existing
* Update RCTCameraModule.java
Use new functions for adjusting video capture size and quality
* Update RCTCameraModule.java
Fixes issue where file not video playable (readable) on older devices
* Update AndroidManifest.xml
Since we're reading and writing video and pictures, need permissions for it.
* Fixed upside down camera (on some platforms), and misc bugs and crashes
* Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata
* To make merge nicer, temporarily reverting "Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata"
This reverts commit 9ea1ad409c7e6121cf0197172e752b7523d4b092.
* Fixed merge & brought back all improvements from 9ea1ad4
* Fixed logic for video -> camera roll
* Updates
* Uncommenting setProfile
* Fix support for React Native 0.25
* Renamed Camera to index
* * Fix after merge android recording
* * Fixed android camera roll file saving
* Added recording to example
* * Android promise rejections with exceptions
* Fixed preview, video and photo sizes
* Android recording result in new, javascript object, format
* * Removed example.index.android.js as there is Example project
* * Readme for example
* don't force a specific codec
* always use cache dir
* * Using MediaScannerConnection instead of ACTION_MEDIA_SCANNER_SCAN_FILE intent
* * As described in https://github.com/lwansbrough/react-native-camera/pull/262#issuecomment-239622268:
- fixed video the wrong direction and recoder start fail at "low,medium" on the nexus 5 x
* use device orientation on android only with auto orientation
* guard against missing playSoundOnCapture and quality props in options
* add video orientation support
* use device orientation on ios only with auto orientation
* play shutter click sound on capture (android)
* Add Property playSoundOnCapture to enable whether the default shutter sound is played on capture (Android)