I've added two custom buttons (for custom chapter navigation) and later in my code I want to delete/hide them. But using the removeChild() only remove one of the two (even by doing it twice)
Adding them work great but it's really the removing where I'm getting in troubles.
This is what I've tried but I can't delete both
var nextChapButton = myPlayer.controlBar.addChild("button",{}, 1);
var nextChapButtonDom = nextChapButton.el();
nextChapButtonDom.innerHTML = ">>";
var prevChapButton = myPlayer.controlBar.addChild("button",{}, 0);
var prevChapButtonDom = prevChapButton.el();
prevChapButtonDom.innerHTML = "<<";
myPlayer.controlBar.removeChild("Button");
//even doing it twice the ">>" button remains
myPlayer.controlBar.removeChild("Button");
And I cant declare "button" and "button2" to differenciate them or I get the following error because it's not videojs a component
Uncaught Error: Component Button2 does not exist
at ControlBar.addChild (video.js:3525)
at loadVideo (load.js:261)
at loadPage (load.js:196)
at startConfig (load.js:171)
at HTMLButtonElement.onclick (load.html:114)