UserMedia (camera) on Android

Get help using Construct 2

Post » Thu Jun 04, 2015 2:41 am

Is UserMedia usable on Android or only meant for webcams? The only examples are for webcam. I've done some simple test code and run on Android, and for starters I get multiple "On retrieved media sources" triggers for a single call of "Get media devices". I would've expected one. Thanks for any help.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jun 04, 2015 6:50 am

I use it on my phone (android). The issue, is, sorry been awhile, is the source. Your phone generally has 2 camera's. You have to select the correct one.

Um, I think it is called request camera, then select source 0 as front camera, well that is what I did.

I made a small handheld mirror for my sister in-law so she could put on makeup.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Thu Jun 04, 2015 7:27 am

DUTOIT wrote:I use it on my phone (android). The issue, is, sorry been awhile, is the source. Your phone generally has 2 camera's. You have to select the correct one.

Um, I think it is called request camera, then select source 0 as front camera, well that is what I did.

I made a small handheld mirror for my sister in-law so she could put on makeup.


haha nice :) Thanks for responding. Yeah I got the whole process but I was wondering why there are so many triggers. Anyway I've since got it working on my phone to the point where I evaluate the front/back cameras and take a photo so I guess that's good! Although having to get the user to 'Allow' the camera is annoying.

edit: what's happening is that it triggers 4 times, each time retrieving 0 cameras, then the 5th time it retrieves 1 then the 6th time it retrieves both cameras sucessfully. So somehow it seems to need lots of attempts..
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jun 04, 2015 7:39 am

codah wrote:Although having to get the user to 'Allow' the camera is annoying.

edit: what's happening is that it triggers 4 times, each time retrieving 0 cameras, then the 5th time it retrieves 1 then the 6th time it retrieves both cameras sucessfully. So somehow it seems to need lots of attempts..


Yip, the permissions is annoying. Wish we could have user select it via options or something an have it by pass that pop up.

Triggers 4 times, strange? I can't say I've noticed that. But, I haven't looked at it for awhile.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Thu Jun 04, 2015 7:49 am

DUTOIT wrote:
codah wrote:Although having to get the user to 'Allow' the camera is annoying.

edit: what's happening is that it triggers 4 times, each time retrieving 0 cameras, then the 5th time it retrieves 1 then the 6th time it retrieves both cameras sucessfully. So somehow it seems to need lots of attempts..


Yip, the permissions is annoying. Wish we could have user select it via options or something an have it by pass that pop up.


Might actually be a deal-breaker for my app, I can imagine users wondering why other camera apps don't make them do that every time...

Do you, or anyone, have knowledge of any 3rd party camera plugins? I found one that it seems it doesn't work and is unsupported, and anyway it's for CocoonJS.
https://www.scirra.com/forum/plugin-mobile-camera-cocoonjs_t109624
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jun 04, 2015 8:05 am

That cranberry guy has one for phonegap
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Thu Jun 04, 2015 10:54 pm

Thanks :)
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 31, 2015 7:47 pm

someone can help me I want to use usermedia the camera in android exporting by the cocoonjs more qaundo exported in the wheel?
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests