Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open camera #96

Closed
MrHOY opened this issue Oct 30, 2020 · 11 comments
Closed

Can't open camera #96

MrHOY opened this issue Oct 30, 2020 · 11 comments

Comments

@MrHOY
Copy link

MrHOY commented Oct 30, 2020

I copy code from live demo and can't not open camera on my phone, browser show popup but I can't press Allow or Block
image

Android: 10
Chrome: 86.0.4240.114

@fmipsylone
Copy link

Same issue on Chrome Android 86.0.4240.110 and Chrome Desktop 86.0.4240.183. No errors in DevTools.
It is the same issue as #95.

@MrHOY
Copy link
Author

MrHOY commented Nov 5, 2020

@fmipsylone But it works well with Chrome: 86.0.4240.114 on Android 7. That's strange when I can't press any button on popup with Android 10

@JaquesGF
Copy link

I have the same problem on my Mi A2, the camera is not displayed.
Chrome version: 86.0.4240.198

I installed firefox to work around the problem

@fmipsylone
Copy link

At the conceptual phase I was looking for an easy solution, simple to adapt to some needs to not have to reinvent the wheel.
As sample I needed ImageData of the picture, not a blob neither an ObjectDataUrl, and it seemed to give it.
So, I thought that I could use ngx-webcam as a third party dependency to take the picture and adapt it to my needs. But more than the issue we pointed here, there was another issue in the implementation that did not back the ImageData. It was very simple to obtain by a workaround without forking. And it is also very easy to fix it in the code if you estimate that it could be interesting to purpose a pull request for this package.

But this package seems not actively maintained. No reactivity whereas the main feature is not working. I do not fault the main developer and contributors. I understand that it takes time and thanks very much to the main developer for taking the initiative to open and sharing his code.

I spent some time to look up the code, how to adapt it to our needs, check if the issue was simple to test and resolve. And In the meantime to understand the implementation I looked for MDN getUserMedia and MediaStreamTrack documentation.

It appeared to me that it was very simple to implement from scratch, and finally not a good idea to rely on a non actively maintained package for a third dependency in my app.

So finally, I implemented my own camera based on MDN documentation. It's quite easy to do and that perfectly meets my needs.

My advice, check out getUserMedia, MediaStreamTrack and MediaStreamConstraints on MDN and do not add a dependency for take a picture.

@basst314
Copy link
Owner

basst314 commented Nov 22, 2020

@MrHOY does the live demo here work for you?
https://basst314.github.io/ngx-webcam/?

Can you also try this demo to see if it works? https://webrtc.github.io/samples/src/content/getusermedia/canvas/

@basst314
Copy link
Owner

@fmipsylone thanks for the information that you were able to fix it. What exactly was the issue and how did you fix it? Mind sharing the fix so that it can be added to this package?

Thanks!

@MrHOY
Copy link
Author

MrHOY commented Nov 23, 2020

@basst314
I tried it. It work well on Android: 7 Chrome: 86.0.4240.114, but same problem on Android 10 as i said

@basst314
Copy link
Owner

@MrHOY is it the same issue with this demo?
https://webrtc.github.io/samples/src/content/getusermedia/canvas/

Same issue that you cannot click allow?

@MrHOY
Copy link
Author

MrHOY commented Nov 23, 2020

@MrHOY is it the same issue with this demo?
https://webrtc.github.io/samples/src/content/getusermedia/canvas/

Yes

Same issue that you cannot click allow?

Yes @basst314

@basst314
Copy link
Owner

Thanks for confirming @MrHOY
This seems to be an issue with this particular phone os and browser combination and is not specific to this library.

I‘m not sure at this point whether it is related to the OS behaving weirdly and not taking clicks for the Allow button or whether it‘s an issue with Chrome.

You could try with Firefox to see if it makes a difference.

Please let me know if that works.

Apart from that, as this is not an issue with this library, there‘s nothing else I could do.

@MrHOY
Copy link
Author

MrHOY commented Nov 23, 2020

@basst314 Firefox works well,

It's strange, but there is nothing more we can do about it. Thank you for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants