I was creating a simple webbrowser using webengine. I went to youtube and tried to play a live stream but failed. Same thing happens with every video which requires HTML5 video support in browsers. I didn't saw any recent problems which are identical to this. Qt says that webengine has HTML5 support from they released Qt5. Some old answers to same questions suggest them to compile qtwebengine your own. I tried several attempts and failed(may be my computer can't do the job). Some other say to enable proprietary plugins from the code. But in my case it too didn't work.
Running the code also logs an error WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
So this is my simple qml code.
import QtQuick 2.12
import QtQuick.Window 2.12
import QtWebEngine 1.0
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
WebEngineView{
anchors.fill:parent
url:"https://www.youtube.com/watch?v=iL53Y28Rp84"
}
}
Qt version: 5.15.1(GNU Public License )
Installed using qt online installer.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…