[Solved]playing video with Qt’s QtWebKit module
-
playing video with Qt’s QtWebKit module
if you're using Google Chrome ,When you open the following link
https://d2pq0u4uni88oo.cloudfront.net/projects/79786/video-87361-h264_high.mp4
you'll see a video player ,then if you "inspect element" and you will See the html5 video tag thereI wonder if we could accomplish the same functionality with Qt’s QtWebKit module
can anyone give a code sample with the above link ? -
The link you have posted is direct link to mp4 file and not any kind of html website...
In QtWebKit you can catch this link click/request in following slots:
"void linkClicked(const Qurl &);":http://qt-project.org/doc/qt-5.0/qtwebkit/qwebview.html#linkClicked
"void downloadRequested(const QNetworkRequest & request)":http://qt-project.org/doc/qt-5.0/qtwebkit/qwebpage.html#downloadRequested
"void unsupportedContent(QNetworkReply * reply)":http://qt-project.org/doc/qt-5.0/qtwebkit/qwebpage.html#unsupportedContentCheck the right one for your requests. When you catch the request you can simple copy the link, create new instance of webview(or use existing one), create simple HTML code with catched link and load this code in your webview....
-
thanks ,I should learn HTML then