在线播放流媒体直播的解决方案

视频源:http://101.226.65.196:1864/100814300.flv

协议:HTTP
格式:FLV

主流H5播放器都能顺利播放,但是直播的流地址通常是 RTMP 协议。

RTMP (Real Time Messaging Protocol 实时消息传输协议) 是一个用于将点播和直播媒体交付给 Adobe Flash 应用的体系。参考文章:这里

推荐两个播放器:

1. JW Player

官方地址:http://www.jwplayer.com/

  • jwplayer.js
  • jwplayer.html5.js
  • jwplayer.flash.swf

示例代码:

<script type="text/javascript" src="jwplayer.js"></script>
<script type="text/javascript" src="jwplayer.html5.js"></script>
<div id="player_wrapper" style="width:338px;height:190px;position:relative;">
    <object name="player" width="100%" height="100%" id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
            style="position:absolute;top:0;left:0;">
        <param name="movie" value="jwplayer.flash.swf">
        <param name="src" value="jwplayer.flash.swf">
        <param name="AllowScriptAccess" value="always">
    </object>
</div>
<script type="text/javascript">
    jwplayer('player').setup({
        playlist: [{image: '', file: 'http://101.226.65.196:1864/100814300.flv'}],
        "skin": "",
        //playlist: [{image:'snip20150721_3.png',file:'rtmp://218.107.62.127:1936/pclive'}],
        //playlist: [{image:'',file:'http://movie.ks.js.cn/flv/other/1_0.flv'}],
        width: '338px',
        aspectratio: '16:9',
        fallback: 'false',
        primary: jwplayer.utils.isChrome() ? "flash" : "html5"
    });
</script>

2. ckplayer

官方地址:http://www.ckplayer.com/

Got Something To Say:

Your email address will not be published. Required fields are marked *

*

© 2006-2018. Powered by WordPress Romangie & Bootstrap. ICP No. 15008795