您的位置:首页 > 其它

jwplayer做点播

2015-09-07 14:28 218 查看
jwplayer是一个常见的网页播放器,WEB服务器搭建后,修改html,即可在客户端点播。
基于RTMP协议播录像
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Sample Player JWPlayer</title>

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

</head>

<body>

<h1>Sample Player JWPlayer</h1>

<div id='myElement'>This text will be replaced</div>

<script type='text/javascript'>

jwplayer('myElement').setup({

'flashplayer': '/jwplayer/player.swf',
levels:[

{file:"test.flv"}

],

provider: "rtmp",

streamer: "rtmp://172.16.200.60/live",

'controlbar': 'bottom',

'width': '640',

'height': '360'

});

</script>

</body>

</html>

基于HTTP协议播录像
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Sample Player JWPlayer</title>

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

</head>

<body>

<h1>Sample Player JWPlayer</h1>

<div id='myElement'>This text will be replaced</div>

<script type='text/javascript'>

jwplayer('myElement').setup({

'flashplayer': '/jwplayer/player.swf',
'file': 'http://172.16.200.60/hls/test.flv',
'controlbar': 'bottom',

'width': '640',

'height': '360'

});

</script>

</body>

</html>

基于HTTP协议做直播
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Sample Player JWPlayer</title>

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

</head>

<body>

<h1>Sample Player JWPlayer</h1>

<div id='myElement'>This text will be replaced</div>

<script type='text/javascript'>

jwplayer('myElement').setup({

'flashplayer': '/jwplayer/player.swf',
levels:[

{file:"com"}

],

provider: "rtmp",

streamer: "rtmp://172.16.200.60/live",

'controlbar': 'bottom',

'width': '640',

'height': '360'

});

</script>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: