-
Notifications
You must be signed in to change notification settings - Fork 104
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
This plugin is not compatible with Video.js 8 #108
Comments
@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, |
@dangngocbinh you are awesome man! |
Hi @PI3RRE01 please could you open a PR for this? Your fork works perfectly! Thanks. |
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);
The text was updated successfully, but these errors were encountered: