-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Description
It seems that because when using the offset plugin, the Player prototype is overriden, it is not possible to have multiple videos on the page that use the plugin with the same version of VideoJs.
In order to fix this use case I had to fork the project and add the new functions directly on the player object. For example:
Player.prototype.currentTime = function(seconds) {
if (seconds !== undefined) {
return Player.__super__.currentTime
.call(this, seconds + this._offsetStart) - this._offsetStart;
}
return Player.__super__.currentTime
.apply(this, arguments) - this._offsetStart;
};
was transformed to:
this.currentTime = function(seconds) {
if (seconds !== undefined) {
return (
Player.prototype.currentTime.call(this, seconds + this._offsetStart) -
this._offsetStart
);
}
return (
Player.prototype.currentTime.apply(this, arguments) - this._offsetStart
);
};
I've made these changes half a year ago and didn't think it was necessary to create a pull request since it seemed that the project is not maintained anymore/is going in a different direction.
So my question is: Would such a change be useful or there were specific reasons why the __super__ prototype method was chosen?
It seems like this would solve the problem with having multiple videos on the page using the plugin.
Sorry for the rant and for not respecting the issue standard. I'm currently trying to understand whether I should try to contribute directly to this plugin or if the work should be done in parallel.