[Qtwebengine] Allow WebRTC webcam request using when QtWebEngine

Pierre Rossi pierre.rossi at gmail.com
Tue Jun 30 18:16:41 CEST 2015


Hi,

I see this question apparently didn't get an answer.

Starting with 5.5, there's a signal called featurePermissionRequested that
is meant to work in tandem with the invokable grantFeaturePermission
function.
if you want to unconditionally allow access to video devices, something
like this should do the trick:

onFeaturePermissionRequested: {
    if (feature === WebEngineView.MediaVideoCapture)
        grantFeaturePermission(securityOrigin, feature, true
}

Note that this API was available as part of the experimental plugin in 5.4,
which you can get by using "import QtWebEngine.experimental 1.0" (see
quicktestbrowser for usage example)

Cheers,
--
Pierre

On Wed, Jun 17, 2015 at 5:38 PM, joël maranhão <joel.maranhao at gmail.com>
wrote:

> Hello,
>
> How do I Allow WebRTC webcam request in QtWebEngine (using QML plugin or
> not)?
>
> My code sample webengine.qml
>
> import QtQuick 2.1
> import QtQuick.Controls 1.1
> import QtWebEngine 1.0
>
> ApplicationWindow {
>     width: 800
>     height: 600
>     color: "lightgray"
>     visible: true
>     WebEngineView {
>         id: webview
>         url: "https://opentokrtc.com/test"
>         anchors.fill: parent
>     }
> }
>
> On my Mac Yosemite, running the command:
>
>  /usr/local/Cellar/qt5/5.4.0/bin/qmlscene webengine.qml
>
> but the video won't start because it's waiting for "Allow" camera, but not
> dialog pops to let me do that.
>
> In other words, is there a way to programmatically set Chromium Web Engine
> policy e.g. VideoCaptureAllowed
>
>
>
> _______________________________________________
> QtWebEngine mailing list
> QtWebEngine at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qtwebengine
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qtwebengine/attachments/20150630/08f730b3/attachment.html>


More information about the QtWebEngine mailing list