Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Allow WebRTC webcam request using when QtWebEngine
Forum Updated to NodeBB v4.3 + New Features

Allow WebRTC webcam request using when QtWebEngine

Scheduled Pinned Locked Moved General and Desktop
chromiumwebengineqtwebengineqt 5.4.1qml qtwebengineqml
2 Posts 2 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joelmar
    wrote on 17 Jun 2015, 11:16 last edited by joelmar
    #1

    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

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kkoehne
      Moderators
      wrote on 23 Sept 2015, 07:39 last edited by
      #2

      You need to connect to the featurePermissionRequested of the WebView, i.e.

          onFeaturePermissionRequested: {
              grantFeaturePermission(securityOrigin, feature, true);
          }
      

      Director R&D, The Qt Company

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved