aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-05-10 09:34:15 +1000
committerSam Potts <sam@potts.es>2018-05-10 09:34:15 +1000
commit765c01e83dc4173d778538061a82e1973a8574f0 (patch)
tree6b7ec7482135f6773378a3b736a2ba9abfa1cc2b /src
parent33a11fb53adff8716935755248e12a1597254233 (diff)
downloadplyr-765c01e83dc4173d778538061a82e1973a8574f0.tar.lz
plyr-765c01e83dc4173d778538061a82e1973a8574f0.tar.xz
plyr-765c01e83dc4173d778538061a82e1973a8574f0.zip
Remove references to window.Plyr
Diffstat (limited to 'src')
-rw-r--r--src/js/fullscreen.js2
-rw-r--r--src/js/utils.js15
2 files changed, 7 insertions, 10 deletions
diff --git a/src/js/fullscreen.js b/src/js/fullscreen.js
index cd2d8ac6..000ba706 100644
--- a/src/js/fullscreen.js
+++ b/src/js/fullscreen.js
@@ -19,7 +19,7 @@ function onChange() {
}
// Trigger an event
- utils.dispatchEvent(this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
+ utils.dispatchEvent.call(this.player, this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
// Trap focus in container
if (!browser.isIos) {
diff --git a/src/js/utils.js b/src/js/utils.js
index d46a7601..ebfb9c96 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -9,9 +9,6 @@ import { providers } from './types';
const utils = {
// Check variable types
is: {
- plyr(input) {
- return this.instanceof(input, window.Plyr);
- },
object(input) {
return this.getConstructor(input) === Object;
},
@@ -31,22 +28,22 @@ const utils = {
return !this.nullOrUndefined(input) && Array.isArray(input);
},
weakMap(input) {
- return this.instanceof(input, window.WeakMap);
+ return this.instanceof(input, WeakMap);
},
nodeList(input) {
- return this.instanceof(input, window.NodeList);
+ return this.instanceof(input, NodeList);
},
element(input) {
- return this.instanceof(input, window.Element);
+ return this.instanceof(input, Element);
},
textNode(input) {
return this.getConstructor(input) === Text;
},
event(input) {
- return this.instanceof(input, window.Event);
+ return this.instanceof(input, Event);
},
cue(input) {
- return this.instanceof(input, window.TextTrackCue) || this.instanceof(input, window.VTTCue);
+ return this.instanceof(input, TextTrackCue) || this.instanceof(input, VTTCue);
},
track(input) {
return this.instanceof(input, TextTrack) || (!this.nullOrUndefined(input) && this.string(input.kind));
@@ -547,7 +544,7 @@ const utils = {
const event = new CustomEvent(type, {
bubbles,
detail: Object.assign({}, detail, {
- plyr: utils.is.plyr(this) ? this : null,
+ plyr: this,
}),
});