Martin, Greg and I spent quite a bit of time getting the video page (player.php) to validate as XHTML5. The validation started out as part of the debugging process while figuring out why the HTML5 video player wasn't displaying in Firefox.
So, first we changed the document to XHTML5:
- Changed the doctype to html
- Changed the content-type header to: application/xhtml+xml;charset=utf-8
But that was causing hitherto unnoticed character encoding problems to throw outright validation errors. The characters came from the XML data and were mostly French accent characters. The XML itself was fine, so I finally boiled it down to an incorrect usage of PHP's XSLTProcessor library by the PHP eXist database library (which we didn't write). Following a comment made on the PHP page for XSLTProcessor::__construct, I changed this:
$xml_result = $xslt->transformToDoc($dom);
$xml_result = $xslt->transformToXML($dom);
In other words, from a DOMDocument object to plain old XML string. The DOMDocument transformation was resulting in improper character conversion.
Switching to transformToXML worked, EXCEPT that now, self-closing tags defined in the XSLT (e.g. img) stylesheets weren't being closed when transformed into XHTML, even though they were closed in the XSL files (weird). The solution, after some trial and error, was to change this tag in the XSL file:
<xsl:output method="html" omit-xml-declaration="yes" />
<xsl:output method="xml" omit-xml-declaration="yes" />
So, simply changing the output method from html to xml. And luckily, that did the trick. The page was validating as XHTML5! Yay! Except for one problem...
The OGV videos still weren't playing in Firefox. D'oh. Then something clicked in Greg's mind and he remembered a similar problem on another project that turned out to have something to do with MIME types. Lo and behold, Apache doesn't have an OGV mime type (at least, not in the version running on the Francotoile server). So, I added this to the .htaccess file (along with MP4 types for good measure):
AddType video/ogg .ogv AddType video/mp4 .mp4 AddType video/x-m4v .m4v
And that was it - video now working in Firefox.