Browser widget - How to grant peripherals permission?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Browser widget - How to grant peripherals permission?

Post by Monox18 » Fri Dec 11, 2020 1:02 am

Hello all,

I'm currently testing how does a streaming platform such as Jitsi works in the browser widget. Apparently all the HTML5 code works well. The problem is the website is requesting me to grant permission for microphone usage. I don't see the typical popup message "meet.jit.si wants to... Use your microphone.. allow or block". I imagine this is a browser configuration setting and not a webpage setting. How can I display this message? or directly grant the browser permission to access the microphone and other peripherals?

Thanks!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Browser widget - How to grant peripherals permission?

Post by Monox18 » Sat Dec 12, 2020 9:59 pm

I have found the problem and the solution but still no idea how to implement it in either the IDE or Standalone.

Basically I downloaded a CEF sample application from https://cef-builds.spotifycdn.com/index.html version Windows x64.
This is exactly the same browser being used in LiveCode. When I navigate to a microphone testing web page such as https://www.onlinemictest.com/ I get the same error that I see in both the IDE and the Standalone. To solve this error and get access to the microphone and WebRTC elements one needs to call the CEF browser with the "--enable-media-stream" flag. Solution shown in image:

Image

Setting the URL of the widget to it's help page:

Code: Select all

set the url of widget "browser" to "chrome://help/"
shows that the command line used to invoke it was:

Code: Select all

"C:\Program Files\RunRev\LiveCode Indy 9.6.1\LiveCode Indy.exe" --browser-subprocess-path="C:\Program Files\RunRev\LiveCode Indy 9.6.1\Externals\CEF\libbrowser-cefprocess.exe" --no-sandbox --lang=en-US --log-file="C:\Program Files\RunRev\LiveCode Indy 9.6.1\debug.log" --log-severity=disable --resources-dir-path="C:\Program Files\RunRev\LiveCode Indy 9.6.1\Externals\CEF" --locales-dir-path="C:\Program Files\RunRev\LiveCode Indy 9.6.1\Externals\CEF\locales" --disable-features=VizDisplayCompositor,NetworkService
How can I add the "--enable-media-stream" flag to that command. That would work. This is built into the engine so not sure if I can modify it. Any experienced user could guide how to do this? or how to send a flag to a currently running process on background?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: Browser widget - How to grant peripherals permission?

Post by LiveCode_Panos » Thu Jan 21, 2021 12:40 pm

Hello Juan,

Do you by any chance have a sample stack you can share, that shows how to use Jitsi in LiveCode, using the browser widget?

The microphone permissions issue should be fixed in the next LC release (9.6.3 rc1), at least on Windows and Linux, where the CEF browser is used.

Kind regards,
Panos
--

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Browser widget - How to grant peripherals permission?

Post by Monox18 » Thu Jan 21, 2021 8:42 pm

Well the stack is very simple. Just a browser widget with the URL set to https://meet.jit.si/LiveCode
You can use that url as a test. The room is public, no password, open 24/7. That is a live demo hosted in Jitsi. In their main page you can create any other room name, without creating any users. Other people might join as well. That's a quick proof of concept. If you resize the window to really small, it rearranges itself very well making it suitable for mobile as well.

If you are asking for a stack with a deeper API integration, well, no I haven't done that yet. That was my goal before coming to the WebRTC issue. Since I couldn't use my webcam or microphone, there was no point in developing a further integration. I put that on pause, opened the report and you know the rest of the story. Now that the WebRTC has been supported, I'm eager to start testing the API once the next LC is released in a couple months, and I can confirm access to both camera and mic.

I got a question about this. What about Android? I thought Android used CEF as well. I'm praying it uses it.
LiveCode_Panos wrote:
Thu Jan 21, 2021 12:40 pm
at least on Windows and Linux, where the CEF browser is used.
For others users that might be interested into integrating an streaming platform into their LC app, is that Jitsi is open source, and you are allowed to either use the free, paid version or even take the whole code, host your own server and rebrand it (take off Jitsi logo and puts yours, so that your clients think it's your app doing everything and not using a 3rd party). Unlike Zoom, Microsoft teams, Skype and so on... some of them also have API but they are closed source.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Re: Browser widget - How to grant peripherals permission?

Post by JereMiami » Sun Dec 18, 2022 11:39 pm

Anyone ever get the microphone and/or camera to work with the native iOS or Android web browser control (i.e. browser created using mobileControlCreate)?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”