Youtube streaming media

Youtube streaming media

本文关键字:media streaming Youtube      更新时间:2023-09-26

我正在使用流媒体播放youtube剪辑的ASP平台[和定制CMS]上工作。

我需要让他们做出反应,但似乎做不到。

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>

要使JWPlayer响应,请设置所需的纵横比(现在的标准是16:9),并将宽度和高度设置为百分比,而不是在JWPlayer对象中指定绝对值。

宽度

播放器的宽度。默认值为480像素。我们建议将其设置为至少320像素,因为否则某些UI元素可能不合适。它也可以设置为"100%",以实现响应式设计与aspectratio选项的组合。

话虽如此,对于高度180px,至少建议控件和图像正确显示。

查看配置参考指南,了解其他可能派上用场的选项。

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