-
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
Update vjs.Component.addChild to allow an index #2534
Comments
#2477 is actually related to this one. It would make children an array, so a plugins could just manually insert itself in the children array before init. But also no, there isn't a way to specify that today. If you'd be interested in helping add the option, that'd be cool. I could see the third argument of addChild be the index where you want to splice the child in. |
most excellent @heff thanks for the feedback. I'd love to take a shot. |
I'd also be interested in this. |
Maybe a new |
+1 |
This is what I am currently doing. let control_bar = this.player.getChild('controlBar');
let chapter_button = control_bar.getChild('chaptersButton');
let chapter_thumbnail_menu_button = new ChapterThumbnailMenuButton();
// add component to end of control bar
control_bar.addChild(chapter_thumbnail_menu_button);
// move component
control_bar.el().insertBefore(chapter_thumbnail_menu_button.el(), chapter_button.el()); Hope this helps as an alternative. |
In 5.0 we also have a separator element you can use to insert before or after to make your components available on the right-ish or left-ish side of the control bar. |
This has landed by #2540 in 5.7! |
I'm trying to add "skip next" and "skip back" vjs.Buttons which are currently plugins that would be surrounding the Play button in the ControlBar Component.
the Component supports the addChild(child, [options]), but it would be nice to be able to inject a component at a specific index to help the re-arrangement in the DOM of controls that are rendered.
(my apologies if this is a FAQ)
The text was updated successfully, but these errors were encountered: