Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
[Feature Request][Windows][macOS][Linux][Android] Camera changes event
Feature Description
AIR should have event to handle connection/disconnection USB cameras. It should be fired when some USB camera plugged in or unplugged.
Without it very hard to implement smooth UX for application that could use multiple cameras or need to handle camera reconnection.
Event should have property with related Camera object which plugged in or unplugged.
Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/2005 https://github.com/airsdk/Adobe-Runtime-Support/issues/1993 https://github.com/airsdk/Adobe-Runtime-Support/issues/1992 https://github.com/airsdk/Adobe-Runtime-Support/issues/1895
Known Workarounds
none
*1) Write own native extension to handle it.
https://developer.android.com/reference/android/hardware/camera2/CameraManager.AvailabilityCallback#onCameraAvailable(java.lang.String)
https://developer.android.com/reference/android/hardware/camera2/CameraManager.AvailabilityCallback#onCameraUnavailable(java.lang.String)
https://developer.apple.com/documentation/avfoundation/avcapturedevicewasconnectednotification
https://developer.apple.com/documentation/avfoundation/avcapturedevicewasdisconnectednotification
*2) Call scanHardware() with some period but it cause huge performance hit. Also right now it useless with Android and most of cases with macOS: https://github.com/airsdk/Adobe-Runtime-Support/issues/2005