Discussion:
Safari vs Browser Widget
Dan Friedman via use-livecode
2018-11-30 00:04:57 UTC
Permalink
Greeting! I am hoping someone has an answer for this…

I am working on a HTML5 web page that accesses the device's camera. When I open the url in Safari (on my Mac or iOS device), I am asked if it's ok to use the camera and everything works perfectly! However, if I load this same url in the Browser Widget (or a plain native browser), it doesn’t ask to use the camera and it all fails. Is this a limitation of the implementation of the browser in LiveCode, or is there a setting I have to set?

Thank you!
-Dan
hh via use-livecode
2018-11-30 02:02:26 UTC
Permalink
The getUserMedia() dialog doesn't work in the browser widget.
You could try to do that "as javascript" in your HTML5 app.
Tom Glod via use-livecode
2018-11-30 04:37:30 UTC
Permalink
Dan would love to be kept up to date if you manage to find a workaround for
this issue.

Good luck and thanks.

On Thu, Nov 29, 2018 at 9:02 PM hh via use-livecode <
Post by hh via use-livecode
The getUserMedia() dialog doesn't work in the browser widget.
You could try to do that "as javascript" in your HTML5 app.
_______________________________________________
use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your
http://lists.runrev.com/mailman/listinfo/use-livecode
Andre Alves Garzia via use-livecode
2018-11-30 09:53:27 UTC
Permalink
Dan,

I am not expert in the widget but I do know quite a lot about browsers.
Those APIs are restricted access API which usually require some sort of
configuration on the browser library you're using when building your
product, which is a convoluted way to say that LiveCode HQ proabably
needs to set something on libbrowser for this to work out of the box.

I have checked the LC source code and found that the browser
initialization depends on some factory called `MCBrowserFactoryRef`
which is an abstraction on the browser engine being used. In your macOS
case, I don't know if it is using CEF or WebKit but it if is CEF then
there is a "enable-media-stream" argument that is usually passed via
command-line parameters but in our case it probably need to be passed
via `t_args` in the calls to `CefExecuteProcess()`. I am sure there is a
corresponding WebKit thing to do but I am not sure what.

These kind of switches are needed because Camera APIs are sensitive and
can lead to privacy abuse and security exploits, so they tend to be
disabled by default unless configured or asken for permission. In case
of embeddable browser libraries, they usually lack the UI elements to
ask for permission, so in their case it is is usually something you
configure in code.

You might ask HQ to add the CEF param as a property for the widget. It
might be easy to add.
Post by Dan Friedman via use-livecode
Greeting! I am hoping someone has an answer for this…
I am working on a HTML5 web page that accesses the device's camera. When I open the url in Safari (on my Mac or iOS device), I am asked if it's ok to use the camera and everything works perfectly! However, if I load this same url in the Browser Widget (or a plain native browser), it doesn’t ask to use the camera and it all fails. Is this a limitation of the implementation of the browser in LiveCode, or is there a setting I have to set?
Thank you!
-Dan
_______________________________________________
use-livecode mailing list
http://lists.runrev.com/mailman/listinfo/use-livecode
Continue reading on narkive:
Loading...