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

Skin CSS URL loaded multiple times (JW 7)


The documentation recommends against configuring the skin via URL (e.g. skin.url), as this can impact player setup performance. Makes sense.

In the event you need to rely on this method, note that if there are _multiple_ players (for example, 3 players) on the page using the same configuration setup, the associated CSS will also be loaded just as many times as there are players (even when using the _same_ skin.url between player instances) e.g.

CONFIG:

skin: {
name: 'custom',
url: '/path/to/custom.css' // Relative URL
}


RESULT:

<head>
<link type="text/css" rel="stylesheet" href="/path/to/custom.css">
<link type="text/css" rel="stylesheet" href="/path/to/custom.css">
<link type="text/css" rel="stylesheet" href="/path/to/custom.css">
...
</head>


However, provided you do _not_ use a relative URL, and enter a fully qualified URL (containing http(s)://) under the same circumstances, the CSS is luckily only loaded once.

CONFIG:

skin: {
name: 'custom',
url: 'https://domain.com/path/to/custom.css' // Fully qualified URL
}


RESULT:

<head>
<link type="text/css" rel="stylesheet" href="https://domain.com/path/to/custom.css">
...
</head>


Is it the intended behavior to duplicate relative skin.url like that?

2 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi, there.

My name is Alex and I am one of the Support Engineers at JW Player. I will be more than happy to assist you with your questions.

This most likely has to do with how the browser caches the CSS file. Is there any particular reason you can’t use an absolute URL?

webmaster

User  
0 rated :

Alex,

There's no reason absolute URL cannot be used. Given this issue, it seems it's currently a requirement for JW 7, at least if you're concerned about the (small) performance impact of loading the same skin multiple times.

Generally speaking, I tend to rely on <base href> and leverage relative pathing for assets on the same domain.

This question has received the maximum number of answers.