diff options
author | Sam Potts <sam@potts.es> | 2017-12-08 10:05:38 +0000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2017-12-08 10:05:38 +0000 |
commit | c8990bd379d97f4eb14cc35aaa90caebfb7db220 (patch) | |
tree | b6305ac793b3f012007feacb87f23b4918dfd48b /src/js/listeners.js | |
parent | de54929bb7bfb38e5720637846d1e7f5552cdc86 (diff) | |
download | plyr-c8990bd379d97f4eb14cc35aaa90caebfb7db220.tar.lz plyr-c8990bd379d97f4eb14cc35aaa90caebfb7db220.tar.xz plyr-c8990bd379d97f4eb14cc35aaa90caebfb7db220.zip |
IE & Edge fixes, Storage & Console classes
Diffstat (limited to 'src/js/listeners.js')
-rw-r--r-- | src/js/listeners.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/js/listeners.js b/src/js/listeners.js index 186dd70d..72f7d42f 100644 --- a/src/js/listeners.js +++ b/src/js/listeners.js @@ -6,7 +6,6 @@ import support from './support'; import utils from './utils'; import controls from './controls'; import fullscreen from './fullscreen'; -import storage from './storage'; import ui from './ui'; // Sniff out the browser @@ -53,7 +52,7 @@ const listeners = { // and if the focused element is not editable (e.g. text input) // and any that accept key input http://webaim.org/techniques/keyboard/ const focused = utils.getFocusElement(); - if (utils.is.htmlElement(focused) && utils.matches(focused, this.config.selectors.editable)) { + if (utils.is.element(focused) && utils.matches(focused, this.config.selectors.editable)) { return; } @@ -248,7 +247,7 @@ const listeners = { const wrapper = utils.getElement.call(this, `.${this.config.classNames.video}`); // Bail if there's no wrapper (this should never happen) - if (!utils.is.htmlElement(wrapper)) { + if (!utils.is.element(wrapper)) { return; } @@ -285,7 +284,7 @@ const listeners = { // Volume change utils.on(this.media, 'volumechange', () => { // Save to storage - storage.set.call(this, { volume: this.volume, muted: this.muted }); + this.storage.set({ volume: this.volume, muted: this.muted }); }); // Speed change @@ -294,7 +293,7 @@ const listeners = { controls.updateSetting.call(this, 'speed'); // Save to storage - storage.set.call(this, { speed: this.speed }); + this.storage.set({ speed: this.speed }); }); // Quality change @@ -303,7 +302,7 @@ const listeners = { controls.updateSetting.call(this, 'quality'); // Save to storage - storage.set.call(this, { quality: this.quality }); + this.storage.set({ quality: this.quality }); }); // Caption language change @@ -312,7 +311,7 @@ const listeners = { controls.updateSetting.call(this, 'captions'); // Save to storage - storage.set.call(this, { language: this.language }); + this.storage.set({ language: this.language }); }); // Captions toggle @@ -321,7 +320,7 @@ const listeners = { controls.updateSetting.call(this, 'captions'); // Save to storage - storage.set.call(this, { captions: this.captions.enabled }); + this.storage.set({ captions: this.captions.active }); }); // Proxy events to container @@ -462,7 +461,7 @@ const listeners = { // Current time invert // Only if one time element is used for both currentTime and duration - if (this.config.toggleInvert && !utils.is.htmlElement(this.elements.display.duration)) { + if (this.config.toggleInvert && !utils.is.element(this.elements.display.duration)) { utils.on(this.elements.display.currentTime, 'click', () => { // Do nothing if we're at the start if (this.currentTime === 0) { |