My question is how to add new components(control buttons) on video.js player.
For example, adding a button to allow to change the video playback rate.
Giving a simple example would be much helpful. Thank you very much.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t appear VideoJS Supports playback-rate directly, but from my understanding it’s just a fancy wrapper for an HTML5 Video Element.
According to this stack overflow question/answer you can change the playback rate of HTML5 video directly on the DOM Element as referenced by the W3C HTML5 Video Wiki Entry.
You probably will have to side-step VideoJS to do this as the support doesn’t look baked in. Also, there may be issues between browsers over support of this attribute.
As for simply adding controls, VideoJS implements a Javascript API you can use to control the element but it seems pretty limited to the most basic of controls (play/pause/goto/fullscreen/etc…)
The default controls the player has don’t seem to be greatly customizable so if you wish to provide a clearer experience, you can probably disable the in-video controls and re-implement your own in html/dom/js underneath the video element.
Example:
With some really simple html & Javascript, you can wire up some simple controls.
HTML:
JS: