Important: Please read the Qt Code of Conduct -

Qt Webengine featurePermissionRequested signal not emitted

  • I am trying to load a page which do WebRTC screen sharing,

    And I have to apply permission to capture the desktop using the code

    webPage->setFeaturePermission(QUrl(url), QWebEnginePage::DesktopVideoCapture, QWebEnginePage::PermissionGrantedByUser);

    And the doc here says I can call it when the signal featurePermissionRequested emitted. I have connect the signal with a slot but it's not getting called when I load the page.

    I am getting following error when try to capture the screen

    [2228:3460:0424/114301.567:INFO:CONSOLE(74)] "Start capturing.", source: (74)
    js: Uncaught (in promise) NotAllowedError: Invalid state
    [2228:3460:0424/114301.599:INFO:CONSOLE(99)] "Uncaught (in promise) NotAllowedError: Invalid state", source: (99)

    Here is the code

        QString  url ="";
        QWebEngineView *webEngineView =  new QWebEngineView(parent);
        connect(webEngineView->page(), SIGNAL(featurePermissionRequested(const QUrl&, 
        QWebEnginePage::Feature)), this,SLOT(featurePermissionRequestedSlot(const QUrl&, QWebEnginePage::Feature)));

    When I click start screen capture the slot featurePermissionRequestedSlot not called, what could be the reason.

  • @haris123 This page uses getDisplayMedia() but that is not supported by QtWebEngine, and I think that is the cause of the error. Try this page "" and this code:

  • @eyllanesc Thanks for the feed, basically I need to create a screen sharing application using Qt, I found that the webRTC has the functionality for that, the client will access the screen using browser, but in server PC(screen sharing PC) I need to do using QT. Is there any other way.

Log in to reply