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

responsive problem


Hello

i use this code :

var playerInstance = jwplayer("myElement");
playerInstance.setup({
image: "/uploads/myPoster.jpg",
sources: [{
file: "/uploads/myVideo720.mp4",
label: "720p HD"
},{
file: "/uploads/myVideo360.mp4",
label: "360p SD",
"default": "true"
},{
file: "/uploads/myVideo180.mp4",
label: "180p Web"
}]
});

and I would like to add responsive code width: "50%", aspectratio: "16:9" this code but not working .

help me how to add responsive code with 3 quality player .

Thanks

5 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

This code should work:
var playerInstance = jwplayer(“myElement”);
playerInstance.setup({
image: “http://content.jwplatform.com/thumbs/PxnoM5gE-720.jpg”,
sources: [{
file: “http://content.jwplatform.com/videos/PxnoM5gE-720.mp4”,
label: “720p HD”
},{
file: “http://content.jwplatform.com/videos/PxnoM5gE-360.mp4”,
label: “360p SD”,
“default”: “true”
},{
file: “http://content.jwplatform.com/videos/PxnoM5gE-180.mp4”,
label: “180p Web”
}],
width:“50%”,
aspectratio:“16:9”
});

If it does not, please send over a test page for further debugging.

Hossein

User  
0 rated :

Thanks but not working

i use this code :

<div id='myElement'></div>
<script type='text/javascript'>
var playerInstance = jwplayer("myElement");
playerInstance.setup({
image: "http://content.jwplatform.com/thumbs/PxnoM5gE-720.jpg",
sources: [{
file: "http://content.jwplatform.com/videos/PxnoM5gE-720.mp4",
label: "720p HD"
},{
file: "http://content.jwplatform.com/videos/PxnoM5gE-360.mp4",
label: "360p SD",
"default": "true"
},{
file: "http://content.jwplatform.com/videos/PxnoM5gE-180.mp4",
label: "180p Web"
}]
});
</script>

and worked . but after add width:“50%”, and aspectratio:“16:9” not showing player !!

i use localhost .

George

JW Player Support Agent  
0 rated :

I would need to see a test page for me to debug this further

Hossein

User  
0 rated :

can use css class for responsive this ?

George

JW Player Support Agent  
0 rated :

You should use the settings defined. Are you using the cloud hosted player? Did you set the player to be responsive in your dashboard?

This question has received the maximum number of answers.