通过Eclipse新建动态web工程hello,从http://download.csdn.net/detail/lotusyangjun/6848295 下载flvplayer.swf和swfobject.js两个文件,放到hello工程的WebContent下面,目录结构如下图所示:说明:1.flv为视频文件
index.jsp代码如下:
<head></head>
<body>
<div id="flash5">
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var s5 = new SWFObject("flvplayer.swf","mediaplayer","800","600","8");
s5.addParam("allowfullscreen","true");
s5.addVariable("width","800");
s5.addVariable("height","600");
s5.addVariable("file","1.flv"); //文件名
s5.addVariable("backcolor","0xFFFFFF");
s5.addVariable("frontcolor","0x546E00");
s5.addVariable("autostart","true");
s5.write("flash5");
</script>
</div>
</body>