cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BollGary
Helper I
Helper I

Slowness of camera control configurated

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.

BollGary_0-1645066644121.png

BollGary_1-1645066709848.png

 

 

11 REPLIES 11
sketchdelite
Regular Visitor

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!

mobilismexico
Resolver I
Resolver I

I have the same problem with a Zebra TC52 Android 10 Touch Computer.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,509)