Qt c++ OrangePi (Linux) QWebView VideoCapture
Unsolved
Qt WebKit
-
Hello! I'm try to make navigator.mediaDevices.getUserMedia in my Qt project with QWebView. In html I use standard code which work fine:
<style> #container { margin: 0px auto; width: 500px; height: 375px; border: 10px #333 solid; } #videoElement { width: 500px; height: 375px; background-color: #666; } </style> <div id="container"> <video autoplay="true" id="videoElement"> </video> </div> <script> var video = document.querySelector("#videoElement"); if (navigator.mediaDevices.getUserMedia) { navigator.mediaDevices.getUserMedia({ video: true }) .then(function (stream) { video.srcObject = stream; }) .catch(function (err0r) { console.log("Something went wrong!"); }); } </script>
When I open it in browser, it get access to webcam and display video. But when I run in Qt I get error in console:
TypeError: undefined is not an object (evaluating 'navigator.mediaDevices.getUserMedia')
please help: how to set access for video in QWebView? Thanks!
P.S. as I know, I can't make QWebEnginePage on OrangePi