disable mouse interaction on videojs scrubber

做~自己de王妃 提交于 2019-12-12 02:43:51

问题


Does anyone know how to disable mouse interaction on the progress bar (the 'scrubber') of the videojs default skin ?

I want to show it - it's usefull - but since my video's are inside a 'transform:scale', the mouse interaction, dragging and clicking, is incorrect. See a jsbin here http://jsbin.com/qovayule/1/edit

I gave up on trying to fix the mouse interaction - its a browser thing, not a videojs thing. See the issue I committed to videojs here: https://github.com/videojs/video.js/issues/1102

But if i can just disable mouse interaction on the progress bar, and hide the volume slider, the client is probably happy.


回答1:


From the github tracker, i got this suggestion. Seems to work very nice:

/* these elements are problematic with transform:scale */
.scaledstuff .vjs-progress-control { pointer-events:none; }
.scaledstuff .vjs-progress-control:before {
    background-color: rgb(0, 0, 0); content: '';
    height: 100%; width: 100%; pointer-events: auto;
}
.scaledstuff .vjs-volume-control { display:none; }

/* but work fullscreen */
.scaledstuff .vjs-fullscreen .vjs-progress-control { pointer-events:auto; }
.scaledstuff .vjs-fullscreen .vjs-progress-control:before { display:none; }
.scaledstuff .vjs-fullscreen .vjs-volume-control { display:block; }


来源:https://stackoverflow.com/questions/22562556/disable-mouse-interaction-on-videojs-scrubber

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!