我想更改videojs v5控件布局,以便在vjs-control-bar
区域顶部制作一个全宽度进度条,类似于v5以前的播放器皮肤。如何制作全宽videojs v5进度条?
我应该如何继续?是否有必要修改ProgressControl
组件中的component structure tree,还是只能使用CSS来完成,现有的ProgressControl
组件?
我注意到,我可以把它放在上面,通过改变从flex
的vjs-progress-control
display
CSS属性block
,initial
或inline
但我不能将宽度设置为100%(其他ProgressControl组件宽度仍在考虑)。我认为这是因为vjs-progress-control
仍处于容器的弹性流动中。
编辑
我取得了一些进展。我可以用下面的CSS达到预期的效果:
.vjs-progress-control {
position: absolute;
bottom: 26px; /* The height of the ControlBar minus 4px. */
left: 0;
right: 0;
width: 100%;
height: 10px; /* the height must be reduced from 30 to 10px in order to allow the buttons below (e.g. play) to be pushed */
}
.vjs-progress-holder {/* needed to have a real 100% width display. */
margin-left: 0px;
margin-right: 0px;
}
除非你们其中一个人找到一种方法,使其更好,我将在此编辑为接受的答案时,将被允许。
我喜欢你的解决方案比接受的答案更好 - 少代码,它运作良好。其余的只是绒毛。 – Thomas
在课程名称前面缺少'.'。 – tmm1
@ tmm1我的坏!我只是修复它。 – Billybobbonnet