[TIMOB-23848] Ti.Media add focus methods and properties
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android, iOS |
Labels | android, camera, continuous, focus, ios, media, mode |
Reporter | Ricardo Pereira |
Assignee | Vijay Singh |
Created | 2016-08-31T14:09:44.000+0000 |
Updated | 2020-02-14T11:15:26.000+0000 |
Description
The focus is set by default to the AUTO, there is no way to change it, in my case I need to use the continuous focus mode.
android:
FOCUS_MODE_CONTINUOUS_PICTURE & FOCUS_MODE_CONTINUOUS_VIDEO
iOS
AVCaptureFocusMode ContinuousAutoFocus or AVCaptureFocusModeContinuousAutoFocus
Hello, Thanks for creating the ticket. Our engineers will look into it. We will let you know if and when we will make avialble of this features. Thanks.
Sounds interesting. can you propose an API for this interface? It is for the
showCamera
arguments, right? Maybe something like:EDIT: iOS has
Android has:
We could use the auto-ones for the default values, the continuous ones cross-platform and the others platform-specific. Makes sense?
PR : https://github.com/appcelerator/titanium_mobile/pull/8662 [~hansknoechel] Please review above PR and let me know your feedback. Unit test cases part I will do later. Implementation example -
In above PR I was trying to get the AVCaptureDevice and changing the property . But after changing, it get reset to its default one. So this will not work. Actually the mentioned property is available in AVFoundation framework in iOS . We are currently using UIImagePickerController to open camera i.e available in UIKit framework. If we want to integrate the mentioned property , we have to use AVCaptureSession. There we can use AVCaptureDevice and manage the properties . [~cng] [~hansknoechel] We have to discuss on same because it is major change. https://www.objc.io/issues/21-camera-and-photos/camera-capture-on-ios/
Same with torch mode ( TIMOB-23856 ). I don't think it is possible to use these properties right now until the mentioned changes happen. Or is it possible with Hyperloop ? [~hansknoechel] Can you confirm please.
That is correct. Unfortunately, iOS only exposed the focus- and torch-modes for the
AVCaptureDevice
, not theUIImagePickerController
. TIMOB-23947 tracks progress of that improvement.In iOS for this ticket including TIMOB-23947 and TIMOB-23856 , we are creating a camera module as mentioned in wiki https://wiki.appcelerator.org/display/pe/Custom+Camera+Support+in+iOS .