QWebView does not display a video
Hello
I've a local page which contains several video objects:
Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML5 Video Player</title>
</head>
<body>
A message
<div >
<object width="400" height="400" data="big_buck_bunny.mp4" controls="0"></object>
<object width="400" height="400" data="Robotica_720.wmv" controls="0"></object>
<object width="400" height="400" data="ArchitectVideo_dvd.ogv" controls="0"></object>
</div>
</body>
</html>
I have plugins enabled for my QWebView,but in it I don't see the movies but icon similar to those in browsers indicating a plugin is missing.
Can anyone give me a hint what I need to display the vids?
Qt 5.3 32bit,VS2013 with Add-on
Re: QWebView does not display a video
Correct me if I'm wrong but for HTML5 you should use a <video> tag and not <object>. Otherwise you would be playing the video via a plugin.
Re: QWebView does not display a video
That's true Wysota,but I did the above because <video> tag seems to not working too.
Code:
<!-- <video controls>
<source src="ArchitectVideo_dvd.ogv" type="video/ogg">
</video> -->
This is how my code was during 1st attempt to play a video in QWebView.
Also,from what I know there will be issues to play .avi files via <video> tag,and that possibility is highly demanded in my application.
Re: QWebView does not display a video
Quote:
Originally Posted by
MasterBLB
Also,from what I know there will be issues to play .avi files via <video> tag,and that possibility is highly demanded in my application.
You'll be having issues in playing them (and all other) with the plugin api if you don't have a working plugin too.
This works for me without problems:
Code:
#include <QtWidgets>
#include <QWebView>
int main(int argc, char **argv) {
QWebView view;
view.
setUrl(QUrl::fromLocalFile("/tmp/vi/main.html"));
view.show();
return app.exec();
}
Code:
<html>
<body>
<video width="1920" height="1080" controls>
<source src="http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_surround.avi" type="video/mp4"/>
</video>
</body>
</html>
Re: QWebView does not display a video
Unfortunately,for me it does not.
Also,when I try to open the html in a browser (opera 12.17 and IE 11) it does not work too.
Re: QWebView does not display a video
Tough luck, it's valid html5 code. You should at least get the (probably black) player rectangle, even if your browser cannot play the movie. You can replace the avi with some other format and try again.
1 Attachment(s)
Re: QWebView does not display a video
Yes,that's is - I have a player object,but nothing happens when I hit play.
And that's the result for all video types.
Added after 29 minutes:
This is how it looks:
Attachment 10884