videoJS如何用
一,Web视频播放器插件
var player = videojs('videoID',{
controls: true, //控制条
preload: 'none', //是否自动加载
width: '640',
height: '264',
poster: 'media/poster.jpg',
sources: [
{src: 'media/001.mp4',type: 'video/mp4'}
]
},function(){
var that = this;
that.on('pause',function(){
old_time = this.currentTime();
console.log('pause:' + old_time);
})
that.on('play',function(){
new_time = this.currentTime();
console.log('playing:' + this.currentTime());
})
that.on('seeked',function(){
new_time = this.currentTime();
console.log('seeked:' + this.currentTime());
if (old_time) {
console.log(new_time > old_time ? '拖动快进' : '拖动后退');
}
})
that.on('ended',function(){
console.log('ended:'+ this.currentTime());
console.log('duration:' + this.duration());
})
})