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

resize() not working with percentage


when I input percentage as parameters, like
jwplayer().resize(50%,50%)
I get a javascript error: Uncaught SyntaxError: Unexpected token ,
What did I do wrong?

3 Community Answers

jherrieven

Best Answer 

Try enclosing your percent values in quotes:

jwplayer().resize('50%','50%')

View in conversation

jherrieven

Best Answer  User  
0 rated :

Try enclosing your percent values in quotes:

jwplayer().resize('50%','50%')

Andrew

JW Player Support Agent  
0 rated :

Additionally, I don’t believe you’re going to be able to set a percentage for both height and width here. You can use (‘50%’, 500) or something similar, however.

jherrieven

User  
0 rated :

You can use percentage for both width and height provided the players parent container inherits, or has an explicit, width and height.

James Herrieven

This question has received the maximum number of answers.