Photocam not working in common mobile browser

UI Components for JSF
Post Reply
yaced
Posts: 2
Joined: 11 Oct 2019, 15:56

11 Oct 2019, 16:16

Hi everybody,

I'm using PF6.0 and although I was able to stream from the camera in my webpage, I noticed there were some issues with some browsers. This issues got even worse when trying to open my webpage on a mobile device.

On my laptop:
Worked with Microsoft Edge and Firefox
Didn't work with Chrome (I found lots of comments regarding the http and https stuff, I know there is no solution on PF side for this)

On my mobile device (Android):
Worked with Flashfox (I was even able to choose between the front and rear camera)
Didn't work with Chrome, Firefox, Edge, Dolphin, Puffin and others

I have the force-flash constraint in false, but it seems, that in the mobile device browsers the default html5 changes to flash. Well or it fallbacks to it. But why?

Is there any special configuration when using photocam and access the webpage from a mobile device? For my project, I need to get it run in a common browser without pub.

Thx,
bye

Melloware
Posts: 1903
Joined: 22 Apr 2013, 15:48

13 Oct 2019, 14:18

You might have to upgrade to PF 7.0. it is using the latest Photocam and fixes a lot of issues.

For example:
https://github.com/primefaces/primefaces/issues/3755
https://github.com/primefaces/primefaces/issues/4094
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.2 / PF Extensions 8.0.2

yaced
Posts: 2
Joined: 11 Oct 2019, 15:56

15 Oct 2019, 12:05

Hi Melloware,

that's what I thought, but doing this causes plenty of errors in already existent UI's, implemented using PF 6.0.

Isn't there a way to only update the photocam component without having to upgrade the entire PF library?
Or isn't there any patch to get photocam to work on a web app on a mobile device?

What about overriding all methods in photocam.js directly in the xhtml file of the desired UI? In that case, how could I include the webcam.swf of PF 7.0 in my project with PF 6.0?


Although there are inconsistencies with some of the already existent UI's, I tried my application with the PF 7.0. The webcam stream was shown even in Chrome, that was great, sadly this didn't work on my mobile phnone. Following errors are shown:

CHROME -> "Webcam.js: Error: No supported webcam interface found"

FIREFOX -> "Webcam.js Error: Could not acces webcam: NotAllowedError: The request is not allowed by the user agent or the platform in the current context. NotAllowedError: The request is not allowed by the user agent or the platform in the current context"

EDGE -> "Webcam.js Error: Could not access webcam: NotSupportedError: Only secure origins are allowed (see:https//goo.gl/Y0ZkNV). NotSupportedError: Only secure origins are allowed (see:https//goo.gl/Y0ZkNV)."

FLASHFOX -> No errors. Stream is shown.

Any idea why this is happening? All the browsers had the permission to use the phone camera. Any idea how on how to get this working?
Besides the showcase configuration, I didn't add any additional configuration.


Thx,
Yann
Last edited by yaced on 15 Oct 2019, 14:05, edited 1 time in total.

Melloware
Posts: 1903
Joined: 22 Apr 2013, 15:48

15 Oct 2019, 13:02

What you might have to do is get the sources for PrimeFaces 6.0 from GitHub and put the photcam changes in there yourself and rebuild the JAR.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.2 / PF Extensions 8.0.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests