Skip to content
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

Unable to initialize plugins via options #2510

Closed
mmcc opened this issue Aug 24, 2015 · 3 comments
Closed

Unable to initialize plugins via options #2510

mmcc opened this issue Aug 24, 2015 · 3 comments
Milestone

Comments

@mmcc
Copy link
Member

mmcc commented Aug 24, 2015

Looks like at some point we lost the ability to initialize a plugin via the plugins options object. Using the plugins example in sandbox:

Works fine

progressed = function(options) {
  this.on('progress', function(e) {
    console.log(this.bufferedPercent());
  });
};

// register the plugin
videojs.plugin('progressed', progressed);

// initialize it
vid1 = videojs('vid1');
vid1.progressed();

Sadness

var progressed = function(options) {
    this.on('progress', function(e) {
    console.log(this.bufferedPercent());
  });
};

videojs.plugin('progressed', progressed);

var vid1 = videojs('vid1', { plugins: { progressed: true }});
// => Uncaught TypeError: Cannot assign to read only property 'playerOptions' of true
@mmcc mmcc added this to the v5.0.0 milestone Aug 24, 2015
@mmcc
Copy link
Member Author

mmcc commented Aug 24, 2015

Assuming this is associated with #1980, but need to confirm.

@heff
Copy link
Member

heff commented Aug 31, 2015

The issue is progressed: true. It expects an object for plugin options (not a boolean) and tries to add the player options to it. We probably broke it when we started passing playerOptions around.

heff added a commit to heff/video.js that referenced this issue Sep 1, 2015
...because it caused an error, and it actually creates an inconsistent
plugin init process, when considering plugins that are initialized
outside of the player init.

fixes videojs#2510
@heff
Copy link
Member

heff commented Sep 2, 2015

Closed by #2532

@heff heff closed this as completed Sep 2, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants