Results 1 to 3 of 3

Thread: html5 video tag not working on Windows

  1. #1
    Join Date
    Dec 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X

    Question html5 video tag not working on Windows

    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.

    Qt Code:
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    3. <head>
    4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    5. <style type="text/css">
    6. body { margin: 0; font-size: 2em; background-color: white; }
    7. h1 { text-align: center; color: red; }
    8. h1 + h1 { color: green; }
    9. h1:last-child { color: blue; }
    10. #quit { background-color: gray; color: white; font-weight: bold; display: block; text-align: right; }
    11. </style>
    12. <script type="text/javascript">
    13. var counter = 0;
    14. function toggleElement()
    15. {
    16. var elements = document.getElementsByTagName('h1');
    17. for (var i = 0; i < elements.length; ++i)
    18. elements[i].style.display = (counter % elements.length) == i ? '' : 'none';
    19. counter++;
    20. setTimeout('toggleElement()', 1000);
    21. }
    22. window.onload = function()
    23. {
    24. document.getElementById("quit").onmousedown = function()
    25. {
    26. Qt.quit();
    27. };
    28. toggleElement();
    29. }
    30. </script>
    31. </head>
    32. <body>
    33. <a id="quit">X</a>
    34. <h1>Hello</h1>
    35. <h1>HTML5</h1>
    36. <h1>World</h1>
    37.  
    38. <video width="320" height="240" controls>
    39. <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
    40. Your browser does not support the video tag.
    41. </video>
    42.  
    43. </body>
    44. </html>
    To copy to clipboard, switch view to plain text mode 

    Thanks!

  2. #2
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: html5 video tag not working on Windows

    Hi,

    I am facing the same problem on win 7. How come nobody is answering this??? I think this is critical. Hope some of the Masters turn their attention to this.

    Sky.

  3. #3
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: html5 video tag not working on Windows

    Try changing the following tags:

    Qt Code:
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    To copy to clipboard, switch view to plain text mode 

    to

    Qt Code:
    1. <!DOCTYPE html>
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    To copy to clipboard, switch view to plain text mode 

    to

    Qt Code:
    1. <html>
    To copy to clipboard, switch view to plain text mode 

    From what I've seen Windows version is more restrictive than Linux version.

    Also, from what I know html5 pages are contained in
    Qt Code:
    1. <!DOCTYPE html>
    2. <html>
    3. </html>
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 4
    Last Post: 19th October 2012, 11:14
  2. Replies: 7
    Last Post: 24th September 2012, 07:17
  3. Does Qt 4.7.3 support HTML5 video in Qt WebKit?
    By allamsetty in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 9th April 2012, 20:02
  4. Replies: 0
    Last Post: 3rd March 2012, 08:46
  5. HTML5 video and Qt4.6 WebKit
    By carribus in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2010, 10:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.