zorlette
2nd January 2013, 17:18
I've created a new html5 app project and modified default index page to add video tag (see code below). It works on Mac but not on Windows. How can I get it to work in Windows?
I am using Qt 4.8.4(3) and Qt Creator 2.6.0 on Mac OS X 10.8.2 and Windows 7.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body { margin: 0; font-size: 2em; background-color: white; }
h1 { text-align: center; color: red; }
h1 + h1 { color: green; }
h1:last-child { color: blue; }
#quit { background-color: gray; color: white; font-weight: bold; display: block; text-align: right; }
</style>
<script type="text/javascript">
var counter = 0;
function toggleElement()
{
var elements = document.getElementsByTagName('h1');
for (var i = 0; i < elements.length; ++i)
elements[i].style.display = (counter % elements.length) == i ? '' : 'none';
counter++;
setTimeout('toggleElement()', 1000);
}
window.onload = function()
{
document.getElementById("quit").onmousedown = function()
{
Qt.quit();
};
toggleElement();
}
</script>
</head>
<body>
<a id="quit">X</a>
<h1>Hello</h1>
<h1>HTML5</h1>
<h1>World</h1>
<video width="320" height="240" controls>
<source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
Thanks!
I am using Qt 4.8.4(3) and Qt Creator 2.6.0 on Mac OS X 10.8.2 and Windows 7.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body { margin: 0; font-size: 2em; background-color: white; }
h1 { text-align: center; color: red; }
h1 + h1 { color: green; }
h1:last-child { color: blue; }
#quit { background-color: gray; color: white; font-weight: bold; display: block; text-align: right; }
</style>
<script type="text/javascript">
var counter = 0;
function toggleElement()
{
var elements = document.getElementsByTagName('h1');
for (var i = 0; i < elements.length; ++i)
elements[i].style.display = (counter % elements.length) == i ? '' : 'none';
counter++;
setTimeout('toggleElement()', 1000);
}
window.onload = function()
{
document.getElementById("quit").onmousedown = function()
{
Qt.quit();
};
toggleElement();
}
</script>
</head>
<body>
<a id="quit">X</a>
<h1>Hello</h1>
<h1>HTML5</h1>
<h1>World</h1>
<video width="320" height="240" controls>
<source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
Thanks!