Skip to content
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

Open
vinixwu opened this issue Dec 28, 2023 · 2 comments
Open

How do I show current time, divider and duration using options? #8534

vinixwu opened this issue Dec 28, 2023 · 2 comments
Labels
needs: triage This issue needs to be reviewed

Comments

@vinixwu
Copy link

vinixwu commented Dec 28, 2023

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

  1. Setup video.js using options like { controlBar: { currentTimeDisplay: true } }
  2. The player didn't show current time.

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

@vinixwu vinixwu added the needs: triage This issue needs to be reviewed label Dec 28, 2023
Copy link

welcome bot commented Dec 28, 2023

👋 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.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@bonniesimon
Copy link

The following worked for me:

{
  controlBar: {
    children: [
      // ...other options
      "currentTimeDisplay",
      "timeDivider",
      "durationDisplay",
      "pictureInPictureToggle",
      "playbackRateMenuButton",
      "fullscreenToggle",
    ],
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage This issue needs to be reviewed
Projects
None yet
Development

No branches or pull requests

2 participants