我将此代码用于jwplayer:
<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>
&#13;
并且工作了。添加宽度后:&#34; 50%&#34;和aspectratio:&#34; 16:9&#34;对于没有在网站上显示的响应式播放器!
感谢您的帮助
答案 0 :(得分:0)
您确定在播放器中的每个选项后添加逗号吗?这对我来说是一个页面:
<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"
}],
aspectratio: "16:9",
width: "50%"
});
</script>