
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,