2014-04-23 186 views
0

我正在使用流媒體來展示youtube剪輯的ASP平臺[和定製CMS]。Youtube流媒體

我需要讓他們響應,但似乎沒有能力。

在JavaScript中是否存在修復?

我不能使用HTML,因爲它需要是通用的,因爲我有大量流式視頻。

<div id="AssetImgHolder" class="clear" style="width:560px;"> 
<div class="asset"> 
<div id="div85089"> 
</div> 
<script type="text/javascript"> 
<!-- 
//<![CDATA[ 
     jwplayer('div85089').setup({ 
     id: 'jw85089', 
     file: 'my youtube url', 
     width: 560, 
     height: 315, 
     autostart: 'false', 
     repeat: 'false', 
     controlbar: 'bottom' 
     }); 
     jwplayer('div85089').onError(function(event){ 
     this.controls.display.setText('HTML5 support for MP4 video only works with H.264 encoded video.'); 
     }); 

//]]>--> 
</script> 
     <script language="JavaScript" type="text/javascript"> 
     jwplayer('div85089').onPlay(function(){ 
     TrackMediaPlayEvent('162059', 'video (English) - with John Smith', null); 
     }); 
     jwplayer('div85089').onPause(function(){ 
     TrackMediaPauseEvent('162059', 'video (English) - with John Smith ', null); 
     }); 
     jwplayer('div85089').onComplete(function(){ 
     TrackMediaCompleteEvent('162059', 'video (English) - with John Smith', null); 
     }); 
     </script> 
</div> 
</div> 

回答

0

爲了使JWPlayer響應,設定所希望的縱橫比(16:9是標準這些天),並設置寬度和高度,以百分比,而不是在JWPlayer對象確定絕對值。

寬度

寬度播放器。默認爲480像素。我們建議將其設置爲至少320像素,否則某些UI元素可能不適合 。它也可以設置爲「100%」以啓用響應式設計,與 結合使用aspectratio選項。

說到高度180px建議至少爲控件和圖像正確顯示。

查看config-ref指南,瞭解可能派上用場的其他選項。

http://support.jwplayer.com/customer/portal/articles/1413113-configuration-options-reference