Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QWebEngineView WebRTC udp/tcp test failed?



  • I just want to use WebRTC in the QWebEngineView, but it seems udp/tcp was not supported and how to resovle it?
    Here is my simple code:

    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        webView = new QWebEngineView;
        connect(webView->page(),
                SIGNAL(featurePermissionRequested(const QUrl&, QWebEnginePage::Feature)),
                SLOT(featurePermissionRequested(const QUrl&, QWebEnginePage::Feature)));
    
        QUrl url = QUrl("https://test.webrtc.org/");
        this->webView->setUrl(url);
        this->webView->show();
    
        this->setCentralWidget(this->webView);
    }
    
    void MainWindow::featurePermissionRequested(const QUrl &securityOrigin,
                                                QWebEnginePage::Feature feature)
    {
        qDebug() << "securityOrigin" << securityOrigin << feature;
    
        this->webView->page()->setFeaturePermission(securityOrigin,
                feature, QWebEnginePage::PermissionGrantedByUser);
    }
    

    and the test result was:
    2020-02-11-11-57-22.png


Log in to reply