ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 10427|回复: 0

[Linux] jw player 使用例子

[复制链接]
发表于 2014-6-21 23:24:51 | 显示全部楼层 |阅读模式
jw player 支持rtmp, hls, 界面也挺漂亮的。  我写了一段demo, 同时兼容windows / 苹果,  在windows下就跑rtmp, 苹果上就hls,         <script type="text/javascript" src="jwplayer/jwplayer.js"></script>
        <script type="text/javascript" src="jwplayer/jwplayer.html5.js"></script>

        function init()
                {
                        var path = document.getElementById('videopath').value;
                        var name = document.getElementById('videoname').value;
                        jwplayer("mediaplayer").setup({       
                           playlist: [{
                                sources: [{
                                    file: 'rtmp://' + path + '/' + name
                                },{
                                    file: 'http://' + path + '/' + name
                                }]
                            }],
                           height: 360,
                           primary: "flash",
                           width: 640
                        });
                       
                        var p = path + '/' + name;
                        //alert(p);
                }


会c/c++的话, 这点js 应该你也看得懂,要用jw player 6 或者以上的版本。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-4-27 01:08 , Processed in 0.048467 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表