How to disable specific control in audio player HTML5

◇◆丶佛笑我妖孽 提交于 2019-12-02 13:01:12

问题


I just want to show the audio controls but prohibits the user to drag the button because I don't want the user to skip the song. How to make this work?


回答1:


You can't. You either show the browser's builtin controls, or you don't.

So what you should so is hide them and make your own (it should be easy if you don't want the seek functionality) or look at something like jPlayer (http://jplayer.org/) and hide the seek bar with CSS.




回答2:


It seems there's currently (August 2015) still no standard way to hide specific controls in a clean way. The best way to handle this is by using a library for this. E.g. one of these:

  • http://buzz.jaysalvat.com/
  • http://kolber.github.io/audiojs/
  • http://jplayer.org/
  • http://mediaelementjs.com/


来源:https://stackoverflow.com/questions/19090927/how-to-disable-specific-control-in-audio-player-html5

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