Closed DvlopRyanSpears closed 6 years ago
e.g. LensPositionSelectorsKt.front()
for front camera or back()
for the back one.
Note that you resolution is also hardcoded which might not work for all devices: some devices might not support 1080x1200 resolution.
Thanks for your reply. For the resolution problem, should i query the device's max supported resolution before i set ?
We already have an example here about highest resolution: https://github.com/Fotoapparat/Fotoapparat/wiki/Configuration-Java
Available selectors are listed here:https://github.com/Fotoapparat/Fotoapparat/tree/master/fotoapparat/src/main/java/io/fotoapparat/selector
LensPositionSelectorsKt.front() is not working.....Update your code
builder =Fotoapparat.with(this).into(binding.cameraView) .previewScaleType(ScaleType.CenterCrop) // we want the preview to fill the view .photoResolution(ResolutionSelectorsKt.highestResolution())// we want to have the biggest photo possible .lensPosition(LensPositionSelectorsKt.front()) .focusMode(SelectorsKt.firstAvailable( // (optional) use the first focus mode which is supported by device FocusModeSelectorsKt.continuousFocusPicture(), FocusModeSelectorsKt.autoFocus(), // in case if continuous focus is not available on device, auto focus will be used FocusModeSelectorsKt.fixed() // if even auto focus is not available - fixed focus mode will be used )) .flash(SelectorsKt.firstAvailable( // (optional) similar to how it is done for focus mode, this time for flash FlashSelectorsKt.autoRedEye(), FlashSelectorsKt.autoFlash(), FlashSelectorsKt.torch() ));
Hi,i'm trying use this library with Java,