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

aspectratio not working with numeric width


jwplayer("videoEx").setup({
"file": "http://media.peaceever.com/video/15s.mov",
"image":"/images/slideshowbg.png",
"width":640,
"aspectratio":"16:9"
});

On my site, the above code doesn't work properly, the video container's size will be 640*270, while the video player's size being 480*270, making two black bars on the sides of the video player. I have to do

"width":"53%"

to get the video container and player to be same size 640*360

1 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.

When setting the aspectratio option in the configuration, the width option should be set to 100%. The aspectratio setting is there in order to make the player responsive, so the width of the player would have to fill up the entire width of it’s containing element.

If you did not want the player to be responsive, then you would want to set hard values for both the width and height of the player. For example:

jwplayer("videoEx").setup({
  "file": "http://media.peaceever.com/video/15s.mov",
  "image":"/images/slideshowbg.png",
  "width":640,
  "height":360
});

Please let me know if you need any more help or have any other questions.

Thank you!

This question has received the maximum number of answers.