2016-08-02 30 views
0

不工作我用這個代碼jwplayer:響應在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>

和工作。在添加寬度之後:「50%」,以及aspectratio:「16:9」,以便在網站上不顯示響應式播放器!

感謝您的幫助

回答

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> 
+0

非常感謝。工作! –