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:
Marvin Hagemeister 2016-01-27 21:27:58 +01:00
parent b8b611fbb6
commit 31a0eb8d14

View File

@ -21,7 +21,7 @@
// Browser globals (root is window)
root.plyr = factory(root, document);
}
}(this, function(window, document) {
}(typeof window !== 'undefined' ? window : this, function(window, document) {
'use strict';
/*global YT,$f*/