-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I show current time, divider and duration using options? #8534
How do I show current time, divider and duration using options? #8534
Comments
👋 Thanks for opening your first issue here! 👋 If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
The following worked for me: {
controlBar: {
children: [
// ...other options
"currentTimeDisplay",
"timeDivider",
"durationDisplay",
"pictureInPictureToggle",
"playbackRateMenuButton",
"fullscreenToggle",
],
},
} |
May I ask if you have solved this problem now? I also encountered this problem, but I solved it through a simple method. I don't know if this method will cause a chain reaction, so I want to change the method |
Facing the same issue(((
Nor this
Only in the first case if I use |
## Description Time controls continue to cause confusion as they are included by default but hidden by default. e.g. #8534 Adding CSS to display them is not intuitive. ## Specific Changes proposed Changing the default styles would be problematic before a major version. This PR proposes adding an optional `vjs-normalise-time-controls` class a user can add to the player, as an opt in. This will default all time controls to being shown, except when live content is playing. Users would then have to remove the time controls in player options, or with `hide()` or `dispose()`. ## Requirements Checklist - [ ] Feature implemented / Bug fixed - [ ] If necessary, more likely in a feature request than a bug fix - [x] Change has been verified in an actual browser (Chrome, Firefox, IE) - [ ] Unit Tests updated or fixed - [ ] Docs/guides updated - [ ] Example created ([starter template on JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0)) - [ ] Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab) - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error - [ ] Reviewed by Two Core Contributors Co-authored-by: Adam Waldron <[email protected]>
Description
I tried several approaches, but it seems the only way to display current time, divider and duration is to override related rules in video-js.css. I can only hide full screen and PIP toggle using setup options or code as the code examples listed in Guides.
I found some code examples on Stack Overflow to show current time, divider and duration using setup options, but they didn't work.
Is there a way to show/hide/enable/disable every item on the control bar using options or code?
Reduced test case
https://jsfiddle.net/24a3ujeb/
Steps to reproduce
{ controlBar: { currentTimeDisplay: true } }
Errors
No response
What version of Video.js are you using?
8.8.0
Video.js plugins used.
None
What browser(s) including version(s) does this occur with?
Chrome 120.0.6099.129
What OS(es) and version(s) does this occur with?
Windows 11 Pro 23H2
The text was updated successfully, but these errors were encountered: