diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/js/plyr.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 57544997..24c6d76d 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,5 +1,6 @@ // ========================================================================== // Plyr +// plyr.js v1.5.15 // https://github.com/selz/plyr // License: The MIT License (MIT) // ========================================================================== @@ -2832,16 +2833,18 @@ // Custom event polyfill // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent (function () { + if (typeof window.CustomEvent === 'function') { + return false; + } + function CustomEvent (event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; - if(!('CustomEvent' in window)) { - window.CustomEvent = CustomEvent; - } + window.CustomEvent = CustomEvent; })(); |