首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Youtube流媒体

Youtube流媒体
EN

Stack Overflow用户
提问于 2014-04-23 23:05:30
回答 1查看 64关注 0票数 0

我正在ASP平台上工作,并使用流媒体定制CMS来显示youtube剪辑。

我需要让它们做出响应,但似乎做不到。

JavaScript中有修复吗?

我不能使用HTML,因为它需要是通用的,因为我有大量的流媒体视频。

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23248293

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档