显示所有组件、倍速播放,全屏
var player = videojs("my-video", {
autoplay: 'play',
controlBar:{
// 设置 controlBar 选项为 true,显示所有控件
playToggle: true,
volumePanel: true,
currentTimeDisplay: true,
timeDivider: true,
durationDisplay: true,
// remainingTimeDisplay: true,
progressControl: true,
fullscreenToggle: true,
playbackRateMenuButton: true, // 倍速控件
remainingTimeDisplay:{
displayNegative:false,
},
},
preload:'none',
language: 'zh-CN',
sources:[
{
src:videourl,
type: 'video/mp4',
title:title
}
],
playbackRates: [0.5, 1,1.25, 1.5,1.75, 2],
fullscreen: 'fullscreen'
}, function () {
});
player.ready(function() {
this.requestFullscreen(); // 请求进入全屏模式
});
videojs.hook('beforesetup', function(videoEl, options) {
console.log("videoEl",videoEl);
console.log("options",options);
// options.autoplay = false;
return options;
});