网盘:https://pan.baidu.com/s/1mmtppZSFOni5tLI2TJWKrw

<script type="text/javascript">
var thePlayer; //保存当前播放器以便操作
$(function () {
thePlayer = jwplayer('container').setup({
flashplayer: 'js/plugins/mediaplayer-5.7/player.swf',
file: 'js/plugins/mediaplayer-5.7/video.mp4',
width: ,
height: ,
dock: false
}); //播放 暂停
$('.player-play').click(function () {
if (thePlayer.getState() != 'PLAYING') {
thePlayer.play(true);
this.value = '暂停';
} else {
thePlayer.play(false);
this.value = '播放';
}
}); //停止
$('.player-stop').click(function () { thePlayer.stop(); }); //获取状态
$('.player-status').click(function () {
var state = thePlayer.getState();
var msg;
switch (state) {
case 'BUFFERING':
msg = '加载中';
break;
case 'PLAYING':
msg = '正在播放';
break;
case 'PAUSED':
msg = '暂停';
break;
case 'IDLE':
msg = '停止';
break;
}
alert(msg);
}); //获取播放进度
$('.player-current').click(function () { alert(thePlayer.getPosition()); }); //跳转到指定位置播放
$('.player-goto').click(function () {
if (thePlayer.getState() != 'PLAYING') { //若当前未播放,先启动播放器
thePlayer.play();
}
thePlayer.seek(); //从指定位置开始播放(单位:秒)
}); //获取视频长度
$('.player-length').click(function () { alert(thePlayer.getDuration()); });
});
</script>
04-27 23:00