[wpe-webkit] Video via WebRTC. webcam + mic permissions

Adrian Perez de Castro aperez at igalia.com
Tue Mar 19 09:28:05 PDT 2019


Hello Diego,

On Thu, 07 Mar 2019 18:31:35 +0000, Diego Moore <diego.moore at gmail.com> wrote:
 
> I’m rather new here and am exploring Video via WebRTC. I’ve got a WPE build
> on an RPI3 but have noticed that many video calling tools such as Zoom.us
> <http://zoom.us/>, talky.io <http://talky.io/> and meet.jit.si
> <http://meet.jit.si/> do not support WPE. 
> 
> I’ve now come across http://appr.tc <http://appr.tc/> (see
> https://github.com/webrtc/apprtc <https://github.com/webrtc/apprtc>) which
> may work but I’ve got a funny feeling I just can’t see the browser dialog to
> allow access to the webcam and mic. 
> 
> Is it possible to configure WPE with a whitelist of pre-authorised domains?
> I’m pretty sure the Chromium kiosk mode handles this well… 

Applications which use the WebKit API are responsible for deciding whether a
certain permission request is to be granted or not (often after presenting
some kind of choice to the user, in case of a “normal” browser). If you use
the Cog launcher [1], we have added just yesterday in the “master” branch a
new “--set-permissions=all” command line flag that you can use [2].

If, on the other hand, you are using your own launcher/browser, you will
need to add a callback for the WebKitWebView::permission-request signal [3].
Something like the following could do:

  static gboolean
  host_user_media_allowed (const char *hostname)
  {
     /* ... */
  }

  static gboolean
  on_permission_request (WebKitWebView *web_view,
                         WebKitPermissionRequest *request,
						 void *userdata)
  {
      if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST (request)) {
	      g_autoptr(SoupURI) uri =
		      soup_uri_new(webkit_web_view_get_uri (web_view));
		  if (uri && host_user_media_allowed (soup_uri_get_host (uri)))
		      webkit_permission_request_allow (request);
		  else
		      webkit_permission_request_deny (request);
		  return TRUE;  /* We have handled the request */
	  }

	  return FALSE;  /* Use default implementation */
  }

Of course, the above is just a skeleton implementation to get you started,
and you will have to fill in the details when writing the code in your
application — but I am sure you can get the idea.

I hope the suggestions above help.
Best regards,


-Adrián


---
[1] https://github.com/Igalia/cog
[2] https://github.com/Igalia/cog/pull/84
[3] https://wpewebkit.org/reference/wpewebkit/2.23.90/WebKitWebView.html#WebKitWebView-permission-request
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-wpe/attachments/20190319/d81a1a56/attachment.bin>


More information about the webkit-wpe mailing list