Open dangngocbinh opened 11 months ago
@dangngocbinh I cannot make this work with videojs 8
can you update the demo here?
@aproni34f yes, i update demo at this link: https://jsfiddle.net/enu2jLd8/
H, Bellow a fork that update videojs plugin template. It was tested with VJS 8.6.1 using standard JS file importation in html page.
@dangngocbinh you are awesome man!
Hi @PI3RRE01 please could you open a PR for this? Your fork works perfectly! Thanks.
H, Bellow a fork that update videojs plugin template. It was tested with VJS 8.6.1 using standard JS file importation in html page.
Hi. how to use your library using npm? thanks
Issue resolved in #109
This plugin is not compatible with Video.js 8 due to changes in Video.js's component extension mechanism. To make it compatible, you should replace
ConcreteButton
andConcreteMenuItem
with theextend
method as follows: const ButtonComponent = videojs.getComponent("MenuButton");class ConcreteButton extends ButtonComponent { constructor(player, options) { super(player, options); }
createItems() { return []; }
createMenu() { var menu = new VideoJsMenuClass(this.player_, { menuButton: this });
} }
videojs.registerComponent("ConcreteButton", ConcreteButton);
const MenuComponent = videojs.getComponent("MenuItem"); class ConcreteMenuItem extends MenuComponent { constructor(player, item, qualityButton, plugin) { super(player, item); this.item = item; this.qualityButton = qualityButton; this.plugin = plugin; }
handleClick() { for (var i = 0; i < this.qualityButton.items.length; ++i) { this.qualityButton.items[i].selected(false); } this.plugin.setQuality(this.item.value); this.selected(true); } }
videojs.registerComponent("ConcreteMenuItem", ConcreteMenuItem);