rtmp jwplayer簡單應用


在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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM