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

Transition to array children broke adding children via options object #2767

Closed
gkatsev opened this issue Nov 2, 2015 · 2 comments
Closed
Assignees

Comments

@gkatsev
Copy link
Member

gkatsev commented Nov 2, 2015

For, example, if you want to switch the volumeMenuButton for the old muteToggle and volumeControl, you could previously do

videojs('player', {
  controlBar: {
    volumeMenuButton: false,
    muteToggle: {},
    volumeControl: {}
  }
});

However, now, the control bar will only loop through its children array to look for items. This means that the volumeMenuButton will get disabled correctly but it won't actually add muteToggle and volumeControl because it isn't in the list of items it's going through.

We probably should loop through the items in the array but also loop through the options object to make sure whether we need to add any other components.
https://github.com/videojs/video.js/blob/master/src/js/component.js#L490

@misteroneill
Copy link
Member

Makes sense to me. 👍

To be more clear to anyone else reading this; it's about adding new children that are not in the children array for a component (in this case, the controlBar component has the volumeMenuButton in its children, but not the muteToggle or volumeControl).

@gkatsev gkatsev self-assigned this Nov 2, 2015
@gkatsev
Copy link
Member Author

gkatsev commented Nov 2, 2015

I have a tentative fix locally but I'll want to consolidate some of the checks before PRing it.

@gkatsev gkatsev closed this as completed in 5d754c9 Nov 6, 2015
@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

2 participants