MOMO

首页 > QT > QWebengine允许调用Webcam

QWebengine允许调用Webcam

Jun 2018 04

允许Qt Webengine调用本地摄像头

收到page的信号强制允许就好了。
这里偷懒允许了所有feature,需要根据需求自定义

        connect(page, &QWebEnginePage::featurePermissionRequested,
                        [this, page](const QUrl &securityOrigin, QWebEnginePage::Feature feature) {
                page->setFeaturePermission(
                                        securityOrigin, feature, QWebEnginePage::PermissionGrantedByUser);
        });

        

--转载请注明: https://momo.cool/qwebengine%e5%85%81%e8%ae%b8%e8%b0%83%e7%94%a8webcam/

说点什么

avatar
  Subscribe  
提醒
Optimized with PageSpeed Ninja