标签:flash 网页播放器 flowplayer jwplayer html5
本文继续上一篇文章,记录一些基于Flash的流媒体处理的例子。本文记录一些基于Flash技术的网页播放器。基于Flash的网页播放器相比于其他网页播放器来说最大的优势就是“免插件安装”了,这一点可以很大的提高用户的体验质量。早些时候网络视频(尤其是直播)一般都使用ActiveX控件作为视频播放器,而这些控件并不普及,所以终端用户必须下载相关的插件才能收看节目,因而对很多不熟悉电脑的用户造成了很大的障碍。直到Flash网页播放器的出现,这一障碍才得到了解决。本文将会记录几个常用的网页播放器,方便以后开发测试使用。
<html>
<head>
<script type="text/javascript" src="flowplayer-3.2.8.min.js"></script>
<title>Sample Player FlowPlayer</title>
</head>
<body>
<h1>Sample Player FlowPlayer</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<!-- this A tag is where your Flowplayer will be placed. it can be anywhere -->
<a
href="http://video-js.zencoder.com/oceans-clip.mp4"
style="display:block;width:520px;height:330px"
id="player">
</a>
<!-- this will install flowplayer inside previous A- tag. -->
<script>
flowplayer("player", "flowplayer-3.2.8.swf");
</script>
</body>
</html><!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="flowplayer-3.2.8.min.js"></script>
<title>RTMP Sample Player FlowPlayer</title>
</head>
<body>
<h1>RTMP Sample Player FlowPlayer</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<!-- this A tag is where your Flowplayer will be placed. it can be anywhere -->
<a
href="#"
style="display:block;width:520px;height:330px"
id="player">
</a>
<!-- this will install flowplayer inside previous A- tag. -->
<script>
flowplayer("player", "flowplayer-3.2.8.swf",{
clip: {
url: ‘hks‘,
provider: ‘rtmp‘,
live: true,
},
plugins: {
rtmp: {
url: ‘flowplayer.rtmp-3.2.8.swf‘,
netConnectionUrl: ‘rtmp://live.hkstv.hk.lxdns.com/live‘
}
}
});
</script>
<p>
Sample RTMP URL (Live) is "rtmp://live.hkstv.hk.lxdns.com/live/hks"
</p>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>Sample Player Videojs</title>
<!-- Chang URLs to wherever Video.js files will be hosted -->
<link href="video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="video.js"></script>
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
<script>
videojs.options.flash.swf = "video-js.swf";
</script>
</head>
<body>
<h1>Sample Player Videojs</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup="{}">
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type=‘video/mp4‘ />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type=‘video/webm‘ />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type=‘video/ogg‘ />
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track>
<track kind="subtitles" src="demo.captions.vtt" srclang="en" label="English"></track>
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>RTMP Sample Player Videojs</title>
<!-- Chang URLs to wherever Video.js files will be hosted -->
<link href="video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="video.js"></script>
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
<script>
videojs.options.flash.swf = "video-js.swf";
</script>
</head>
<body>
<h1>RTMP Sample Player Videojs</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="480" data-setup="{}">
<source src="rtmp://ams.studytv.cn/livepkgr/264" type="rtmp/flv"/>
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</body>
</html>JW Player官网:http://www.jwplayer.com
注:最新版的JW Player似乎不能免费使用RTMP播放功能了,这里使用的是旧版的JW Player
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample Player JWPlayer</title>
<script type=‘text/javascript‘ src=‘jwplayer.js‘></script>
</head>
<body>
<h1>Sample Player JWPlayer</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<div id=‘mediaspace‘>This text will be replaced</div>
<script type=‘text/javascript‘>
jwplayer(‘mediaspace‘).setup({
‘flashplayer‘: ‘player.swf‘,
‘file‘: ‘sintel.mp4‘,
‘controlbar‘: ‘bottom‘,
‘width‘: ‘640‘,
‘height‘: ‘360‘
});
</script>
</body>
</html><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>RTMP Sample Player JWPlayer</title>
<script type=‘text/javascript‘ src=‘jwplayer.js‘></script>
</head>
<body>
<h1>RTMP Sample Player JWPlayer</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<div id=‘mediaspace‘>This text will be replaced</div>
<script type=‘text/javascript‘>
jwplayer(‘mediaspace‘).setup({
‘flashplayer‘: ‘player.swf‘,
‘file‘: ‘flv‘,
‘streamer‘: ‘rtmp://wx.cnrmall.com/live‘,
‘controlbar‘: ‘bottom‘,
‘width‘: ‘640‘,
‘height‘: ‘360‘
});
</script>
<p>
Sample RTMP URL (Live) is "rtmp://wx.cnrmall.com/live/flv"
</p>
</body>
</html><!DOCTYPE HTML>
<html>
<head>
<title>HLS Sample Player Flowplayer</title>
<script type="text/javascript" src="flowplayer-3.2.12.min.js"></script>
<script type="text/javascript" src="flowplayer.ipad-3.2.12.min.js"></script>
</head>
<body>
<h1>HLS Sample Player Flowplayer</h1>
<p>Lei Xiaohua<br/>
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<!-- player container-->
<a style="display: block; width: 660px; height: 350px;" id="flashls_vod">
</a>
<!-- Flowplayer installation and configuration -->
<script type="text/javascript">
flowplayer("flashls_vod", "flowplayer.swf", {
// configure the required plugins
plugins: {
flashls: {
url: ‘flashlsFlowPlayer.swf‘,
}
},
clip: {
url: "http://stream.flowplayer.org/drive.m3u8",
//url: "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8",
//live: true,
urlResolvers: "flashls",
provider: "flashls"
}
}).ipad();
</script>
<p>
</p>
</body>
</html><!DOCTYPE HTML> <html> <head> <title>Video Player Html5</title> </head> <body> <h1>Video Player Html5</h1> <p>Lei Xiaohua<br/> <a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/> leixiaohua1020@126.com</p> <video src="sintel.mp4" controls="controls"> your browser does not support the video tag </video> </body> </html>
<!DOCTYPE HTML>
<html>
<head>
<title>ActiveX VLC Player</title>
</head>
<body>
<h1>ActiveX VLC Player</h1>
<p>Lei Xiaohua<br/>
<!-- To run this demo you should install VLC first -->
<a href="http://blog.csdn.net/leixiaohua1020">http://blog.csdn.net/leixiaohua1020</a><br/>
leixiaohua1020@126.com</p>
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width="640" height="480" id="vlc" events="True">
<!--<param name="Src" value="http://video-js.zencoder.com/oceans-clip.mp4" />-->
<!--<param name="Src" value="http://live.3gv.ifeng.com/live/CCTV13.m3u8" />-->
<!--<param name="Src" value="rtmp://live.hkstv.hk.lxdns.com/live/hks" />-->
<!--<param name="Src" value="mmst://media.shtv.net.cn/shtv" />-->
<param name="Src" value="rtsp://58.248.254.7:9135/live/ds-mmzh.sdp" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
</OBJECT>
</body>
</html>CSDN下载:http://download.csdn.net/detail/leixiaohua1020/8456499
最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
标签:flash 网页播放器 flowplayer jwplayer html5
原文地址:http://blog.csdn.net/leixiaohua1020/article/details/43936415