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

Element ID containing period/dot character causes unexpected behavior


I have 2 sample pages that embed JW Player with Apple's sample HLS stream (https://developer.apple.com/streaming/) that I have been testing on the iPad:

http://osric.com/chris/jwplayer/jwplayer6.8/hls.html
http://osric.com/chris/jwplayer/jwplayer6.8/hls-dot.html

The first works fine. The 2nd is identical, but the element that is to be replaced by the JW Player has a dot character in the ID attribute.

In the 2nd, the play button does not appear, the JW Player logo is in a different position, and once the video is playing there is no controlbar.

Obviously the short answer would be "don't use a dot in your ID attribute." Unfortunately the site I am working with has a lot of IDs with periods, and changing them could have unexpected effects.

3 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html

‘In CSS (and several JavaScript libraries like jQuery), both the period and the colon have special meaning and you will run into problems if you’re not careful. Periods are class selectors and colons are pseudo-selectors (eg., “:hover” for an element when the mouse is over it).’

c...

User  
0 rated :

Understood, but the period is a valid character for the ID attribute in HTML and I'm not using jQuery in my examples.

I am guessing you are saying that the period should be avoided when using JW Player as well, but I just want to make sure.

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, indeed, the period should be avoided when using JW Player as well. the jQuery reference was just an example.

This question has received the maximum number of answers.