一、 首先要引入jquery 库
二、引入jwplayer.js (可以到官网下载或引用)
官网地址:http://www.longtailvideo.com/players/jw-flv-player/?search=Playlist
<div class="video">
<a id="mediaspace"></a>
<a id="mediaspace1"></a>
<a id="mediaspace2"></a>
</div>
function videoCon(a,b,c){
jwplayer(a).setup({
flashplayer: 'js/plugins/mediaplayer-5.7/player.swf', //player.swf 播放器路径
file: b, //视频路径地址(支持flv、mp3、mp4格式)
autostart:"false", //自动播放
image:c, //图片路径
streamer:"start",
type:"http",
width:"617",
height:"502",
controlbar:"bottom" //控制栏位置
})
}
videoCon("mediaspace","js/plugins/mediaplayer-5.7/video.mp4","images/img.jpg");
videoCon("mediaspace1","js/plugins/mediaplayer-5.7/video.mp4","images/img.jpg");
videoCon("mediaspace2","js/plugins/mediaplayer-5.7/video.mp4","images/img.jpg");
总结
现存在问题:
1.视频地址必须在服务器上才能播放,本地的链接地址不播放。