[Solved]Can QWebEngineView load and play local multimedia files?
i know about security but it is no problem for me.
i was tried with varius ways but no success.
<video crossorigin='blah' src='foo.mp4'/>
var filepicker = document.getElementById("file").files var player = document.getElementById("player") player.src = URL.createObjectURL(filepicker)
QtWebEngine::initialize(); QWebEngineView* web = new QWebEngineView(); web->page()->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls,true); web->page()->setFeaturePermission(QUrl("file:///home/me/test.html"),QWebEnginePage::MediaAudioVideoCapture,QWebEnginePage::PermissionGrantedByUser);
When page loaded i can see video element. But it seems like disabled as no 'src'.
But everythings fine with youtube.
Are there a way for this?
Well. 'ogg' audios and 'webm' videos are playable but 'mp3' and 'mp4' formats not playable.
Are 'mp3' and 'mp4' formats banned by Qt devs? If so; is because legal/third-party issues?
Similar q already asked there.
Thanks a lot.
Hi and welcome to devnet,
Here you have the explanation
@SGaist: that's exact answer i am looking for. Thank you.
I am also trying to play mp3/mp4 files from html using Qwebengineview. I am working on Qt5.6 on windows 7. So only building with codec option will be only solution?
Please let me know on this issue in detail.
It's also explained in the QtWebEngine Features documentation in the chapter about proprietary codecs.
So according to documentation, apart from building Qtwebengine with given option is there any other way? It is also stating about ffmpeg. Does it can be used?
AFAIK yes, but you still need a build of ffmpeg that supports h.264.