0

I wanted to access the phone camera on button click event in phone's web browser. Is there any plugin to access phone camera if I open my application in the phone's web browser. (With out using mobile app).

What is the best way to achieve functionality in the liferay porlet.

Vinod
  • 2,063
  • 7
  • 46
  • 96

2 Answers2

1

This is not a Liferay-specific problem - it's rather a web application problem. There are plenty of hits if you search for "HTML5 camera access" or related terms. Even Stackoverflow has a lot of them, e.g. here and here. The questions are older - in this case that's good: HTML5 only got more wide spread and while not everything might have been supported back when the question was asked, we're a lot further along the way.

I have no experience with this integration - I'm suspecting you'll have to make use of <portlet:resourceURL/> in order to process some of the input through Ajax when you want to process the results in Liferay, on the server side. But the basic problem, accessing the image from a web page, has a pure HTML5 solution, totally independent of Liferay.

Olaf Kock
  • 43,342
  • 7
  • 54
  • 84
  • Other than using HTML5, Are there any plugin or kind of third party jars to access camera in our portlet? Can you please suggest me some good blogs for doing R&D for the same. – Vinod Jun 07 '16 at 15:52
  • A jar would be server-side executed code. In order to get to the camera, you'll need to use HTML, there's no way around that. I mentioned search terms and two links to stackoverflow questions - which of them have you tried already? – Olaf Kock Jun 07 '16 at 15:54
0

As for as I know, phone camera would be accessed by mobile application only since that is the operating system for the phone hardware.

Liferay portlet is a web application running on liferay portal server which doesn't have any direct access to underlying the phone's OS.

You can add your logic to portlet probably accessing the phone via mobile operating system API.

Hope this would clarify you.