Videojs add only play control

后端 未结 5 745
情深已故
情深已故 2021-02-04 21:03

I am using Video.js to play videos in my web page. I want to customize player controls to only play button.

my code is



        
5条回答
  •  鱼传尺愫
    2021-02-04 21:55

    The easiest way I have found is modifying the prototype for the class as such.

    Insert

    
    

    right after

    
    

    This will remove every control ( including the duration, time remaining and seek bar ) besides the play toggle button

    If you would like other things, you may pick and choose from the defaults (a few of these are set to hidden on the default skin)

    options: {
        components: {
            "playToggle": {},
            "fullscreenToggle": {},
            "currentTimeDisplay": {},
            "timeDivider": {},
            "durationDisplay": {},
            "remainingTimeDisplay": {},
            "progressControl": {},
            "volumeControl": {},
            "muteToggle": {}
        }
    }
    

    Or dig through the controls.js file on git hub https://github.com/zencoder/video-js/blob/master/src/controls.js

提交回复
热议问题