码迷,mamicode.com
首页 > 其他好文 > 详细

rtmp jwplayer简单应用

时间:2017-02-12 11:03:35      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:rtmp   http   nginx   setup   ref   ace   space   rtm   r.js   

在nginx下使用,放到nginx/html文件夹内,之后访问

首先是播放vod视频

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>RTMP Sample Player JWPlayer i</title>
    <script type=‘text/javascript‘ src=‘jwplayer.js‘></script>
</head>
<body align="center">
    <h1>RTMP Sample Player JWPlayeri v1.0</h1>
    <div align="center">
    <div id=‘mediaspace‘>This text will be replaced</div>
    <script type=‘text/javascript‘>
    jwplayer(mediaspace).setup({
            flashplayer: player.swf,
            file: test.mp4,
            streamer: rtmp://live.tla001.cn/vod,
            controlbar: bottom,
            height: 360,
             width:"640"
     });
    </script>
    </div>
</body>
</html>

 

  然后是播放rtmp直播流

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>RTMP Sample Player JWPlayer i</title>
    <script type=‘text/javascript‘ src=‘jwplayer.js‘></script>
</head>
<body align="center">
    <h1>RTMP Sample Player JWPlayer v1.0</h1>
    <div align="center">
    <div id=‘mediaspace‘>This text will be replaced</div>
    <script type=‘text/javascript‘>
    jwplayer(mediaspace).setup({
            flashplayer: player.swf,
            file: test1,
            streamer: rtmp://live.tla001.cn/live,
            controlbar: bottom,
            height: 360,
             width:"640"
     });
    </script>
    </div>
</body>
</html>

效果

技术分享

附件

jwplayer

rtmp jwplayer简单应用

标签:rtmp   http   nginx   setup   ref   ace   space   rtm   r.js   

原文地址:http://www.cnblogs.com/tla001/p/6390483.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!