I made one APP, and used the camera control, everything is fine, but I found it is very slow when opening the camera control, which need spend much time to wait the camera configurated on device.
And on the other hand, I also found if firstly navigate the screen of taking photos, 3~4 seconds can correctly configurate the camera and then can take photos, but when we close this screen, then navigate it again, issues occurred, which need too much time to wait camera control ready, sometimes, which need 1minutes.
I don't know why? Please share some knowledge.
The function is by clicking the camera icon to navigate to new screen to take photos, but need to wait so long time to make camera ready, once the camera is ready, click it and save photos is fine, no any problems.
Update (29/08): Setting the duration of the Timer to 2000ms resolved that user's issue (more time to load camera stream / camera devices).
Update (22/08): Some reason it's not working for Samsung s22 given it has 4 camera's in the following format:
[
{
"DesiredOrder": 1,
"Id": 2,
"Name": "camera2 2, facing back"
},
{
"DesiredOrder": 1,
"Id": 3,
"Name": "camera2 0, facing back"
},
{
"DesiredOrder": 2,
"Id": 0,
"Name": "camera2 3, facing front"
},
{
"DesiredOrder": 2,
"Id": 1,
"Name": "camera2 1, facing front"
}
]
*DesiredOrder was used to make the camera default to a back facing cam.
Will have another shot at it sometime hopefully.
-------------------------------------------------------------
Hmmm, okay I think I've found something promising this time, that works programmatically. It goes off Heathbar's idea (thank you!), which I tried without the use of a component, but still had no luck. I did notice however, that if the camera control gets the opportunity to load under a different available device (which could be done by swapping manually), then the camera rejigs itself and starts working again.
To force the load of a different device programmatically, instead of making the 'Default' property of the dropdown dynamic, we make the 'Camera' property of the camera control dynamic with respect to the dropdown.
To do this, we set the item's property to be a collection (colAvailableCameraDevices) and change the collection when the screen becomes visible. Then after a timer starts and stops, the collection is updated with the full available set of devices. The timer must be sufficiently long such that the stream shows on the camera control before the collection is updated (1000ms was the lowest I could get).
Setup
OnVisible:
Reset(drpCameraDevices);
Concurrent(
ClearCollect(colAvailableCameraDevices, Last(camCameraStream.AvailableDevices)),
UpdateContext({cvShowCamera: false})
)
Timer
OnTimerEnd: Concurrent(
ClearCollect(colAvailableCameraDevices, camCameraStream.AvailableDevices),
UpdateContext({cvShowCamera: true})
)
Duration: 1000
Autostart: true
Visible: false
drpCameraDevices
Items: If(
IsEmpty(colAvailableCameraDevices),
camCameraStream.AvailableDevices,
colAvailableCameraDevices
)
Default: First(colAvailableCameraDevices).Id
camCameraStream
Camera: drpCameraDevices.Selected.Id
Visible: Coalesce(cvShowCamera, true)
Hope this makes sense!
I have the same problem with a Zebra TC52 Android 10 Touch Computer.
User | Count |
---|---|
252 | |
106 | |
94 | |
50 | |
39 |