Get the proper window reference on initialization.
The previous code assumed that `this` points to the browsers window object, which is not the case when using a module bundler. So we check for the variable `window` first, before falling back to `this`. (taken from jQuery's codebase)
This commit is contained in:
parent
b8b611fbb6
commit
31a0eb8d14
@ -21,7 +21,7 @@
|
|||||||
// Browser globals (root is window)
|
// Browser globals (root is window)
|
||||||
root.plyr = factory(root, document);
|
root.plyr = factory(root, document);
|
||||||
}
|
}
|
||||||
}(this, function(window, document) {
|
}(typeof window !== 'undefined' ? window : this, function(window, document) {
|
||||||
'use strict';
|
'use strict';
|
||||||
/*global YT,$f*/
|
/*global YT,$f*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user