Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

JWplayer 6.8 creates invalid html


Hi there,

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.

21 Community Answers

MisterNeutron

User  
0 rated :

Is this actually causing a player error in any browser, on any operating system?

Remember, code validation is a tool, not a goal.

wmeier

User  
0 rated :

@dominik

The error is yours and certaimly not a bug with the JWPlayer.

Sizing of the object ONLY requires a digit and not an attribute.

I suggest that you drop the % in your declaration and provide a suitable digit for the size that you require.

The W3C validator did its job and correctly pointer out an error.

I would in your case always use as a tool "Total Validator' to test for validation...it give you far more detail and provides you with reference.

The HTML5 object engine is a very powerful when used correctly.

This is the error that is observed
Bad value 100% for attribute width on element object:
Expected a digit but saw % instead.

btw, the latest version of the JWPlayer is 6.9.4867

MisterNeutron

User  
0 rated :

JW 6.9 has not yet been made available for self-hosting.

MisterNeutron

User  
0 rated :

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.

wmeier

User  
0 rated :

"JW 6.9 has not yet been made available for self-hosting."

are you certain..I have a copy

My 6.9.4867 examples will go online shortly

MisterNeutron

User  
1 rated :

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.

wmeier

User  
0 rated :

@MisterNeotron

"This is completely in accordance with the (misguided) JW Player rollout sequence."

agree 100% ... 1+

I would go further but then I have to plead the 5th BUT can a Canadian plead the 5th.

btw, not using 'cloud-hosted' version BUT 'self-hosted'

MisterNeutron

User  
0 rated :

Login to your account. Click any of the "download self-hosted layer" links. You'll be given jwplayer-6.8.zip.

Ethan Feldman

JW Player Support Agent  
1 rated :

To the original poster, where are you running this?

dominik.mail

User  
0 rated :

Hi Ethan,

Thank you for your reply.

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.

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, I see that. Nothing is broken though?

pce

User  
0 rated :

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?

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you get the errors here – http://support.jwplayer.com/customer/portal/articles/1406723-mp4-video-embed ?

pce

User  
0 rated :

Absolutely - give it a try.

Peter

Ethan Feldman

JW Player Support Agent  
0 rated :

x-webkit-airplay=“allow”

This is a standard attribute for video tags.

The validator is very picky about things like this.

Is this a huge issue though?

pce

User  
0 rated :

These are the errors I'm seeing:

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.

-- Peter




Ethan Feldman

JW Player Support Agent  
0 rated :

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.

pce

User  
0 rated :

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.

--- Peter

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks, I will pass these along.

christoph.gast

User  
0 rated :

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?

Ethan Feldman

JW Player Support Agent  
0 rated :

I did not say that.

6.9 has already been released, btw – https://account.jwplayer.com/

Like I said, I will log and report them, but I give no guarantee as to what version this will be fixed for.

This question has received the maximum number of answers.