-
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
vjs.Component.trigger does not pass the event object to the registered listeners #1298
Comments
This seems to solve the problem in my development environment. vjs.Component.prototype.trigger = function(type, event){
if (event){
event.type = type;
vjs.trigger(this.el_, event);
} else {
vjs.trigger(this.el_, type, event);
}
return this;
};
|
component.trigger passing three arguments to a function that takes two is definitely wrong. What vjs.trigger expects is for the second argument to either be a string (the event type) or an event object with a type attribute. There's no cases where both a type string and an event object should be needed. What should happen here is that Does that make sense, and would that clear up your issue? If so would you want to make a quick pull request to fix that? |
Done! I just fixed it and submitted a pull request. |
Fixed via #1310. Thanks for the PR! |
I was trying to use the player component as the "event bus/emitter" in my application and pass an event object from Plugin A to Plugin B. So I did the following:
If you look to the videojs source code, it seemed like the event object is dropped when calling vjs.trigger. see snipped below.
The text was updated successfully, but these errors were encountered: