We are using the newest release version of JWPlayer (6.8). We encountered a Bug in the Player:
If the player is embedded in a html5 page, an object html element will be created, e.g.: <object type="application/x-shockwave-flash" data="http://localhost:8081/resources/javascript/jwplayer/jwplayer.flash.swf" width="100%" height="100%" bgcolor="#000000" id="video-player" name="video-player" tabindex="0" style="position: absolute;"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="seamlesstabbing" value="true"><param name="wmode" value="opaque"></object>
This html snipped is not valid in the case of a html5 doctype: In the official version of the w3c validator, this snipped is invalid, because of the % sign in the width and height attribute, and also because of the attribute bgcolor, which is not allowed in the object element at all.
And Willie, the poster isn't creating the <object> tag - JW Player is creating it. And JW Player in Flash mode is producing exactly the code the poster has laid out here, complete with the HTML errors he's identified.
If you don't believe me, take a look at this simple, plain-vanilla demo page:
http://misterneutron.com/JW6videoFlash/
Before you even launch the player, pull up your web developer tools and take a good look at the <object> tag that JW Player has created in the "myElement_wrapper" div.
Yes, I am certain. If you download the scripts, you're given 6.8. If you use the cloud-hosted versions, you get 6,9. This is completely in accordance with the (misguided) JW Player rollout sequence.
The current productive demo system is available at http://www.opencourseworld.de
On the first page, you will find the embedded JWPlayer with the invalid width, height and bgcolor attributes in the surrounding object html element tag. All attributes are added automatically by the JWPlayer.js and cannot be changed.
I stumbled on this page while preparing to log a similar issue.
I have a minimal page here: http://vdgsa.org/pgs/mp4/aov/test.html
To reproduce errors: 1. Turn on Firebug 2. Copy the html source using Firebug (select HTML tab, right-click on <html>, copy html) 3. Paste into W3C Html validator 4. Add <!DOCTYPE html> at top 5. Validate
You will see some 10 errors in the html generated by JW Player. Am I doing something wrong?
Error Line 2, Column 1079: An head start tag seen but an element of the same type was already open.
Error Line 4, Column 58: Bad value X-UA-Compatible for attribute http-equiv on element meta.
Error Line 159, Column 455: Attribute x-webkit-airplay not allowed on element video at this point.
Error Line 159, Column 542: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 1016: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 2069: Element img is missing required attribute src.
Error Line 159, Column 2069: An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images.
Error Line 159, Column 2109: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 4219: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 8433: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 11903: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 15362: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Error Line 159, Column 20332: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
Warning Line 376, Column 33: Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections.
You do have to use Firebug or equivalent to expand the HTML, and then send the expanded HTML to the validator, to see these errors.
Yes, I did that. Those are the other errors that were reported in addition to the x-webkit-airplay=“allow” issue.
However, is this a huge problem? Does it prevent the player from working? Does it break anything on your site?
A good reference is the x-webkit-airplay=“allow” issue, which is actually something that is needed for iOS devices, and even though the w3c doesn’t recognize it, and thus doesn’t pass validation, it is something that is required.
No, not a problem, at least for me. As far as I know it doesn't prevent the player from working (for me) and doesn't break anything on my site.
It was just something I noticed when debugging my own problems, and I thought that JWPlayer would be interested.
The "Element div not allowed as child of element span" errors seem to indicate some sort of structural issue, as opposed to using non-standard features.
Anyway, I just thought that JWPlayer would want to get rid of these errors in case they come back to bite sometime in the future.
Hi Ethan, as this problem leads to failing automatic tests checking the validity of our HTML code, does your last comment mean "this issue will be fixed in the release 6.9"? Can you give already a release date of 6.9?