Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23856] iOS/Android: Add support for the cameraTorchMode

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsandroid, camera, flash, ios, torch
ReporterRicardo Pereira
AssigneeUnknown
Created2016-08-30T16:32:45.000+0000
Updated2018-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"

Comments

  1. Sharif AbuDarda 2016-08-31

    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.
  2. Hans Knöchel 2016-09-01

    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?
  3. Ricardo Pereira 2016-09-01

    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]
  4. Ricardo Pereira 2016-09-01

    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)
  5. Tiago Miguel Filipe Duarte 2016-12-05

    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"

JSON Source