[TIMOB-23856] iOS/Android: Add support for the cameraTorchMode
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | android, camera, flash, ios, torch |
Reporter | Ricardo Pereira |
Assignee | Unknown |
Created | 2016-08-30T16:32:45.000+0000 |
Updated | 2018-02-28T19:55:33.000+0000 |
Description
There are 3 flash modes available: (off, on & auto) it will be a good thing to have the torch mode also.
iOS have 2 separated class for managing this properties:
[AVCaptureFlashMode](https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/#//apple_ref/c/tdef/AVCaptureFlashMode)
[AVCaptureTorchMode](https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/#//apple_ref/swift/enum/c:@E@AVCaptureTorchMode)
It would be nice to add the *CAMERA_FLASH_TORCH* constant.
[android.Camera.Parameters.FLASH_MODE_TORCH](https://developer.android.com/reference/android/hardware/Camera.Parameters.html#FLASH_MODE_TORCH)
* Added in API level 5
* String FLASH_MODE_TORCH
* Constant emission of light during preview, auto-focus and snapshot. This can also be used for video recording.
* Constant Value: "torch"
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.
I would like to put this into an own API to keep it clean between both. *Proposed API*: - Ti.Media.cameraTorchMode (get and set) - Ti.Media.CAMERA_TORCH_OFF - Ti.Media.CAMERA_TORCH_ON - Ti.Media.CAMERA_TORCH_AUTO All very similar to the
cameraFlashMode
. [~ricardo_jcp], cool?I was trying to edit the post and I've lost what I've written, so, here it goes: 2 possible solutions: Ti.Media.cameraTorchMode (set and get) [bool] //this only will work if the flash mode is set to ON Ti.Media.cameraFlashMode (set and get) [CAMERA_FLASH_AUTO, CAMERA_FLASH_OFF, CAMERA_FLASH_ON] or (the one I think it's the best and cleanest way): Ti.Media.cameraFlashMode (set and get) [CAMERA_FLASH_AUTO, CAMERA_FLASH_OFF, CAMERA_FLASH_ON, CAMERA_FLASH_TORCH]
One more thing, this will be nice to have also in android, and for what I've seen, its simpler to add it to android, since it's a default flash property: [Camera.Parameters - FLASH_MODE_TORCH](https://developer.android.com/reference/android/hardware/Camera.Parameters.html#FLASH_MODE_TORCH)
This ticket it's not only for iOS, but also for android *FLASH_MODE_TORCH* Added in API level 5 String FLASH_MODE_TORCH Constant emission of light during preview, auto-focus and snapshot. This can also be used for video recording. Constant Value: "torch"