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

Not able to access controlBar component options #3095

Closed
shroy opened this issue Feb 9, 2016 · 8 comments
Closed

Not able to access controlBar component options #3095

shroy opened this issue Feb 9, 2016 · 8 comments

Comments

@shroy
Copy link

shroy commented Feb 9, 2016

I am unable to access the controlBar component options, yet my standard options (controls, autoplay, preload) are working just fine. I'm running Rails, and Coffeescript. The code is following the documentation.

  player = videojs "media-video",
    controls: true
    autoplay: false
    preload: "auto"
    controlBar:
      muteToggle: false
      progressControl:
        seekBar:
          seekHandle: false
  , ->
    console.log "Good to go!"

    @on "ended", ->
      console.log "awww...over so soon?"
@gkatsev
Copy link
Member

gkatsev commented Feb 9, 2016

Can you elaborate on what you mean by not being able to access control component options?
What are you seeing vs what are you expecting to see? A live reduced test case, on a site like jsfiddle or jsbin, is super helpful.

@shroy
Copy link
Author

shroy commented Feb 9, 2016

I was experimenting with the controlBar component options by first disabling the muteToggle as the docs specify. I receive no errors and absolutely nothing changes with the player itself. I am still able to toggle the mute button. Eventually I will need to disable the user from interacting with the seekHandle.

Here is a jsbin..
http://jsbin.com/nuvipucamu/edit?html,js,console,output

@hartman
Copy link
Contributor

hartman commented Feb 10, 2016

@shroy the problem is that muteToggle is not a control that is present by default in the controlBar since VideoJS 5.0. It was replace with the volumeMenuButton control. The true/false that you are setting is a visibility control and not a 'presence' control.

In the following jsbin, I have specifically configured which children should be in the controlbar, including the muteToggle:
http://jsbin.com/rufocifeho/1/edit?html,js,console,output
You will notice the presence of the control (and the missing volume slider). Now if you add muteToggle: false to that one, you will see that this flips the visibility and the muteToggle is hidden.

It's a bit confusing to figure out from the documentation and there is a request to improve that documentation in ticket #2932

@gkatsev
Copy link
Member

gkatsev commented Feb 10, 2016

@hartman thanks for your reply.

@gkatsev gkatsev closed this as completed Feb 10, 2016
@shroy
Copy link
Author

shroy commented Feb 10, 2016

Thank you @hartman . Is there a way to disable seeking while still having the progress bar present on the player?

@hartman
Copy link
Contributor

hartman commented Feb 10, 2016

@shroy not easily. There doesn't seem to be a provision for disabling or cancelling seeking in the html5 video specification. There also is no option for the video.js custom controls to prevent this as far as I can determine.

The only suggestions I can find for something like this is to continuously record the current time during playback from timeupdate functions, and then after seeking, seek back to the position 'before' seeking.

@gkatsev
Copy link
Member

gkatsev commented Feb 10, 2016

You could use pointer-events: none on the progress control to prevent clicks. This won't prevent users from seeking programmatically but should take care of the majority of cases on the majority of browsers.

@shroy
Copy link
Author

shroy commented Feb 10, 2016

Ok great. Thanks @gkatsev and @hartman

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants