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

Height of my jwplayer is always 270 px


Hi all,

Already many thanks for your help.
For the sake of simplicity, I've created a very simple page with only a jwplayer to expose you my problem.

Please see the code below:

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
​<script src="js/jwplayer.js"></script>
<script>jwplayer.key="vjJrlNOkKUvT3Nd0WICBnZE0BJKpaAnLYTEunQ==";</script>
</head>

<body>
<div>
<div id="myElement">Loading the player...</div>
</div>

<script>
$(function(){
var playerInstance = jwplayer('myElement');
playerInstance.setup({
file: "inde-les-portraits-de-craie.mp4",
image: "video-thumbnail.jpg",
aspect:"16:9",
width: '100%',
skin:{
name:"glow",
},
mediaid: '123456'
});
});
</script>
</body>
</html>

You can see the result here : http://lesportraitsdecraie.com/movie2.html

The jwplayer is taking the whole width, as asked (100%). However, the height is not adapted automatically and always stays at 240px. Therefore and to respect the 16:9 ratio aspect, the width of the video is 480px.

How can I make the player compute automatically the required height so that the video takes the whole width?

I've looked around on the communty, but didn't find any answer so far...

Thank you for your help,

Best,

3 Community Answers

Alex

JW Player Support Agent  
1 rated :

Hi, there.

The correct option for the embed code for aspect ratio is aspectratio, not aspect. Please change that on your page and let me know if the issue is resolved.

Thank you.

marine.vancampenhout

User  
0 rated :

Hi Alex,

I feel very stupid now... It works like a charm with the correct property name :-)

Many thanks for your help !

Kind regards,

Alex

JW Player Support Agent  
0 rated :

Not a problem!

This question has received the maximum number of answers.