我正在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>发布于 2015-02-25 14:41:27
要使JWPlayer响应,请设置所需的纵横比(目前的标准是16:9),并将宽度和高度设置为百分比,而不是在JWPlayer对象中指定绝对值。
width
播放器的宽度。默认为480像素。我们建议至少将其设置为320像素,否则某些UI元素可能不适合。也可以将其设置为"100%“,以启用响应式设计,并与方面选项相结合。
话虽如此,推荐的高度至少是180px,以便控件和图像能够正确显示。
查看config-ref指南中可能会派上用场的大量其他选项。
http://support.jwplayer.com/customer/portal/articles/1413113-configuration-options-reference
https://stackoverflow.com/questions/23248293
复制相似问题