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

Camera control problem

Hi, I have a question regarding the Camera control. I don't know how to run it again when changing screens. When I enter for the first time, it works, when the next one is not 😞

 

https://youtu.be/9OlAD5ip37s 

11 REPLIES 11
WarrenBelz
Super User
Super User

Hi @Mjetek404 ,

Have you tested this on your PC? If it works there the issue is your device. We take tens of thousands of photos on over 100 iPads and the camera always works when the screen is entered, whether the first or any subsequent time. Unfortunately there is no Reset property or ability on this control type. One thing to check may be if the camera is being used by something else on the device.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Mjetek404
Helper I
Helper I

Hi @WarrenBelz, we only use android devices in my organization and that's probably the problem. I tested the application for the iPad a while ago and it works as it should. I wonder why this inconvenience is only for android.

 

See this movie https://youtu.be/sZeoVZUXa6Y 

 

You just need to give an extra interrupt for the camera to start working. Consider this termination in code form. Do you have any idea for that?

 

JérômeD
Frequent Visitor

Hi @Mjetek404 ,

 

With my organization tablet (Android version 11 ; ONE UI version 3.1)  I have the same problem as you but at the opposite with my personal phone (Android version 10 ; ONE UI version 2.0) it works as well.

 

Maybe we should change our android version of our device ?

Hi @Mjetek404 ,

I only have one Android device (a Motorola Moto G8+ phone) to test and the camera works fine on that with an app using it.

coxy05
Regular Visitor

We have the same problem on Android 11 devices

RikiVitalets
Advocate I
Advocate I

Same behaviour, galaxy tab A8 android 11 and huawei p10 lite android 8.0. So strange this issue has not be solved, seems like a sort of reset would be enough since it is sufficient to go out and back...

Gadsweb
Frequent Visitor

Hi,

For those who encounter the same issue, let's consider this workaround (not very proper but works 😞 ).

 

I remarked that when the message appears, switching to front camera then returning to the back solves this issue.

So you can place a variable in the camera property of the control and updating it in a button, something like :

 

UpdateContext({_defaultCamera : 10;_defaultCamera : 0}).-->use 10 to be sure that the cam doesn't exist.

 

Ok not very convenient for the user...

 

Next step. You can implement a Timer with a variable _startTimer for the StartProperty of the timer and a duration of 500 for exemple.

In the calling screen, in the Navigate function, you set the variable to true :

 

Navigate(ScreenWithTheCamera;Transition.None;{_startTimer:true});;

 

In the OnTimerEnd event, you put now this instruction :

 

UpdateContext({_defaultCam:10});;UpdateContext({_defaultCam:0;_startTimer:false})

 

Hope it helps.

 

P.S : you can't implement this workaround in the OnVisible event of the screen, because the camera control must be displayed in order to work.

 

Dear Gadsweb,

I had to change the sintax in UpdateContext({_defaultCamera:10});;UpdateContext({_defaultCamera:0}) because it gives me an error if I use the line you sent me and put _defaultCamera in the "Camera". It works and it is enough as workaround. Thanks a lot, you're great!!!

Gadsweb
Frequent Visitor

Hi Riki.

I have changed a little bit to be more precise.

With that said, both instructions are doing exactly the same, it's just a question of the language used by PowerApps (in french languague like mine, "," is replaced by ";").

For your issue, maybe your camera has not the same number.

You can place a list with "NameOfTheCamera.AvailableDevices.Id" as the Items property. That way you will see all the devices Id.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,247)