[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/js/mediaelement/ -> mediaelement.js (source)

   1  /*!
   2   * MediaElement.js
   3   * http://www.mediaelementjs.com/
   4   *
   5   * Wrapper that mimics native HTML5 MediaElement (audio and video)
   6   * using a variety of technologies (pure JavaScript, Flash, iframe)
   7   *
   8   * Copyright 2010-2017, John Dyer (http://j.hn/)
   9   * License: MIT
  10   *
  11   */(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
  12  
  13  },{}],2:[function(_dereq_,module,exports){
  14  (function (global){
  15  var topLevel = typeof global !== 'undefined' ? global :
  16      typeof window !== 'undefined' ? window : {}
  17  var minDoc = _dereq_(1);
  18  
  19  var doccy;
  20  
  21  if (typeof document !== 'undefined') {
  22      doccy = document;
  23  } else {
  24      doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
  25  
  26      if (!doccy) {
  27          doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
  28      }
  29  }
  30  
  31  module.exports = doccy;
  32  
  33  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  34  },{"1":1}],3:[function(_dereq_,module,exports){
  35  (function (global){
  36  var win;
  37  
  38  if (typeof window !== "undefined") {
  39      win = window;
  40  } else if (typeof global !== "undefined") {
  41      win = global;
  42  } else if (typeof self !== "undefined"){
  43      win = self;
  44  } else {
  45      win = {};
  46  }
  47  
  48  module.exports = win;
  49  
  50  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  51  },{}],4:[function(_dereq_,module,exports){
  52  // shim for using process in browser
  53  var process = module.exports = {};
  54  
  55  // cached from whatever global is present so that test runners that stub it
  56  // don't break things.  But we need to wrap it in a try catch in case it is
  57  // wrapped in strict mode code which doesn't define any globals.  It's inside a
  58  // function because try/catches deoptimize in certain engines.
  59  
  60  var cachedSetTimeout;
  61  var cachedClearTimeout;
  62  
  63  function defaultSetTimout() {
  64      throw new Error('setTimeout has not been defined');
  65  }
  66  function defaultClearTimeout () {
  67      throw new Error('clearTimeout has not been defined');
  68  }
  69  (function () {
  70      try {
  71          if (typeof setTimeout === 'function') {
  72              cachedSetTimeout = setTimeout;
  73          } else {
  74              cachedSetTimeout = defaultSetTimout;
  75          }
  76      } catch (e) {
  77          cachedSetTimeout = defaultSetTimout;
  78      }
  79      try {
  80          if (typeof clearTimeout === 'function') {
  81              cachedClearTimeout = clearTimeout;
  82          } else {
  83              cachedClearTimeout = defaultClearTimeout;
  84          }
  85      } catch (e) {
  86          cachedClearTimeout = defaultClearTimeout;
  87      }
  88  } ())
  89  function runTimeout(fun) {
  90      if (cachedSetTimeout === setTimeout) {
  91          //normal enviroments in sane situations
  92          return setTimeout(fun, 0);
  93      }
  94      // if setTimeout wasn't available but was latter defined
  95      if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  96          cachedSetTimeout = setTimeout;
  97          return setTimeout(fun, 0);
  98      }
  99      try {
 100          // when when somebody has screwed with setTimeout but no I.E. maddness
 101          return cachedSetTimeout(fun, 0);
 102      } catch(e){
 103          try {
 104              // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
 105              return cachedSetTimeout.call(null, fun, 0);
 106          } catch(e){
 107              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
 108              return cachedSetTimeout.call(this, fun, 0);
 109          }
 110      }
 111  
 112  
 113  }
 114  function runClearTimeout(marker) {
 115      if (cachedClearTimeout === clearTimeout) {
 116          //normal enviroments in sane situations
 117          return clearTimeout(marker);
 118      }
 119      // if clearTimeout wasn't available but was latter defined
 120      if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
 121          cachedClearTimeout = clearTimeout;
 122          return clearTimeout(marker);
 123      }
 124      try {
 125          // when when somebody has screwed with setTimeout but no I.E. maddness
 126          return cachedClearTimeout(marker);
 127      } catch (e){
 128          try {
 129              // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
 130              return cachedClearTimeout.call(null, marker);
 131          } catch (e){
 132              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
 133              // Some versions of I.E. have different rules for clearTimeout vs setTimeout
 134              return cachedClearTimeout.call(this, marker);
 135          }
 136      }
 137  
 138  
 139  
 140  }
 141  var queue = [];
 142  var draining = false;
 143  var currentQueue;
 144  var queueIndex = -1;
 145  
 146  function cleanUpNextTick() {
 147      if (!draining || !currentQueue) {
 148          return;
 149      }
 150      draining = false;
 151      if (currentQueue.length) {
 152          queue = currentQueue.concat(queue);
 153      } else {
 154          queueIndex = -1;
 155      }
 156      if (queue.length) {
 157          drainQueue();
 158      }
 159  }
 160  
 161  function drainQueue() {
 162      if (draining) {
 163          return;
 164      }
 165      var timeout = runTimeout(cleanUpNextTick);
 166      draining = true;
 167  
 168      var len = queue.length;
 169      while(len) {
 170          currentQueue = queue;
 171          queue = [];
 172          while (++queueIndex < len) {
 173              if (currentQueue) {
 174                  currentQueue[queueIndex].run();
 175              }
 176          }
 177          queueIndex = -1;
 178          len = queue.length;
 179      }
 180      currentQueue = null;
 181      draining = false;
 182      runClearTimeout(timeout);
 183  }
 184  
 185  process.nextTick = function (fun) {
 186      var args = new Array(arguments.length - 1);
 187      if (arguments.length > 1) {
 188          for (var i = 1; i < arguments.length; i++) {
 189              args[i - 1] = arguments[i];
 190          }
 191      }
 192      queue.push(new Item(fun, args));
 193      if (queue.length === 1 && !draining) {
 194          runTimeout(drainQueue);
 195      }
 196  };
 197  
 198  // v8 likes predictible objects
 199  function Item(fun, array) {
 200      this.fun = fun;
 201      this.array = array;
 202  }
 203  Item.prototype.run = function () {
 204      this.fun.apply(null, this.array);
 205  };
 206  process.title = 'browser';
 207  process.browser = true;
 208  process.env = {};
 209  process.argv = [];
 210  process.version = ''; // empty string to avoid regexp issues
 211  process.versions = {};
 212  
 213  function noop() {}
 214  
 215  process.on = noop;
 216  process.addListener = noop;
 217  process.once = noop;
 218  process.off = noop;
 219  process.removeListener = noop;
 220  process.removeAllListeners = noop;
 221  process.emit = noop;
 222  process.prependListener = noop;
 223  process.prependOnceListener = noop;
 224  
 225  process.listeners = function (name) { return [] }
 226  
 227  process.binding = function (name) {
 228      throw new Error('process.binding is not supported');
 229  };
 230  
 231  process.cwd = function () { return '/' };
 232  process.chdir = function (dir) {
 233      throw new Error('process.chdir is not supported');
 234  };
 235  process.umask = function() { return 0; };
 236  
 237  },{}],5:[function(_dereq_,module,exports){
 238  (function (setImmediate){
 239  (function (root) {
 240  
 241    // Store setTimeout reference so promise-polyfill will be unaffected by
 242    // other code modifying setTimeout (like sinon.useFakeTimers())
 243    var setTimeoutFunc = setTimeout;
 244  
 245    function noop() {}
 246    
 247    // Polyfill for Function.prototype.bind
 248    function bind(fn, thisArg) {
 249      return function () {
 250        fn.apply(thisArg, arguments);
 251      };
 252    }
 253  
 254    function Promise(fn) {
 255      if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
 256      if (typeof fn !== 'function') throw new TypeError('not a function');
 257      this._state = 0;
 258      this._handled = false;
 259      this._value = undefined;
 260      this._deferreds = [];
 261  
 262      doResolve(fn, this);
 263    }
 264  
 265    function handle(self, deferred) {
 266      while (self._state === 3) {
 267        self = self._value;
 268      }
 269      if (self._state === 0) {
 270        self._deferreds.push(deferred);
 271        return;
 272      }
 273      self._handled = true;
 274      Promise._immediateFn(function () {
 275        var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
 276        if (cb === null) {
 277          (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
 278          return;
 279        }
 280        var ret;
 281        try {
 282          ret = cb(self._value);
 283        } catch (e) {
 284          reject(deferred.promise, e);
 285          return;
 286        }
 287        resolve(deferred.promise, ret);
 288      });
 289    }
 290  
 291    function resolve(self, newValue) {
 292      try {
 293        // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
 294        if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
 295        if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
 296          var then = newValue.then;
 297          if (newValue instanceof Promise) {
 298            self._state = 3;
 299            self._value = newValue;
 300            finale(self);
 301            return;
 302          } else if (typeof then === 'function') {
 303            doResolve(bind(then, newValue), self);
 304            return;
 305          }
 306        }
 307        self._state = 1;
 308        self._value = newValue;
 309        finale(self);
 310      } catch (e) {
 311        reject(self, e);
 312      }
 313    }
 314  
 315    function reject(self, newValue) {
 316      self._state = 2;
 317      self._value = newValue;
 318      finale(self);
 319    }
 320  
 321    function finale(self) {
 322      if (self._state === 2 && self._deferreds.length === 0) {
 323        Promise._immediateFn(function() {
 324          if (!self._handled) {
 325            Promise._unhandledRejectionFn(self._value);
 326          }
 327        });
 328      }
 329  
 330      for (var i = 0, len = self._deferreds.length; i < len; i++) {
 331        handle(self, self._deferreds[i]);
 332      }
 333      self._deferreds = null;
 334    }
 335  
 336    function Handler(onFulfilled, onRejected, promise) {
 337      this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
 338      this.onRejected = typeof onRejected === 'function' ? onRejected : null;
 339      this.promise = promise;
 340    }
 341  
 342    /**
 343     * Take a potentially misbehaving resolver function and make sure
 344     * onFulfilled and onRejected are only called once.
 345     *
 346     * Makes no guarantees about asynchrony.
 347     */
 348    function doResolve(fn, self) {
 349      var done = false;
 350      try {
 351        fn(function (value) {
 352          if (done) return;
 353          done = true;
 354          resolve(self, value);
 355        }, function (reason) {
 356          if (done) return;
 357          done = true;
 358          reject(self, reason);
 359        });
 360      } catch (ex) {
 361        if (done) return;
 362        done = true;
 363        reject(self, ex);
 364      }
 365    }
 366  
 367    Promise.prototype['catch'] = function (onRejected) {
 368      return this.then(null, onRejected);
 369    };
 370  
 371    Promise.prototype.then = function (onFulfilled, onRejected) {
 372      var prom = new (this.constructor)(noop);
 373  
 374      handle(this, new Handler(onFulfilled, onRejected, prom));
 375      return prom;
 376    };
 377  
 378    Promise.all = function (arr) {
 379      var args = Array.prototype.slice.call(arr);
 380  
 381      return new Promise(function (resolve, reject) {
 382        if (args.length === 0) return resolve([]);
 383        var remaining = args.length;
 384  
 385        function res(i, val) {
 386          try {
 387            if (val && (typeof val === 'object' || typeof val === 'function')) {
 388              var then = val.then;
 389              if (typeof then === 'function') {
 390                then.call(val, function (val) {
 391                  res(i, val);
 392                }, reject);
 393                return;
 394              }
 395            }
 396            args[i] = val;
 397            if (--remaining === 0) {
 398              resolve(args);
 399            }
 400          } catch (ex) {
 401            reject(ex);
 402          }
 403        }
 404  
 405        for (var i = 0; i < args.length; i++) {
 406          res(i, args[i]);
 407        }
 408      });
 409    };
 410  
 411    Promise.resolve = function (value) {
 412      if (value && typeof value === 'object' && value.constructor === Promise) {
 413        return value;
 414      }
 415  
 416      return new Promise(function (resolve) {
 417        resolve(value);
 418      });
 419    };
 420  
 421    Promise.reject = function (value) {
 422      return new Promise(function (resolve, reject) {
 423        reject(value);
 424      });
 425    };
 426  
 427    Promise.race = function (values) {
 428      return new Promise(function (resolve, reject) {
 429        for (var i = 0, len = values.length; i < len; i++) {
 430          values[i].then(resolve, reject);
 431        }
 432      });
 433    };
 434  
 435    // Use polyfill for setImmediate for performance gains
 436    Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
 437      function (fn) {
 438        setTimeoutFunc(fn, 0);
 439      };
 440  
 441    Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
 442      if (typeof console !== 'undefined' && console) {
 443        console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
 444      }
 445    };
 446  
 447    /**
 448     * Set the immediate function to execute callbacks
 449     * @param fn {function} Function to execute
 450     * @deprecated
 451     */
 452    Promise._setImmediateFn = function _setImmediateFn(fn) {
 453      Promise._immediateFn = fn;
 454    };
 455  
 456    /**
 457     * Change the function to execute on unhandled rejection
 458     * @param {function} fn Function to execute on unhandled rejection
 459     * @deprecated
 460     */
 461    Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
 462      Promise._unhandledRejectionFn = fn;
 463    };
 464    
 465    if (typeof module !== 'undefined' && module.exports) {
 466      module.exports = Promise;
 467    } else if (!root.Promise) {
 468      root.Promise = Promise;
 469    }
 470  
 471  })(this);
 472  
 473  }).call(this,_dereq_(6).setImmediate)
 474  },{"6":6}],6:[function(_dereq_,module,exports){
 475  (function (setImmediate,clearImmediate){
 476  var nextTick = _dereq_(4).nextTick;
 477  var apply = Function.prototype.apply;
 478  var slice = Array.prototype.slice;
 479  var immediateIds = {};
 480  var nextImmediateId = 0;
 481  
 482  // DOM APIs, for completeness
 483  
 484  exports.setTimeout = function() {
 485    return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
 486  };
 487  exports.setInterval = function() {
 488    return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
 489  };
 490  exports.clearTimeout =
 491  exports.clearInterval = function(timeout) { timeout.close(); };
 492  
 493  function Timeout(id, clearFn) {
 494    this._id = id;
 495    this._clearFn = clearFn;
 496  }
 497  Timeout.prototype.unref = Timeout.prototype.ref = function() {};
 498  Timeout.prototype.close = function() {
 499    this._clearFn.call(window, this._id);
 500  };
 501  
 502  // Does not start the time, just sets up the members needed.
 503  exports.enroll = function(item, msecs) {
 504    clearTimeout(item._idleTimeoutId);
 505    item._idleTimeout = msecs;
 506  };
 507  
 508  exports.unenroll = function(item) {
 509    clearTimeout(item._idleTimeoutId);
 510    item._idleTimeout = -1;
 511  };
 512  
 513  exports._unrefActive = exports.active = function(item) {
 514    clearTimeout(item._idleTimeoutId);
 515  
 516    var msecs = item._idleTimeout;
 517    if (msecs >= 0) {
 518      item._idleTimeoutId = setTimeout(function onTimeout() {
 519        if (item._onTimeout)
 520          item._onTimeout();
 521      }, msecs);
 522    }
 523  };
 524  
 525  // That's not how node.js implements it but the exposed api is the same.
 526  exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
 527    var id = nextImmediateId++;
 528    var args = arguments.length < 2 ? false : slice.call(arguments, 1);
 529  
 530    immediateIds[id] = true;
 531  
 532    nextTick(function onNextTick() {
 533      if (immediateIds[id]) {
 534        // fn.call() is faster so we optimize for the common use-case
 535        // @see http://jsperf.com/call-apply-segu
 536        if (args) {
 537          fn.apply(null, args);
 538        } else {
 539          fn.call(null);
 540        }
 541        // Prevent ids from leaking
 542        exports.clearImmediate(id);
 543      }
 544    });
 545  
 546    return id;
 547  };
 548  
 549  exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
 550    delete immediateIds[id];
 551  };
 552  }).call(this,_dereq_(6).setImmediate,_dereq_(6).clearImmediate)
 553  },{"4":4,"6":6}],7:[function(_dereq_,module,exports){
 554  'use strict';
 555  
 556  Object.defineProperty(exports, "__esModule", {
 557      value: true
 558  });
 559  
 560  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
 561  
 562  var _mejs = _dereq_(9);
 563  
 564  var _mejs2 = _interopRequireDefault(_mejs);
 565  
 566  var _en = _dereq_(11);
 567  
 568  var _general = _dereq_(20);
 569  
 570  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 571  
 572  var i18n = { lang: 'en', en: _en.EN };
 573  
 574  i18n.language = function () {
 575      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
 576          args[_key] = arguments[_key];
 577      }
 578  
 579      if (args !== null && args !== undefined && args.length) {
 580  
 581          if (typeof args[0] !== 'string') {
 582              throw new TypeError('Language code must be a string value');
 583          }
 584  
 585          if (!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(args[0])) {
 586              throw new TypeError('Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters');
 587          }
 588  
 589          i18n.lang = args[0];
 590  
 591          if (i18n[args[0]] === undefined) {
 592              args[1] = args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object' ? args[1] : {};
 593              i18n[args[0]] = !(0, _general.isObjectEmpty)(args[1]) ? args[1] : _en.EN;
 594          } else if (args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object') {
 595              i18n[args[0]] = args[1];
 596          }
 597      }
 598  
 599      return i18n.lang;
 600  };
 601  
 602  i18n.t = function (message) {
 603      var pluralParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
 604  
 605  
 606      if (typeof message === 'string' && message.length) {
 607  
 608          var str = void 0,
 609              pluralForm = void 0;
 610  
 611          var language = i18n.language();
 612  
 613          var _plural = function _plural(input, number, form) {
 614  
 615              if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) !== 'object' || typeof number !== 'number' || typeof form !== 'number') {
 616                  return input;
 617              }
 618  
 619              var _pluralForms = function () {
 620                  return [function () {
 621                      return arguments.length <= 1 ? undefined : arguments[1];
 622                  }, function () {
 623                      return (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
 624                  }, function () {
 625                      return (arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
 626                  }, function () {
 627                      if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
 628                          return arguments.length <= 1 ? undefined : arguments[1];
 629                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 0) {
 630                          return arguments.length <= 2 ? undefined : arguments[2];
 631                      } else {
 632                          return arguments.length <= 3 ? undefined : arguments[3];
 633                      }
 634                  }, function () {
 635                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1 || (arguments.length <= 0 ? undefined : arguments[0]) === 11) {
 636                          return arguments.length <= 1 ? undefined : arguments[1];
 637                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2 || (arguments.length <= 0 ? undefined : arguments[0]) === 12) {
 638                          return arguments.length <= 2 ? undefined : arguments[2];
 639                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 20) {
 640                          return arguments.length <= 3 ? undefined : arguments[3];
 641                      } else {
 642                          return arguments.length <= 4 ? undefined : arguments[4];
 643                      }
 644                  }, function () {
 645                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 646                          return arguments.length <= 1 ? undefined : arguments[1];
 647                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 0 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) {
 648                          return arguments.length <= 2 ? undefined : arguments[2];
 649                      } else {
 650                          return arguments.length <= 3 ? undefined : arguments[3];
 651                      }
 652                  }, function () {
 653                      if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
 654                          return arguments.length <= 1 ? undefined : arguments[1];
 655                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
 656                          return arguments.length <= 2 ? undefined : arguments[2];
 657                      } else {
 658                          return [3];
 659                      }
 660                  }, function () {
 661                      if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
 662                          return arguments.length <= 1 ? undefined : arguments[1];
 663                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
 664                          return arguments.length <= 2 ? undefined : arguments[2];
 665                      } else {
 666                          return arguments.length <= 3 ? undefined : arguments[3];
 667                      }
 668                  }, function () {
 669                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 670                          return arguments.length <= 1 ? undefined : arguments[1];
 671                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) <= 4) {
 672                          return arguments.length <= 2 ? undefined : arguments[2];
 673                      } else {
 674                          return arguments.length <= 3 ? undefined : arguments[3];
 675                      }
 676                  }, function () {
 677                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 678                          return arguments.length <= 1 ? undefined : arguments[1];
 679                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
 680                          return arguments.length <= 2 ? undefined : arguments[2];
 681                      } else {
 682                          return arguments.length <= 3 ? undefined : arguments[3];
 683                      }
 684                  }, function () {
 685                      if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 1) {
 686                          return arguments.length <= 2 ? undefined : arguments[2];
 687                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 2) {
 688                          return arguments.length <= 3 ? undefined : arguments[3];
 689                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 3 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 === 4) {
 690                          return arguments.length <= 4 ? undefined : arguments[4];
 691                      } else {
 692                          return arguments.length <= 1 ? undefined : arguments[1];
 693                      }
 694                  }, function () {
 695                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 696                          return arguments.length <= 1 ? undefined : arguments[1];
 697                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
 698                          return arguments.length <= 2 ? undefined : arguments[2];
 699                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 7) {
 700                          return arguments.length <= 3 ? undefined : arguments[3];
 701                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 6 && (arguments.length <= 0 ? undefined : arguments[0]) < 11) {
 702                          return arguments.length <= 4 ? undefined : arguments[4];
 703                      } else {
 704                          return arguments.length <= 5 ? undefined : arguments[5];
 705                      }
 706                  }, function () {
 707                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) {
 708                          return arguments.length <= 1 ? undefined : arguments[1];
 709                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 710                          return arguments.length <= 2 ? undefined : arguments[2];
 711                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
 712                          return arguments.length <= 3 ? undefined : arguments[3];
 713                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 3 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 <= 10) {
 714                          return arguments.length <= 4 ? undefined : arguments[4];
 715                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 11) {
 716                          return arguments.length <= 5 ? undefined : arguments[5];
 717                      } else {
 718                          return arguments.length <= 6 ? undefined : arguments[6];
 719                      }
 720                  }, function () {
 721                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 722                          return arguments.length <= 1 ? undefined : arguments[1];
 723                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 11) {
 724                          return arguments.length <= 2 ? undefined : arguments[2];
 725                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 > 10 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) {
 726                          return arguments.length <= 3 ? undefined : arguments[3];
 727                      } else {
 728                          return arguments.length <= 4 ? undefined : arguments[4];
 729                      }
 730                  }, function () {
 731                      if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1) {
 732                          return arguments.length <= 1 ? undefined : arguments[1];
 733                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 2) {
 734                          return arguments.length <= 2 ? undefined : arguments[2];
 735                      } else {
 736                          return arguments.length <= 3 ? undefined : arguments[3];
 737                      }
 738                  }, function () {
 739                      return (arguments.length <= 0 ? undefined : arguments[0]) !== 11 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
 740                  }, function () {
 741                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 742                          return arguments.length <= 1 ? undefined : arguments[1];
 743                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
 744                          return arguments.length <= 2 ? undefined : arguments[2];
 745                      } else {
 746                          return arguments.length <= 3 ? undefined : arguments[3];
 747                      }
 748                  }, function () {
 749                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 750                          return arguments.length <= 1 ? undefined : arguments[1];
 751                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
 752                          return arguments.length <= 2 ? undefined : arguments[2];
 753                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 8 && (arguments.length <= 0 ? undefined : arguments[0]) !== 11) {
 754                          return arguments.length <= 3 ? undefined : arguments[3];
 755                      } else {
 756                          return arguments.length <= 4 ? undefined : arguments[4];
 757                      }
 758                  }, function () {
 759                      return (arguments.length <= 0 ? undefined : arguments[0]) === 0 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
 760                  }, function () {
 761                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 762                          return arguments.length <= 1 ? undefined : arguments[1];
 763                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
 764                          return arguments.length <= 2 ? undefined : arguments[2];
 765                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 3) {
 766                          return arguments.length <= 3 ? undefined : arguments[3];
 767                      } else {
 768                          return arguments.length <= 4 ? undefined : arguments[4];
 769                      }
 770                  }, function () {
 771                      if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) {
 772                          return arguments.length <= 1 ? undefined : arguments[1];
 773                      } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
 774                          return arguments.length <= 2 ? undefined : arguments[2];
 775                      } else {
 776                          return arguments.length <= 3 ? undefined : arguments[3];
 777                      }
 778                  }];
 779              }();
 780  
 781              return _pluralForms[form].apply(null, [number].concat(input));
 782          };
 783  
 784          if (i18n[language] !== undefined) {
 785              str = i18n[language][message];
 786              if (pluralParam !== null && typeof pluralParam === 'number') {
 787                  pluralForm = i18n[language]['mejs.plural-form'];
 788                  str = _plural.apply(null, [str, pluralParam, pluralForm]);
 789              }
 790          }
 791  
 792          if (!str && i18n.en) {
 793              str = i18n.en[message];
 794              if (pluralParam !== null && typeof pluralParam === 'number') {
 795                  pluralForm = i18n.en['mejs.plural-form'];
 796                  str = _plural.apply(null, [str, pluralParam, pluralForm]);
 797              }
 798          }
 799  
 800          str = str || message;
 801  
 802          if (pluralParam !== null && typeof pluralParam === 'number') {
 803              str = str.replace('%1', pluralParam);
 804          }
 805  
 806          return (0, _general.escapeHTML)(str);
 807      }
 808  
 809      return message;
 810  };
 811  
 812  _mejs2.default.i18n = i18n;
 813  
 814  if (typeof mejsL10n !== 'undefined') {
 815      _mejs2.default.i18n.language(mejsL10n.language, mejsL10n.strings);
 816  }
 817  
 818  exports.default = i18n;
 819  
 820  },{"11":11,"20":20,"9":9}],8:[function(_dereq_,module,exports){
 821  'use strict';
 822  
 823  Object.defineProperty(exports, "__esModule", {
 824      value: true
 825  });
 826  
 827  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
 828  
 829  var _window = _dereq_(3);
 830  
 831  var _window2 = _interopRequireDefault(_window);
 832  
 833  var _document = _dereq_(2);
 834  
 835  var _document2 = _interopRequireDefault(_document);
 836  
 837  var _mejs = _dereq_(9);
 838  
 839  var _mejs2 = _interopRequireDefault(_mejs);
 840  
 841  var _general = _dereq_(20);
 842  
 843  var _media2 = _dereq_(21);
 844  
 845  var _renderer = _dereq_(10);
 846  
 847  var _constants = _dereq_(18);
 848  
 849  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 850  
 851  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 852  
 853  var MediaElement = function MediaElement(idOrNode, options, sources) {
 854      var _this = this;
 855  
 856      _classCallCheck(this, MediaElement);
 857  
 858      var t = this;
 859  
 860      sources = Array.isArray(sources) ? sources : null;
 861  
 862      t.defaults = {
 863          renderers: [],
 864  
 865          fakeNodeName: 'mediaelementwrapper',
 866  
 867          pluginPath: 'build/',
 868  
 869          shimScriptAccess: 'sameDomain'
 870      };
 871  
 872      options = Object.assign(t.defaults, options);
 873  
 874      t.mediaElement = _document2.default.createElement(options.fakeNodeName);
 875  
 876      var id = idOrNode,
 877          error = false;
 878  
 879      if (typeof idOrNode === 'string') {
 880          t.mediaElement.originalNode = _document2.default.getElementById(idOrNode);
 881      } else {
 882          t.mediaElement.originalNode = idOrNode;
 883          id = idOrNode.id;
 884      }
 885  
 886      if (t.mediaElement.originalNode === undefined || t.mediaElement.originalNode === null) {
 887          return null;
 888      }
 889  
 890      t.mediaElement.options = options;
 891      id = id || 'mejs_' + Math.random().toString().slice(2);
 892  
 893      t.mediaElement.originalNode.setAttribute('id', id + '_from_mejs');
 894  
 895      var tagName = t.mediaElement.originalNode.tagName.toLowerCase();
 896      if (['video', 'audio'].indexOf(tagName) > -1 && !t.mediaElement.originalNode.getAttribute('preload')) {
 897          t.mediaElement.originalNode.setAttribute('preload', 'none');
 898      }
 899  
 900      t.mediaElement.originalNode.parentNode.insertBefore(t.mediaElement, t.mediaElement.originalNode);
 901  
 902      t.mediaElement.appendChild(t.mediaElement.originalNode);
 903  
 904      var processURL = function processURL(url, type) {
 905          if (_window2.default.location.protocol === 'https:' && url.indexOf('http:') === 0 && _constants.IS_IOS && _mejs2.default.html5media.mediaTypes.indexOf(type) > -1) {
 906              var xhr = new XMLHttpRequest();
 907              xhr.onreadystatechange = function () {
 908                  if (this.readyState === 4 && this.status === 200) {
 909                      var _url = _window2.default.URL || _window2.default.webkitURL,
 910                          blobUrl = _url.createObjectURL(this.response);
 911                      t.mediaElement.originalNode.setAttribute('src', blobUrl);
 912                      return blobUrl;
 913                  }
 914                  return url;
 915              };
 916              xhr.open('GET', url);
 917              xhr.responseType = 'blob';
 918              xhr.send();
 919          }
 920  
 921          return url;
 922      };
 923  
 924      var mediaFiles = void 0;
 925  
 926      if (sources !== null) {
 927          mediaFiles = sources;
 928      } else if (t.mediaElement.originalNode !== null) {
 929  
 930          mediaFiles = [];
 931  
 932          switch (t.mediaElement.originalNode.nodeName.toLowerCase()) {
 933              case 'iframe':
 934                  mediaFiles.push({
 935                      type: '',
 936                      src: t.mediaElement.originalNode.getAttribute('src')
 937                  });
 938                  break;
 939              case 'audio':
 940              case 'video':
 941                  var _sources = t.mediaElement.originalNode.children.length,
 942                      nodeSource = t.mediaElement.originalNode.getAttribute('src');
 943  
 944                  if (nodeSource) {
 945                      var node = t.mediaElement.originalNode,
 946                          type = (0, _media2.formatType)(nodeSource, node.getAttribute('type'));
 947                      mediaFiles.push({
 948                          type: type,
 949                          src: processURL(nodeSource, type)
 950                      });
 951                  }
 952  
 953                  for (var i = 0; i < _sources; i++) {
 954                      var n = t.mediaElement.originalNode.children[i];
 955                      if (n.tagName.toLowerCase() === 'source') {
 956                          var src = n.getAttribute('src'),
 957                              _type = (0, _media2.formatType)(src, n.getAttribute('type'));
 958                          mediaFiles.push({ type: _type, src: processURL(src, _type) });
 959                      }
 960                  }
 961                  break;
 962          }
 963      }
 964  
 965      t.mediaElement.id = id;
 966      t.mediaElement.renderers = {};
 967      t.mediaElement.events = {};
 968      t.mediaElement.promises = [];
 969      t.mediaElement.renderer = null;
 970      t.mediaElement.rendererName = null;
 971  
 972      t.mediaElement.changeRenderer = function (rendererName, mediaFiles) {
 973  
 974          var t = _this,
 975              media = Object.keys(mediaFiles[0]).length > 2 ? mediaFiles[0] : mediaFiles[0].src;
 976  
 977          if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && t.mediaElement.renderer.name === rendererName) {
 978              t.mediaElement.renderer.pause();
 979              if (t.mediaElement.renderer.stop) {
 980                  t.mediaElement.renderer.stop();
 981              }
 982              t.mediaElement.renderer.show();
 983              t.mediaElement.renderer.setSrc(media);
 984              return true;
 985          }
 986  
 987          if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) {
 988              t.mediaElement.renderer.pause();
 989              if (t.mediaElement.renderer.stop) {
 990                  t.mediaElement.renderer.stop();
 991              }
 992              t.mediaElement.renderer.hide();
 993          }
 994  
 995          var newRenderer = t.mediaElement.renderers[rendererName],
 996              newRendererType = null;
 997  
 998          if (newRenderer !== undefined && newRenderer !== null) {
 999              newRenderer.show();
1000              newRenderer.setSrc(media);
1001              t.mediaElement.renderer = newRenderer;
1002              t.mediaElement.rendererName = rendererName;
1003              return true;
1004          }
1005  
1006          var rendererArray = t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : _renderer.renderer.order;
1007  
1008          for (var _i = 0, total = rendererArray.length; _i < total; _i++) {
1009              var index = rendererArray[_i];
1010  
1011              if (index === rendererName) {
1012                  var rendererList = _renderer.renderer.renderers;
1013                  newRendererType = rendererList[index];
1014  
1015                  var renderOptions = Object.assign(newRendererType.options, t.mediaElement.options);
1016                  newRenderer = newRendererType.create(t.mediaElement, renderOptions, mediaFiles);
1017                  newRenderer.name = rendererName;
1018  
1019                  t.mediaElement.renderers[newRendererType.name] = newRenderer;
1020                  t.mediaElement.renderer = newRenderer;
1021                  t.mediaElement.rendererName = rendererName;
1022                  newRenderer.show();
1023                  return true;
1024              }
1025          }
1026  
1027          return false;
1028      };
1029  
1030      t.mediaElement.setSize = function (width, height) {
1031          if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) {
1032              t.mediaElement.renderer.setSize(width, height);
1033          }
1034      };
1035  
1036      t.mediaElement.generateError = function (message, urlList) {
1037          message = message || '';
1038          urlList = Array.isArray(urlList) ? urlList : [];
1039          var event = (0, _general.createEvent)('error', t.mediaElement);
1040          event.message = message;
1041          event.urls = urlList;
1042          t.mediaElement.dispatchEvent(event);
1043          error = true;
1044      };
1045  
1046      var props = _mejs2.default.html5media.properties,
1047          methods = _mejs2.default.html5media.methods,
1048          addProperty = function addProperty(obj, name, onGet, onSet) {
1049          var oldValue = obj[name];
1050          var getFn = function getFn() {
1051              return onGet.apply(obj, [oldValue]);
1052          },
1053              setFn = function setFn(newValue) {
1054              oldValue = onSet.apply(obj, [newValue]);
1055              return oldValue;
1056          };
1057  
1058          Object.defineProperty(obj, name, {
1059              get: getFn,
1060              set: setFn
1061          });
1062      },
1063          assignGettersSetters = function assignGettersSetters(propName) {
1064          if (propName !== 'src') {
1065  
1066              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1),
1067                  getFn = function getFn() {
1068                  return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['get' + capName] === 'function' ? t.mediaElement.renderer['get' + capName]() : null;
1069              },
1070                  setFn = function setFn(value) {
1071                  if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['set' + capName] === 'function') {
1072                      t.mediaElement.renderer['set' + capName](value);
1073                  }
1074              };
1075  
1076              addProperty(t.mediaElement, propName, getFn, setFn);
1077              t.mediaElement['get' + capName] = getFn;
1078              t.mediaElement['set' + capName] = setFn;
1079          }
1080      },
1081          getSrc = function getSrc() {
1082          return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null ? t.mediaElement.renderer.getSrc() : null;
1083      },
1084          setSrc = function setSrc(value) {
1085          var mediaFiles = [];
1086  
1087          if (typeof value === 'string') {
1088              mediaFiles.push({
1089                  src: value,
1090                  type: value ? (0, _media2.getTypeFromFile)(value) : ''
1091              });
1092          } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src !== undefined) {
1093              var _src = (0, _media2.absolutizeUrl)(value.src),
1094                  _type2 = value.type,
1095                  media = Object.assign(value, {
1096                  src: _src,
1097                  type: (_type2 === '' || _type2 === null || _type2 === undefined) && _src ? (0, _media2.getTypeFromFile)(_src) : _type2
1098              });
1099              mediaFiles.push(media);
1100          } else if (Array.isArray(value)) {
1101              for (var _i2 = 0, total = value.length; _i2 < total; _i2++) {
1102  
1103                  var _src2 = (0, _media2.absolutizeUrl)(value[_i2].src),
1104                      _type3 = value[_i2].type,
1105                      _media = Object.assign(value[_i2], {
1106                      src: _src2,
1107                      type: (_type3 === '' || _type3 === null || _type3 === undefined) && _src2 ? (0, _media2.getTypeFromFile)(_src2) : _type3
1108                  });
1109  
1110                  mediaFiles.push(_media);
1111              }
1112          }
1113  
1114          var renderInfo = _renderer.renderer.select(mediaFiles, t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : []),
1115              event = void 0;
1116  
1117          if (!t.mediaElement.paused) {
1118              t.mediaElement.pause();
1119              event = (0, _general.createEvent)('pause', t.mediaElement);
1120              t.mediaElement.dispatchEvent(event);
1121          }
1122          t.mediaElement.originalNode.src = mediaFiles[0].src || '';
1123  
1124          if (renderInfo === null && mediaFiles[0].src) {
1125              t.mediaElement.generateError('No renderer found', mediaFiles);
1126              return;
1127          }
1128  
1129          return mediaFiles[0].src ? t.mediaElement.changeRenderer(renderInfo.rendererName, mediaFiles) : null;
1130      },
1131          triggerAction = function triggerAction(methodName, args) {
1132          try {
1133              if (methodName === 'play' && (t.mediaElement.rendererName === 'native_dash' || t.mediaElement.rendererName === 'native_hls')) {
1134                  var response = t.mediaElement.renderer[methodName](args);
1135                  if (response && typeof response.then === 'function') {
1136                      response.catch(function () {
1137                          if (t.mediaElement.paused) {
1138                              setTimeout(function () {
1139                                  var tmpResponse = t.mediaElement.renderer.play();
1140                                  if (tmpResponse !== undefined) {
1141                                      tmpResponse.catch(function () {
1142                                          if (!t.mediaElement.renderer.paused) {
1143                                              t.mediaElement.renderer.pause();
1144                                          }
1145                                      });
1146                                  }
1147                              }, 150);
1148                          }
1149                      });
1150                  }
1151              } else {
1152                  t.mediaElement.renderer[methodName](args);
1153              }
1154          } catch (e) {
1155              t.mediaElement.generateError(e, mediaFiles);
1156          }
1157      },
1158          assignMethods = function assignMethods(methodName) {
1159          t.mediaElement[methodName] = function () {
1160              for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1161                  args[_key] = arguments[_key];
1162              }
1163  
1164              if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer[methodName] === 'function') {
1165                  if (t.mediaElement.promises.length) {
1166                      Promise.all(t.mediaElement.promises).then(function () {
1167                          triggerAction(methodName, args);
1168                      }).catch(function (e) {
1169                          t.mediaElement.generateError(e, mediaFiles);
1170                      });
1171                  } else {
1172                      triggerAction(methodName, args);
1173                  }
1174              }
1175              return null;
1176          };
1177      };
1178  
1179      addProperty(t.mediaElement, 'src', getSrc, setSrc);
1180      t.mediaElement.getSrc = getSrc;
1181      t.mediaElement.setSrc = setSrc;
1182  
1183      for (var _i3 = 0, total = props.length; _i3 < total; _i3++) {
1184          assignGettersSetters(props[_i3]);
1185      }
1186  
1187      for (var _i4 = 0, _total = methods.length; _i4 < _total; _i4++) {
1188          assignMethods(methods[_i4]);
1189      }
1190  
1191      t.mediaElement.addEventListener = function (eventName, callback) {
1192          t.mediaElement.events[eventName] = t.mediaElement.events[eventName] || [];
1193  
1194          t.mediaElement.events[eventName].push(callback);
1195      };
1196      t.mediaElement.removeEventListener = function (eventName, callback) {
1197          if (!eventName) {
1198              t.mediaElement.events = {};
1199              return true;
1200          }
1201  
1202          var callbacks = t.mediaElement.events[eventName];
1203  
1204          if (!callbacks) {
1205              return true;
1206          }
1207  
1208          if (!callback) {
1209              t.mediaElement.events[eventName] = [];
1210              return true;
1211          }
1212  
1213          for (var _i5 = 0; _i5 < callbacks.length; _i5++) {
1214              if (callbacks[_i5] === callback) {
1215                  t.mediaElement.events[eventName].splice(_i5, 1);
1216                  return true;
1217              }
1218          }
1219          return false;
1220      };
1221  
1222      t.mediaElement.dispatchEvent = function (event) {
1223          var callbacks = t.mediaElement.events[event.type];
1224          if (callbacks) {
1225              for (var _i6 = 0; _i6 < callbacks.length; _i6++) {
1226                  callbacks[_i6].apply(null, [event]);
1227              }
1228          }
1229      };
1230  
1231      t.mediaElement.destroy = function () {
1232          var mediaElement = t.mediaElement.originalNode.cloneNode(true);
1233          var wrapper = t.mediaElement.parentElement;
1234          mediaElement.removeAttribute('id');
1235          mediaElement.remove();
1236          t.mediaElement.remove();
1237          wrapper.appendChild(mediaElement);
1238      };
1239  
1240      if (mediaFiles.length) {
1241          t.mediaElement.src = mediaFiles;
1242      }
1243  
1244      if (t.mediaElement.promises.length) {
1245          Promise.all(t.mediaElement.promises).then(function () {
1246              if (t.mediaElement.options.success) {
1247                  t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode);
1248              }
1249          }).catch(function () {
1250              if (error && t.mediaElement.options.error) {
1251                  t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode);
1252              }
1253          });
1254      } else {
1255          if (t.mediaElement.options.success) {
1256              t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode);
1257          }
1258  
1259          if (error && t.mediaElement.options.error) {
1260              t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode);
1261          }
1262      }
1263  
1264      return t.mediaElement;
1265  };
1266  
1267  _window2.default.MediaElement = MediaElement;
1268  _mejs2.default.MediaElement = MediaElement;
1269  
1270  exports.default = MediaElement;
1271  
1272  },{"10":10,"18":18,"2":2,"20":20,"21":21,"3":3,"9":9}],9:[function(_dereq_,module,exports){
1273  'use strict';
1274  
1275  Object.defineProperty(exports, "__esModule", {
1276      value: true
1277  });
1278  
1279  var _window = _dereq_(3);
1280  
1281  var _window2 = _interopRequireDefault(_window);
1282  
1283  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1284  
1285  var mejs = {};
1286  
1287  mejs.version = '4.2.12';
1288  
1289  mejs.html5media = {
1290      properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'],
1291      readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'],
1292  
1293      methods: ['load', 'play', 'pause', 'canPlayType'],
1294  
1295      events: ['loadstart', 'durationchange', 'loadedmetadata', 'loadeddata', 'progress', 'canplay', 'canplaythrough', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'play', 'playing', 'pause', 'waiting', 'seeking', 'seeked', 'timeupdate', 'ended', 'ratechange', 'volumechange'],
1296  
1297      mediaTypes: ['audio/mp3', 'audio/ogg', 'audio/oga', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/x-pn-wav', 'audio/mpeg', 'audio/mp4', 'video/mp4', 'video/webm', 'video/ogg', 'video/ogv']
1298  };
1299  
1300  _window2.default.mejs = mejs;
1301  
1302  exports.default = mejs;
1303  
1304  },{"3":3}],10:[function(_dereq_,module,exports){
1305  'use strict';
1306  
1307  Object.defineProperty(exports, "__esModule", {
1308      value: true
1309  });
1310  exports.renderer = undefined;
1311  
1312  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1313  
1314  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1315  
1316  var _mejs = _dereq_(9);
1317  
1318  var _mejs2 = _interopRequireDefault(_mejs);
1319  
1320  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1321  
1322  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1323  
1324  var Renderer = function () {
1325  	function Renderer() {
1326          _classCallCheck(this, Renderer);
1327  
1328          this.renderers = {};
1329          this.order = [];
1330      }
1331  
1332      _createClass(Renderer, [{
1333          key: 'add',
1334          value: function add(renderer) {
1335              if (renderer.name === undefined) {
1336                  throw new TypeError('renderer must contain at least `name` property');
1337              }
1338  
1339              this.renderers[renderer.name] = renderer;
1340              this.order.push(renderer.name);
1341          }
1342      }, {
1343          key: 'select',
1344          value: function select(mediaFiles) {
1345              var renderers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1346  
1347              var renderersLength = renderers.length;
1348  
1349              renderers = renderers.length ? renderers : this.order;
1350  
1351              if (!renderersLength) {
1352                  var rendererIndicator = [/^(html5|native)/i, /^flash/i, /iframe$/i],
1353                      rendererRanking = function rendererRanking(renderer) {
1354                      for (var i = 0, total = rendererIndicator.length; i < total; i++) {
1355                          if (rendererIndicator[i].test(renderer)) {
1356                              return i;
1357                          }
1358                      }
1359                      return rendererIndicator.length;
1360                  };
1361  
1362                  renderers.sort(function (a, b) {
1363                      return rendererRanking(a) - rendererRanking(b);
1364                  });
1365              }
1366  
1367              for (var i = 0, total = renderers.length; i < total; i++) {
1368                  var key = renderers[i],
1369                      _renderer = this.renderers[key];
1370  
1371                  if (_renderer !== null && _renderer !== undefined) {
1372                      for (var j = 0, jl = mediaFiles.length; j < jl; j++) {
1373                          if (typeof _renderer.canPlayType === 'function' && typeof mediaFiles[j].type === 'string' && _renderer.canPlayType(mediaFiles[j].type)) {
1374                              return {
1375                                  rendererName: _renderer.name,
1376                                  src: mediaFiles[j].src
1377                              };
1378                          }
1379                      }
1380                  }
1381              }
1382  
1383              return null;
1384          }
1385      }, {
1386          key: 'order',
1387          set: function set(order) {
1388              if (!Array.isArray(order)) {
1389                  throw new TypeError('order must be an array of strings.');
1390              }
1391  
1392              this._order = order;
1393          },
1394          get: function get() {
1395              return this._order;
1396          }
1397      }, {
1398          key: 'renderers',
1399          set: function set(renderers) {
1400              if (renderers !== null && (typeof renderers === 'undefined' ? 'undefined' : _typeof(renderers)) !== 'object') {
1401                  throw new TypeError('renderers must be an array of objects.');
1402              }
1403  
1404              this._renderers = renderers;
1405          },
1406          get: function get() {
1407              return this._renderers;
1408          }
1409      }]);
1410  
1411      return Renderer;
1412  }();
1413  
1414  var renderer = exports.renderer = new Renderer();
1415  
1416  _mejs2.default.Renderers = renderer;
1417  
1418  },{"9":9}],11:[function(_dereq_,module,exports){
1419  'use strict';
1420  
1421  Object.defineProperty(exports, "__esModule", {
1422      value: true
1423  });
1424  var EN = exports.EN = {
1425      'mejs.plural-form': 1,
1426  
1427      'mejs.download-file': 'Download File',
1428  
1429      'mejs.install-flash': 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/',
1430  
1431      'mejs.fullscreen': 'Fullscreen',
1432  
1433      'mejs.play': 'Play',
1434      'mejs.pause': 'Pause',
1435  
1436      'mejs.time-slider': 'Time Slider',
1437      'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.',
1438      'mejs.live-broadcast': 'Live Broadcast',
1439  
1440      'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.',
1441      'mejs.unmute': 'Unmute',
1442      'mejs.mute': 'Mute',
1443      'mejs.volume-slider': 'Volume Slider',
1444  
1445      'mejs.video-player': 'Video Player',
1446      'mejs.audio-player': 'Audio Player',
1447  
1448      'mejs.captions-subtitles': 'Captions/Subtitles',
1449      'mejs.captions-chapters': 'Chapters',
1450      'mejs.none': 'None',
1451      'mejs.afrikaans': 'Afrikaans',
1452      'mejs.albanian': 'Albanian',
1453      'mejs.arabic': 'Arabic',
1454      'mejs.belarusian': 'Belarusian',
1455      'mejs.bulgarian': 'Bulgarian',
1456      'mejs.catalan': 'Catalan',
1457      'mejs.chinese': 'Chinese',
1458      'mejs.chinese-simplified': 'Chinese (Simplified)',
1459      'mejs.chinese-traditional': 'Chinese (Traditional)',
1460      'mejs.croatian': 'Croatian',
1461      'mejs.czech': 'Czech',
1462      'mejs.danish': 'Danish',
1463      'mejs.dutch': 'Dutch',
1464      'mejs.english': 'English',
1465      'mejs.estonian': 'Estonian',
1466      'mejs.filipino': 'Filipino',
1467      'mejs.finnish': 'Finnish',
1468      'mejs.french': 'French',
1469      'mejs.galician': 'Galician',
1470      'mejs.german': 'German',
1471      'mejs.greek': 'Greek',
1472      'mejs.haitian-creole': 'Haitian Creole',
1473      'mejs.hebrew': 'Hebrew',
1474      'mejs.hindi': 'Hindi',
1475      'mejs.hungarian': 'Hungarian',
1476      'mejs.icelandic': 'Icelandic',
1477      'mejs.indonesian': 'Indonesian',
1478      'mejs.irish': 'Irish',
1479      'mejs.italian': 'Italian',
1480      'mejs.japanese': 'Japanese',
1481      'mejs.korean': 'Korean',
1482      'mejs.latvian': 'Latvian',
1483      'mejs.lithuanian': 'Lithuanian',
1484      'mejs.macedonian': 'Macedonian',
1485      'mejs.malay': 'Malay',
1486      'mejs.maltese': 'Maltese',
1487      'mejs.norwegian': 'Norwegian',
1488      'mejs.persian': 'Persian',
1489      'mejs.polish': 'Polish',
1490      'mejs.portuguese': 'Portuguese',
1491      'mejs.romanian': 'Romanian',
1492      'mejs.russian': 'Russian',
1493      'mejs.serbian': 'Serbian',
1494      'mejs.slovak': 'Slovak',
1495      'mejs.slovenian': 'Slovenian',
1496      'mejs.spanish': 'Spanish',
1497      'mejs.swahili': 'Swahili',
1498      'mejs.swedish': 'Swedish',
1499      'mejs.tagalog': 'Tagalog',
1500      'mejs.thai': 'Thai',
1501      'mejs.turkish': 'Turkish',
1502      'mejs.ukrainian': 'Ukrainian',
1503      'mejs.vietnamese': 'Vietnamese',
1504      'mejs.welsh': 'Welsh',
1505      'mejs.yiddish': 'Yiddish'
1506  };
1507  
1508  },{}],12:[function(_dereq_,module,exports){
1509  'use strict';
1510  
1511  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1512  
1513  var _window = _dereq_(3);
1514  
1515  var _window2 = _interopRequireDefault(_window);
1516  
1517  var _mejs = _dereq_(9);
1518  
1519  var _mejs2 = _interopRequireDefault(_mejs);
1520  
1521  var _renderer = _dereq_(10);
1522  
1523  var _general = _dereq_(20);
1524  
1525  var _media = _dereq_(21);
1526  
1527  var _constants = _dereq_(18);
1528  
1529  var _dom = _dereq_(19);
1530  
1531  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1532  
1533  var NativeDash = {
1534  
1535      promise: null,
1536  
1537      load: function load(settings) {
1538          if (typeof dashjs !== 'undefined') {
1539              NativeDash.promise = new Promise(function (resolve) {
1540                  resolve();
1541              }).then(function () {
1542                  NativeDash._createPlayer(settings);
1543              });
1544          } else {
1545              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js';
1546  
1547              NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path);
1548              NativeDash.promise.then(function () {
1549                  NativeDash._createPlayer(settings);
1550              });
1551          }
1552  
1553          return NativeDash.promise;
1554      },
1555  
1556      _createPlayer: function _createPlayer(settings) {
1557          var player = dashjs.MediaPlayer().create();
1558          _window2.default['__ready__' + settings.id](player);
1559          return player;
1560      }
1561  };
1562  
1563  var DashNativeRenderer = {
1564      name: 'native_dash',
1565      options: {
1566          prefix: 'native_dash',
1567          dash: {
1568              path: 'https://cdn.dashjs.org/latest/dash.all.min.js',
1569              debug: false,
1570              drm: {},
1571  
1572              robustnessLevel: ''
1573          }
1574      },
1575  
1576      canPlayType: function canPlayType(type) {
1577          return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1;
1578      },
1579  
1580      create: function create(mediaElement, options, mediaFiles) {
1581  
1582          var originalNode = mediaElement.originalNode,
1583              id = mediaElement.id + '_' + options.prefix,
1584              autoplay = originalNode.autoplay,
1585              children = originalNode.children;
1586  
1587          var node = null,
1588              dashPlayer = null;
1589  
1590          originalNode.removeAttribute('type');
1591          for (var i = 0, total = children.length; i < total; i++) {
1592              children[i].removeAttribute('type');
1593          }
1594  
1595          node = originalNode.cloneNode(true);
1596          options = Object.assign(options, mediaElement.options);
1597  
1598          var props = _mejs2.default.html5media.properties,
1599              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
1600              return e !== 'error';
1601          }),
1602              attachNativeEvents = function attachNativeEvents(e) {
1603              var event = (0, _general.createEvent)(e.type, mediaElement);
1604              mediaElement.dispatchEvent(event);
1605          },
1606              assignGettersSetters = function assignGettersSetters(propName) {
1607              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
1608  
1609              node['get' + capName] = function () {
1610                  return dashPlayer !== null ? node[propName] : null;
1611              };
1612  
1613              node['set' + capName] = function (value) {
1614                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
1615                      if (propName === 'src') {
1616                          var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
1617                          node[propName] = source;
1618                          if (dashPlayer !== null) {
1619                              dashPlayer.reset();
1620                              for (var _i = 0, _total = events.length; _i < _total; _i++) {
1621                                  node.removeEventListener(events[_i], attachNativeEvents);
1622                              }
1623                              dashPlayer = NativeDash._createPlayer({
1624                                  options: options.dash,
1625                                  id: id
1626                              });
1627  
1628                              if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') {
1629                                  dashPlayer.setProtectionData(value.drm);
1630                                  if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
1631                                      dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
1632                                  }
1633                              }
1634                              dashPlayer.attachSource(source);
1635                              if (autoplay) {
1636                                  dashPlayer.play();
1637                              }
1638                          }
1639                      } else {
1640                          node[propName] = value;
1641                      }
1642                  }
1643              };
1644          };
1645  
1646          for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) {
1647              assignGettersSetters(props[_i2]);
1648          }
1649  
1650          _window2.default['__ready__' + id] = function (_dashPlayer) {
1651              mediaElement.dashPlayer = dashPlayer = _dashPlayer;
1652  
1653              var dashEvents = dashjs.MediaPlayer.events,
1654                  assignEvents = function assignEvents(eventName) {
1655                  if (eventName === 'loadedmetadata') {
1656                      dashPlayer.initialize();
1657                      dashPlayer.attachView(node);
1658                      dashPlayer.setAutoPlay(false);
1659  
1660                      if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) {
1661                          dashPlayer.setProtectionData(options.dash.drm);
1662                          if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
1663                              dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
1664                          }
1665                      }
1666                      dashPlayer.attachSource(node.getSrc());
1667                  }
1668  
1669                  node.addEventListener(eventName, attachNativeEvents);
1670              };
1671  
1672              for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
1673                  assignEvents(events[_i3]);
1674              }
1675  
1676              var assignMdashEvents = function assignMdashEvents(e) {
1677                  if (e.type.toLowerCase() === 'error') {
1678                      mediaElement.generateError(e.message, node.src);
1679                      console.error(e);
1680                  } else {
1681                      var _event = (0, _general.createEvent)(e.type, mediaElement);
1682                      _event.data = e;
1683                      mediaElement.dispatchEvent(_event);
1684                  }
1685              };
1686  
1687              for (var eventType in dashEvents) {
1688                  if (dashEvents.hasOwnProperty(eventType)) {
1689                      dashPlayer.on(dashEvents[eventType], function (e) {
1690                          return assignMdashEvents(e);
1691                      });
1692                  }
1693              }
1694          };
1695  
1696          if (mediaFiles && mediaFiles.length > 0) {
1697              for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
1698                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
1699                      node.setAttribute('src', mediaFiles[_i4].src);
1700                      if (typeof mediaFiles[_i4].drm !== 'undefined') {
1701                          options.dash.drm = mediaFiles[_i4].drm;
1702                      }
1703                      break;
1704                  }
1705              }
1706          }
1707  
1708          node.setAttribute('id', id);
1709  
1710          originalNode.parentNode.insertBefore(node, originalNode);
1711          originalNode.autoplay = false;
1712          originalNode.style.display = 'none';
1713  
1714          node.setSize = function (width, height) {
1715              node.style.width = width + 'px';
1716              node.style.height = height + 'px';
1717              return node;
1718          };
1719  
1720          node.hide = function () {
1721              node.pause();
1722              node.style.display = 'none';
1723              return node;
1724          };
1725  
1726          node.show = function () {
1727              node.style.display = '';
1728              return node;
1729          };
1730  
1731          node.destroy = function () {
1732              if (dashPlayer !== null) {
1733                  dashPlayer.reset();
1734              }
1735          };
1736  
1737          var event = (0, _general.createEvent)('rendererready', node);
1738          mediaElement.dispatchEvent(event);
1739  
1740          mediaElement.promises.push(NativeDash.load({
1741              options: options.dash,
1742              id: id
1743          }));
1744  
1745          return node;
1746      }
1747  };
1748  
1749  _media.typeChecks.push(function (url) {
1750      return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null;
1751  });
1752  
1753  _renderer.renderer.add(DashNativeRenderer);
1754  
1755  },{"10":10,"18":18,"19":19,"20":20,"21":21,"3":3,"9":9}],13:[function(_dereq_,module,exports){
1756  'use strict';
1757  
1758  Object.defineProperty(exports, "__esModule", {
1759      value: true
1760  });
1761  exports.PluginDetector = undefined;
1762  
1763  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1764  
1765  var _window = _dereq_(3);
1766  
1767  var _window2 = _interopRequireDefault(_window);
1768  
1769  var _document = _dereq_(2);
1770  
1771  var _document2 = _interopRequireDefault(_document);
1772  
1773  var _mejs = _dereq_(9);
1774  
1775  var _mejs2 = _interopRequireDefault(_mejs);
1776  
1777  var _i18n = _dereq_(7);
1778  
1779  var _i18n2 = _interopRequireDefault(_i18n);
1780  
1781  var _renderer = _dereq_(10);
1782  
1783  var _general = _dereq_(20);
1784  
1785  var _constants = _dereq_(18);
1786  
1787  var _media = _dereq_(21);
1788  
1789  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1790  
1791  var PluginDetector = exports.PluginDetector = {
1792      plugins: [],
1793  
1794      hasPluginVersion: function hasPluginVersion(plugin, v) {
1795          var pv = PluginDetector.plugins[plugin];
1796          v[1] = v[1] || 0;
1797          v[2] = v[2] || 0;
1798          return pv[0] > v[0] || pv[0] === v[0] && pv[1] > v[1] || pv[0] === v[0] && pv[1] === v[1] && pv[2] >= v[2];
1799      },
1800  
1801      addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) {
1802          PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect);
1803      },
1804  
1805      detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) {
1806  
1807          var version = [0, 0, 0],
1808              description = void 0,
1809              ax = void 0;
1810  
1811          if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') {
1812              description = _constants.NAV.plugins[pluginName].description;
1813              if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) {
1814                  version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.');
1815                  for (var i = 0, total = version.length; i < total; i++) {
1816                      version[i] = parseInt(version[i].match(/\d+/), 10);
1817                  }
1818              }
1819          } else if (_window2.default.ActiveXObject !== undefined) {
1820              try {
1821                  ax = new ActiveXObject(activeX);
1822                  if (ax) {
1823                      version = axDetect(ax);
1824                  }
1825              } catch (e) {
1826                  
1827              }
1828          }
1829          return version;
1830      }
1831  };
1832  
1833  PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) {
1834      var version = [],
1835          d = ax.GetVariable("$version");
1836  
1837      if (d) {
1838          d = d.split(" ")[1].split(",");
1839          version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
1840      }
1841      return version;
1842  });
1843  
1844  var FlashMediaElementRenderer = {
1845      create: function create(mediaElement, options, mediaFiles) {
1846  
1847          var flash = {};
1848          var isActive = false;
1849  
1850          flash.options = options;
1851          flash.id = mediaElement.id + '_' + flash.options.prefix;
1852          flash.mediaElement = mediaElement;
1853          flash.flashState = {};
1854          flash.flashApi = null;
1855          flash.flashApiStack = [];
1856  
1857          var props = _mejs2.default.html5media.properties,
1858              assignGettersSetters = function assignGettersSetters(propName) {
1859              flash.flashState[propName] = null;
1860  
1861              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
1862  
1863              flash['get' + capName] = function () {
1864                  if (flash.flashApi !== null) {
1865                      if (typeof flash.flashApi['get_' + propName] === 'function') {
1866                          var value = flash.flashApi['get_' + propName]();
1867  
1868                          if (propName === 'buffered') {
1869                              return {
1870                                  start: function start() {
1871                                      return 0;
1872                                  },
1873                                  end: function end() {
1874                                      return value;
1875                                  },
1876                                  length: 1
1877                              };
1878                          }
1879                          return value;
1880                      } else {
1881                          return null;
1882                      }
1883                  } else {
1884                      return null;
1885                  }
1886              };
1887  
1888              flash['set' + capName] = function (value) {
1889                  if (propName === 'src') {
1890                      value = (0, _media.absolutizeUrl)(value);
1891                  }
1892  
1893                  if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) {
1894                      try {
1895                          flash.flashApi['set_' + propName](value);
1896                      } catch (e) {
1897                          
1898                      }
1899                  } else {
1900                      flash.flashApiStack.push({
1901                          type: 'set',
1902                          propName: propName,
1903                          value: value
1904                      });
1905                  }
1906              };
1907          };
1908  
1909          for (var i = 0, total = props.length; i < total; i++) {
1910              assignGettersSetters(props[i]);
1911          }
1912  
1913          var methods = _mejs2.default.html5media.methods,
1914              assignMethods = function assignMethods(methodName) {
1915              flash[methodName] = function () {
1916                  if (isActive) {
1917                      if (flash.flashApi !== null) {
1918                          if (flash.flashApi['fire_' + methodName]) {
1919                              try {
1920                                  flash.flashApi['fire_' + methodName]();
1921                              } catch (e) {
1922                                  
1923                              }
1924                          } else {
1925                              
1926                          }
1927                      } else {
1928                          flash.flashApiStack.push({
1929                              type: 'call',
1930                              methodName: methodName
1931                          });
1932                      }
1933                  }
1934              };
1935          };
1936          methods.push('stop');
1937          for (var _i = 0, _total = methods.length; _i < _total; _i++) {
1938              assignMethods(methods[_i]);
1939          }
1940  
1941          var initEvents = ['rendererready'];
1942  
1943          for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) {
1944              var event = (0, _general.createEvent)(initEvents[_i2], flash);
1945              mediaElement.dispatchEvent(event);
1946          }
1947  
1948          _window2.default['__ready__' + flash.id] = function () {
1949  
1950              flash.flashReady = true;
1951              flash.flashApi = _document2.default.getElementById('__' + flash.id);
1952  
1953              if (flash.flashApiStack.length) {
1954                  for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) {
1955                      var stackItem = flash.flashApiStack[_i3];
1956  
1957                      if (stackItem.type === 'set') {
1958                          var propName = stackItem.propName,
1959                              capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
1960  
1961                          flash['set' + capName](stackItem.value);
1962                      } else if (stackItem.type === 'call') {
1963                          flash[stackItem.methodName]();
1964                      }
1965                  }
1966              }
1967          };
1968  
1969          _window2.default['__event__' + flash.id] = function (eventName, message) {
1970              var event = (0, _general.createEvent)(eventName, flash);
1971              if (message) {
1972                  try {
1973                      event.data = JSON.parse(message);
1974                      event.details.data = JSON.parse(message);
1975                  } catch (e) {
1976                      event.message = message;
1977                  }
1978              }
1979  
1980              flash.mediaElement.dispatchEvent(event);
1981          };
1982  
1983          flash.flashWrapper = _document2.default.createElement('div');
1984  
1985          if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) {
1986              flash.options.shimScriptAccess = 'sameDomain';
1987          }
1988  
1989          var autoplay = mediaElement.originalNode.autoplay,
1990              flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')],
1991              isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video',
1992              flashHeight = isVideo ? mediaElement.originalNode.height : 1,
1993              flashWidth = isVideo ? mediaElement.originalNode.width : 1;
1994  
1995          if (mediaElement.originalNode.getAttribute('src')) {
1996              flashVars.push('src=' + mediaElement.originalNode.getAttribute('src'));
1997          }
1998  
1999          if (flash.options.enablePseudoStreaming === true) {
2000              flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam);
2001              flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType);
2002          }
2003  
2004          if (flash.options.streamDelimiter) {
2005              flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter));
2006          }
2007  
2008          if (flash.options.proxyType) {
2009              flashVars.push('proxytype=' + flash.options.proxyType);
2010          }
2011  
2012          mediaElement.appendChild(flash.flashWrapper);
2013          mediaElement.originalNode.style.display = 'none';
2014  
2015          var settings = [];
2016  
2017          if (_constants.IS_IE || _constants.IS_EDGE) {
2018              var specialIEContainer = _document2.default.createElement('div');
2019              flash.flashWrapper.appendChild(specialIEContainer);
2020  
2021              if (_constants.IS_EDGE) {
2022                  settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"'];
2023              } else {
2024                  settings = ['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"', 'codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '"'];
2025              }
2026  
2027              if (!isVideo) {
2028                  settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
2029              }
2030  
2031              specialIEContainer.outerHTML = '<object ' + settings.join(' ') + '>' + ('<param name="movie" value="' + flash.options.pluginPath + flash.options.filename + '?x=' + new Date() + '" />') + ('<param name="flashvars" value="' + flashVars.join('&amp;') + '" />') + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#000000" />' + '<param name="wmode" value="transparent" />' + ('<param name="allowScriptAccess" value="' + flash.options.shimScriptAccess + '" />') + '<param name="allowFullScreen" value="true" />' + ('<div>' + _i18n2.default.t('mejs.install-flash') + '</div>') + '</object>';
2032          } else {
2033  
2034              settings = ['id="__' + flash.id + '"', 'name="__' + flash.id + '"', 'play="true"', 'loop="false"', 'quality="high"', 'bgcolor="#000000"', 'wmode="transparent"', 'allowScriptAccess="' + flash.options.shimScriptAccess + '"', 'allowFullScreen="true"', 'type="application/x-shockwave-flash"', 'pluginspage="//www.macromedia.com/go/getflashplayer"', 'src="' + flash.options.pluginPath + flash.options.filename + '"', 'flashvars="' + flashVars.join('&') + '"'];
2035  
2036              if (isVideo) {
2037                  settings.push('width="' + flashWidth + '"');
2038                  settings.push('height="' + flashHeight + '"');
2039              } else {
2040                  settings.push('style="position: fixed; left: -9999em; top: -9999em;"');
2041              }
2042  
2043              flash.flashWrapper.innerHTML = '<embed ' + settings.join(' ') + '>';
2044          }
2045  
2046          flash.flashNode = flash.flashWrapper.lastChild;
2047  
2048          flash.hide = function () {
2049              isActive = false;
2050              if (isVideo) {
2051                  flash.flashNode.style.display = 'none';
2052              }
2053          };
2054          flash.show = function () {
2055              isActive = true;
2056              if (isVideo) {
2057                  flash.flashNode.style.display = '';
2058              }
2059          };
2060          flash.setSize = function (width, height) {
2061              flash.flashNode.style.width = width + 'px';
2062              flash.flashNode.style.height = height + 'px';
2063  
2064              if (flash.flashApi !== null && typeof flash.flashApi.fire_setSize === 'function') {
2065                  flash.flashApi.fire_setSize(width, height);
2066              }
2067          };
2068  
2069          flash.destroy = function () {
2070              flash.flashNode.remove();
2071          };
2072  
2073          if (mediaFiles && mediaFiles.length > 0) {
2074              for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
2075                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
2076                      flash.setSrc(mediaFiles[_i4].src);
2077                      break;
2078                  }
2079              }
2080          }
2081  
2082          return flash;
2083      }
2084  };
2085  
2086  var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]);
2087  
2088  if (hasFlash) {
2089      _media.typeChecks.push(function (url) {
2090          url = url.toLowerCase();
2091  
2092          if (url.startsWith('rtmp')) {
2093              if (~url.indexOf('.mp3')) {
2094                  return 'audio/rtmp';
2095              } else {
2096                  return 'video/rtmp';
2097              }
2098          } else if (/\.og(a|g)/i.test(url)) {
2099              return 'audio/ogg';
2100          } else if (~url.indexOf('.m3u8')) {
2101              return 'application/x-mpegURL';
2102          } else if (~url.indexOf('.mpd')) {
2103              return 'application/dash+xml';
2104          } else if (~url.indexOf('.flv')) {
2105              return 'video/flv';
2106          } else {
2107              return null;
2108          }
2109      });
2110  
2111      var FlashMediaElementVideoRenderer = {
2112          name: 'flash_video',
2113          options: {
2114              prefix: 'flash_video',
2115              filename: 'mediaelement-flash-video.swf',
2116              enablePseudoStreaming: false,
2117  
2118              pseudoStreamingStartQueryParam: 'start',
2119  
2120              pseudoStreamingType: 'byte',
2121  
2122              proxyType: '',
2123  
2124              streamDelimiter: ''
2125          },
2126  
2127          canPlayType: function canPlayType(type) {
2128              return ~['video/mp4', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4', 'video/flv', 'video/x-flv'].indexOf(type.toLowerCase());
2129          },
2130  
2131          create: FlashMediaElementRenderer.create
2132  
2133      };
2134      _renderer.renderer.add(FlashMediaElementVideoRenderer);
2135  
2136      var FlashMediaElementHlsVideoRenderer = {
2137          name: 'flash_hls',
2138          options: {
2139              prefix: 'flash_hls',
2140              filename: 'mediaelement-flash-video-hls.swf'
2141          },
2142  
2143          canPlayType: function canPlayType(type) {
2144              return ~['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase());
2145          },
2146  
2147          create: FlashMediaElementRenderer.create
2148      };
2149      _renderer.renderer.add(FlashMediaElementHlsVideoRenderer);
2150  
2151      var FlashMediaElementMdashVideoRenderer = {
2152          name: 'flash_dash',
2153          options: {
2154              prefix: 'flash_dash',
2155              filename: 'mediaelement-flash-video-mdash.swf'
2156          },
2157  
2158          canPlayType: function canPlayType(type) {
2159              return ~['application/dash+xml'].indexOf(type.toLowerCase());
2160          },
2161  
2162          create: FlashMediaElementRenderer.create
2163      };
2164      _renderer.renderer.add(FlashMediaElementMdashVideoRenderer);
2165  
2166      var FlashMediaElementAudioRenderer = {
2167          name: 'flash_audio',
2168          options: {
2169              prefix: 'flash_audio',
2170              filename: 'mediaelement-flash-audio.swf'
2171          },
2172  
2173          canPlayType: function canPlayType(type) {
2174              return ~['audio/mp3'].indexOf(type.toLowerCase());
2175          },
2176  
2177          create: FlashMediaElementRenderer.create
2178      };
2179      _renderer.renderer.add(FlashMediaElementAudioRenderer);
2180  
2181      var FlashMediaElementAudioOggRenderer = {
2182          name: 'flash_audio_ogg',
2183          options: {
2184              prefix: 'flash_audio_ogg',
2185              filename: 'mediaelement-flash-audio-ogg.swf'
2186          },
2187  
2188          canPlayType: function canPlayType(type) {
2189              return ~['audio/ogg', 'audio/oga', 'audio/ogv'].indexOf(type.toLowerCase());
2190          },
2191  
2192          create: FlashMediaElementRenderer.create
2193      };
2194      _renderer.renderer.add(FlashMediaElementAudioOggRenderer);
2195  }
2196  
2197  },{"10":10,"18":18,"2":2,"20":20,"21":21,"3":3,"7":7,"9":9}],14:[function(_dereq_,module,exports){
2198  'use strict';
2199  
2200  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2201  
2202  var _window = _dereq_(3);
2203  
2204  var _window2 = _interopRequireDefault(_window);
2205  
2206  var _mejs = _dereq_(9);
2207  
2208  var _mejs2 = _interopRequireDefault(_mejs);
2209  
2210  var _renderer = _dereq_(10);
2211  
2212  var _general = _dereq_(20);
2213  
2214  var _constants = _dereq_(18);
2215  
2216  var _media = _dereq_(21);
2217  
2218  var _dom = _dereq_(19);
2219  
2220  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2221  
2222  var NativeFlv = {
2223  
2224      promise: null,
2225  
2226      load: function load(settings) {
2227          if (typeof flvjs !== 'undefined') {
2228              NativeFlv.promise = new Promise(function (resolve) {
2229                  resolve();
2230              }).then(function () {
2231                  NativeFlv._createPlayer(settings);
2232              });
2233          } else {
2234              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/flv.js@latest';
2235  
2236              NativeFlv.promise = NativeFlv.promise || (0, _dom.loadScript)(settings.options.path);
2237              NativeFlv.promise.then(function () {
2238                  NativeFlv._createPlayer(settings);
2239              });
2240          }
2241  
2242          return NativeFlv.promise;
2243      },
2244  
2245      _createPlayer: function _createPlayer(settings) {
2246          flvjs.LoggingControl.enableDebug = settings.options.debug;
2247          flvjs.LoggingControl.enableVerbose = settings.options.debug;
2248          var player = flvjs.createPlayer(settings.options, settings.configs);
2249          _window2.default['__ready__' + settings.id](player);
2250          return player;
2251      }
2252  };
2253  
2254  var FlvNativeRenderer = {
2255      name: 'native_flv',
2256      options: {
2257          prefix: 'native_flv',
2258          flv: {
2259              path: 'https://cdn.jsdelivr.net/npm/flv.js@latest',
2260  
2261              cors: true,
2262              debug: false
2263          }
2264      },
2265  
2266      canPlayType: function canPlayType(type) {
2267          return _constants.HAS_MSE && ['video/x-flv', 'video/flv'].indexOf(type.toLowerCase()) > -1;
2268      },
2269  
2270      create: function create(mediaElement, options, mediaFiles) {
2271  
2272          var originalNode = mediaElement.originalNode,
2273              id = mediaElement.id + '_' + options.prefix;
2274  
2275          var node = null,
2276              flvPlayer = null;
2277  
2278          node = originalNode.cloneNode(true);
2279          options = Object.assign(options, mediaElement.options);
2280  
2281          var props = _mejs2.default.html5media.properties,
2282              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
2283              return e !== 'error';
2284          }),
2285              attachNativeEvents = function attachNativeEvents(e) {
2286              var event = (0, _general.createEvent)(e.type, mediaElement);
2287              mediaElement.dispatchEvent(event);
2288          },
2289              assignGettersSetters = function assignGettersSetters(propName) {
2290              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2291  
2292              node['get' + capName] = function () {
2293                  return flvPlayer !== null ? node[propName] : null;
2294              };
2295  
2296              node['set' + capName] = function (value) {
2297                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
2298                      if (propName === 'src') {
2299                          node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
2300                          if (flvPlayer !== null) {
2301                              var _flvOptions = {};
2302                              _flvOptions.type = 'flv';
2303                              _flvOptions.url = value;
2304                              _flvOptions.cors = options.flv.cors;
2305                              _flvOptions.debug = options.flv.debug;
2306                              _flvOptions.path = options.flv.path;
2307                              var _flvConfigs = options.flv.configs;
2308  
2309                              flvPlayer.destroy();
2310                              for (var i = 0, total = events.length; i < total; i++) {
2311                                  node.removeEventListener(events[i], attachNativeEvents);
2312                              }
2313                              flvPlayer = NativeFlv._createPlayer({
2314                                  options: _flvOptions,
2315                                  configs: _flvConfigs,
2316                                  id: id
2317                              });
2318                              flvPlayer.attachMediaElement(node);
2319                              flvPlayer.load();
2320                          }
2321                      } else {
2322                          node[propName] = value;
2323                      }
2324                  }
2325              };
2326          };
2327  
2328          for (var i = 0, total = props.length; i < total; i++) {
2329              assignGettersSetters(props[i]);
2330          }
2331  
2332          _window2.default['__ready__' + id] = function (_flvPlayer) {
2333              mediaElement.flvPlayer = flvPlayer = _flvPlayer;
2334  
2335              var flvEvents = flvjs.Events,
2336                  assignEvents = function assignEvents(eventName) {
2337                  if (eventName === 'loadedmetadata') {
2338                      flvPlayer.unload();
2339                      flvPlayer.detachMediaElement();
2340                      flvPlayer.attachMediaElement(node);
2341                      flvPlayer.load();
2342                  }
2343  
2344                  node.addEventListener(eventName, attachNativeEvents);
2345              };
2346  
2347              for (var _i = 0, _total = events.length; _i < _total; _i++) {
2348                  assignEvents(events[_i]);
2349              }
2350  
2351              var assignFlvEvents = function assignFlvEvents(name, data) {
2352                  if (name === 'error') {
2353                      var message = data[0] + ': ' + data[1] + ' ' + data[2].msg;
2354                      mediaElement.generateError(message, node.src);
2355                  } else {
2356                      var _event = (0, _general.createEvent)(name, mediaElement);
2357                      _event.data = data;
2358                      mediaElement.dispatchEvent(_event);
2359                  }
2360              };
2361  
2362              var _loop = function _loop(eventType) {
2363                  if (flvEvents.hasOwnProperty(eventType)) {
2364                      flvPlayer.on(flvEvents[eventType], function () {
2365                          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
2366                              args[_key] = arguments[_key];
2367                          }
2368  
2369                          return assignFlvEvents(flvEvents[eventType], args);
2370                      });
2371                  }
2372              };
2373  
2374              for (var eventType in flvEvents) {
2375                  _loop(eventType);
2376              }
2377          };
2378  
2379          if (mediaFiles && mediaFiles.length > 0) {
2380              for (var _i2 = 0, _total2 = mediaFiles.length; _i2 < _total2; _i2++) {
2381                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i2].type)) {
2382                      node.setAttribute('src', mediaFiles[_i2].src);
2383                      break;
2384                  }
2385              }
2386          }
2387  
2388          node.setAttribute('id', id);
2389  
2390          originalNode.parentNode.insertBefore(node, originalNode);
2391          originalNode.autoplay = false;
2392          originalNode.style.display = 'none';
2393  
2394          var flvOptions = {};
2395          flvOptions.type = 'flv';
2396          flvOptions.url = node.src;
2397          flvOptions.cors = options.flv.cors;
2398          flvOptions.debug = options.flv.debug;
2399          flvOptions.path = options.flv.path;
2400          var flvConfigs = options.flv.configs;
2401  
2402          node.setSize = function (width, height) {
2403              node.style.width = width + 'px';
2404              node.style.height = height + 'px';
2405              return node;
2406          };
2407  
2408          node.hide = function () {
2409              if (flvPlayer !== null) {
2410                  flvPlayer.pause();
2411              }
2412              node.style.display = 'none';
2413              return node;
2414          };
2415  
2416          node.show = function () {
2417              node.style.display = '';
2418              return node;
2419          };
2420  
2421          node.destroy = function () {
2422              if (flvPlayer !== null) {
2423                  flvPlayer.destroy();
2424              }
2425          };
2426  
2427          var event = (0, _general.createEvent)('rendererready', node);
2428          mediaElement.dispatchEvent(event);
2429  
2430          mediaElement.promises.push(NativeFlv.load({
2431              options: flvOptions,
2432              configs: flvConfigs,
2433              id: id
2434          }));
2435  
2436          return node;
2437      }
2438  };
2439  
2440  _media.typeChecks.push(function (url) {
2441      return ~url.toLowerCase().indexOf('.flv') ? 'video/flv' : null;
2442  });
2443  
2444  _renderer.renderer.add(FlvNativeRenderer);
2445  
2446  },{"10":10,"18":18,"19":19,"20":20,"21":21,"3":3,"9":9}],15:[function(_dereq_,module,exports){
2447  'use strict';
2448  
2449  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2450  
2451  var _window = _dereq_(3);
2452  
2453  var _window2 = _interopRequireDefault(_window);
2454  
2455  var _mejs = _dereq_(9);
2456  
2457  var _mejs2 = _interopRequireDefault(_mejs);
2458  
2459  var _renderer = _dereq_(10);
2460  
2461  var _general = _dereq_(20);
2462  
2463  var _constants = _dereq_(18);
2464  
2465  var _media = _dereq_(21);
2466  
2467  var _dom = _dereq_(19);
2468  
2469  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2470  
2471  var NativeHls = {
2472  
2473      promise: null,
2474  
2475      load: function load(settings) {
2476          if (typeof Hls !== 'undefined') {
2477              NativeHls.promise = new Promise(function (resolve) {
2478                  resolve();
2479              }).then(function () {
2480                  NativeHls._createPlayer(settings);
2481              });
2482          } else {
2483              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/hls.js@latest';
2484  
2485              NativeHls.promise = NativeHls.promise || (0, _dom.loadScript)(settings.options.path);
2486              NativeHls.promise.then(function () {
2487                  NativeHls._createPlayer(settings);
2488              });
2489          }
2490  
2491          return NativeHls.promise;
2492      },
2493  
2494      _createPlayer: function _createPlayer(settings) {
2495          var player = new Hls(settings.options);
2496          _window2.default['__ready__' + settings.id](player);
2497          return player;
2498      }
2499  };
2500  
2501  var HlsNativeRenderer = {
2502      name: 'native_hls',
2503      options: {
2504          prefix: 'native_hls',
2505          hls: {
2506              path: 'https://cdn.jsdelivr.net/npm/hls.js@latest',
2507  
2508              autoStartLoad: false,
2509              debug: false
2510          }
2511      },
2512  
2513      canPlayType: function canPlayType(type) {
2514          return _constants.HAS_MSE && ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) > -1;
2515      },
2516  
2517      create: function create(mediaElement, options, mediaFiles) {
2518  
2519          var originalNode = mediaElement.originalNode,
2520              id = mediaElement.id + '_' + options.prefix,
2521              preload = originalNode.getAttribute('preload'),
2522              autoplay = originalNode.autoplay;
2523  
2524          var hlsPlayer = null,
2525              node = null,
2526              index = 0,
2527              total = mediaFiles.length;
2528  
2529          node = originalNode.cloneNode(true);
2530          options = Object.assign(options, mediaElement.options);
2531          options.hls.autoStartLoad = preload && preload !== 'none' || autoplay;
2532  
2533          var props = _mejs2.default.html5media.properties,
2534              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
2535              return e !== 'error';
2536          }),
2537              attachNativeEvents = function attachNativeEvents(e) {
2538              var event = (0, _general.createEvent)(e.type, mediaElement);
2539              mediaElement.dispatchEvent(event);
2540          },
2541              assignGettersSetters = function assignGettersSetters(propName) {
2542              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2543  
2544              node['get' + capName] = function () {
2545                  return hlsPlayer !== null ? node[propName] : null;
2546              };
2547  
2548              node['set' + capName] = function (value) {
2549                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
2550                      if (propName === 'src') {
2551                          node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
2552                          if (hlsPlayer !== null) {
2553                              hlsPlayer.destroy();
2554                              for (var i = 0, _total = events.length; i < _total; i++) {
2555                                  node.removeEventListener(events[i], attachNativeEvents);
2556                              }
2557                              hlsPlayer = NativeHls._createPlayer({
2558                                  options: options.hls,
2559                                  id: id
2560                              });
2561                              hlsPlayer.loadSource(value);
2562                              hlsPlayer.attachMedia(node);
2563                          }
2564                      } else {
2565                          node[propName] = value;
2566                      }
2567                  }
2568              };
2569          };
2570  
2571          for (var i = 0, _total2 = props.length; i < _total2; i++) {
2572              assignGettersSetters(props[i]);
2573          }
2574  
2575          _window2.default['__ready__' + id] = function (_hlsPlayer) {
2576              mediaElement.hlsPlayer = hlsPlayer = _hlsPlayer;
2577              var hlsEvents = Hls.Events,
2578                  assignEvents = function assignEvents(eventName) {
2579                  if (eventName === 'loadedmetadata') {
2580                      var url = mediaElement.originalNode.src;
2581                      hlsPlayer.detachMedia();
2582                      hlsPlayer.loadSource(url);
2583                      hlsPlayer.attachMedia(node);
2584                  }
2585  
2586                  node.addEventListener(eventName, attachNativeEvents);
2587              };
2588  
2589              for (var _i = 0, _total3 = events.length; _i < _total3; _i++) {
2590                  assignEvents(events[_i]);
2591              }
2592  
2593              var recoverDecodingErrorDate = void 0,
2594                  recoverSwapAudioCodecDate = void 0;
2595              var assignHlsEvents = function assignHlsEvents(name, data) {
2596                  if (name === 'hlsError') {
2597                      console.warn(data);
2598                      data = data[1];
2599  
2600                      if (data.fatal) {
2601                          switch (data.type) {
2602                              case 'mediaError':
2603                                  var now = new Date().getTime();
2604                                  if (!recoverDecodingErrorDate || now - recoverDecodingErrorDate > 3000) {
2605                                      recoverDecodingErrorDate = new Date().getTime();
2606                                      hlsPlayer.recoverMediaError();
2607                                  } else if (!recoverSwapAudioCodecDate || now - recoverSwapAudioCodecDate > 3000) {
2608                                      recoverSwapAudioCodecDate = new Date().getTime();
2609                                      console.warn('Attempting to swap Audio Codec and recover from media error');
2610                                      hlsPlayer.swapAudioCodec();
2611                                      hlsPlayer.recoverMediaError();
2612                                  } else {
2613                                      var message = 'Cannot recover, last media error recovery failed';
2614                                      mediaElement.generateError(message, node.src);
2615                                      console.error(message);
2616                                  }
2617                                  break;
2618                              case 'networkError':
2619                                  if (data.details === 'manifestLoadError') {
2620                                      if (index < total && mediaFiles[index + 1] !== undefined) {
2621                                          node.setSrc(mediaFiles[index++].src);
2622                                          node.load();
2623                                          node.play();
2624                                      } else {
2625                                          var _message = 'Network error';
2626                                          mediaElement.generateError(_message, mediaFiles);
2627                                          console.error(_message);
2628                                      }
2629                                  } else {
2630                                      var _message2 = 'Network error';
2631                                      mediaElement.generateError(_message2, mediaFiles);
2632                                      console.error(_message2);
2633                                  }
2634                                  break;
2635                              default:
2636                                  hlsPlayer.destroy();
2637                                  break;
2638                          }
2639                          return;
2640                      }
2641                  }
2642                  var event = (0, _general.createEvent)(name, mediaElement);
2643                  event.data = data;
2644                  mediaElement.dispatchEvent(event);
2645              };
2646  
2647              var _loop = function _loop(eventType) {
2648                  if (hlsEvents.hasOwnProperty(eventType)) {
2649                      hlsPlayer.on(hlsEvents[eventType], function () {
2650                          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
2651                              args[_key] = arguments[_key];
2652                          }
2653  
2654                          return assignHlsEvents(hlsEvents[eventType], args);
2655                      });
2656                  }
2657              };
2658  
2659              for (var eventType in hlsEvents) {
2660                  _loop(eventType);
2661              }
2662          };
2663  
2664          if (total > 0) {
2665              for (; index < total; index++) {
2666                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
2667                      node.setAttribute('src', mediaFiles[index].src);
2668                      break;
2669                  }
2670              }
2671          }
2672  
2673          if (preload !== 'auto' && !autoplay) {
2674              node.addEventListener('play', function () {
2675                  if (hlsPlayer !== null) {
2676                      hlsPlayer.startLoad();
2677                  }
2678              });
2679  
2680              node.addEventListener('pause', function () {
2681                  if (hlsPlayer !== null) {
2682                      hlsPlayer.stopLoad();
2683                  }
2684              });
2685          }
2686  
2687          node.setAttribute('id', id);
2688  
2689          originalNode.parentNode.insertBefore(node, originalNode);
2690          originalNode.autoplay = false;
2691          originalNode.style.display = 'none';
2692  
2693          node.setSize = function (width, height) {
2694              node.style.width = width + 'px';
2695              node.style.height = height + 'px';
2696              return node;
2697          };
2698  
2699          node.hide = function () {
2700              node.pause();
2701              node.style.display = 'none';
2702              return node;
2703          };
2704  
2705          node.show = function () {
2706              node.style.display = '';
2707              return node;
2708          };
2709  
2710          node.destroy = function () {
2711              if (hlsPlayer !== null) {
2712                  hlsPlayer.stopLoad();
2713                  hlsPlayer.destroy();
2714              }
2715          };
2716  
2717          var event = (0, _general.createEvent)('rendererready', node);
2718          mediaElement.dispatchEvent(event);
2719  
2720          mediaElement.promises.push(NativeHls.load({
2721              options: options.hls,
2722              id: id
2723          }));
2724  
2725          return node;
2726      }
2727  };
2728  
2729  _media.typeChecks.push(function (url) {
2730      return ~url.toLowerCase().indexOf('.m3u8') ? 'application/x-mpegURL' : null;
2731  });
2732  
2733  _renderer.renderer.add(HlsNativeRenderer);
2734  
2735  },{"10":10,"18":18,"19":19,"20":20,"21":21,"3":3,"9":9}],16:[function(_dereq_,module,exports){
2736  'use strict';
2737  
2738  var _window = _dereq_(3);
2739  
2740  var _window2 = _interopRequireDefault(_window);
2741  
2742  var _document = _dereq_(2);
2743  
2744  var _document2 = _interopRequireDefault(_document);
2745  
2746  var _mejs = _dereq_(9);
2747  
2748  var _mejs2 = _interopRequireDefault(_mejs);
2749  
2750  var _renderer = _dereq_(10);
2751  
2752  var _general = _dereq_(20);
2753  
2754  var _constants = _dereq_(18);
2755  
2756  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2757  
2758  var HtmlMediaElement = {
2759      name: 'html5',
2760      options: {
2761          prefix: 'html5'
2762      },
2763  
2764      canPlayType: function canPlayType(type) {
2765  
2766          var mediaElement = _document2.default.createElement('video');
2767  
2768          if (_constants.IS_ANDROID && /\/mp(3|4)$/i.test(type) || ~['application/x-mpegurl', 'vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) && _constants.SUPPORTS_NATIVE_HLS) {
2769              return 'yes';
2770          } else if (mediaElement.canPlayType) {
2771              return mediaElement.canPlayType(type.toLowerCase()).replace(/no/, '');
2772          } else {
2773              return '';
2774          }
2775      },
2776  
2777      create: function create(mediaElement, options, mediaFiles) {
2778  
2779          var id = mediaElement.id + '_' + options.prefix;
2780          var isActive = false;
2781  
2782          var node = null;
2783  
2784          if (mediaElement.originalNode === undefined || mediaElement.originalNode === null) {
2785              node = _document2.default.createElement('audio');
2786              mediaElement.appendChild(node);
2787          } else {
2788              node = mediaElement.originalNode;
2789          }
2790  
2791          node.setAttribute('id', id);
2792  
2793          var props = _mejs2.default.html5media.properties,
2794              assignGettersSetters = function assignGettersSetters(propName) {
2795              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2796  
2797              node['get' + capName] = function () {
2798                  return node[propName];
2799              };
2800  
2801              node['set' + capName] = function (value) {
2802                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
2803                      node[propName] = value;
2804                  }
2805              };
2806          };
2807  
2808          for (var i = 0, _total = props.length; i < _total; i++) {
2809              assignGettersSetters(props[i]);
2810          }
2811  
2812          var events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
2813              return e !== 'error';
2814          }),
2815              assignEvents = function assignEvents(eventName) {
2816              node.addEventListener(eventName, function (e) {
2817                  if (isActive) {
2818                      var _event = (0, _general.createEvent)(e.type, e.target);
2819                      mediaElement.dispatchEvent(_event);
2820                  }
2821              });
2822          };
2823  
2824          for (var _i = 0, _total2 = events.length; _i < _total2; _i++) {
2825              assignEvents(events[_i]);
2826          }
2827  
2828          node.setSize = function (width, height) {
2829              node.style.width = width + 'px';
2830              node.style.height = height + 'px';
2831              return node;
2832          };
2833  
2834          node.hide = function () {
2835              isActive = false;
2836              node.style.display = 'none';
2837  
2838              return node;
2839          };
2840  
2841          node.show = function () {
2842              isActive = true;
2843              node.style.display = '';
2844  
2845              return node;
2846          };
2847  
2848          var index = 0,
2849              total = mediaFiles.length;
2850          if (total > 0) {
2851              for (; index < total; index++) {
2852                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
2853                      node.setAttribute('src', mediaFiles[index].src);
2854                      break;
2855                  }
2856              }
2857          }
2858  
2859          node.addEventListener('error', function (e) {
2860              if (e.target.error.code === 4 && isActive) {
2861                  if (index < total && mediaFiles[index + 1] !== undefined) {
2862                      node.src = mediaFiles[index++].src;
2863                      node.load();
2864                      node.play();
2865                  } else {
2866                      mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles);
2867                  }
2868              }
2869          });
2870  
2871          var event = (0, _general.createEvent)('rendererready', node);
2872          mediaElement.dispatchEvent(event);
2873  
2874          return node;
2875      }
2876  };
2877  
2878  _window2.default.HtmlMediaElement = _mejs2.default.HtmlMediaElement = HtmlMediaElement;
2879  
2880  _renderer.renderer.add(HtmlMediaElement);
2881  
2882  },{"10":10,"18":18,"2":2,"20":20,"3":3,"9":9}],17:[function(_dereq_,module,exports){
2883  'use strict';
2884  
2885  var _window = _dereq_(3);
2886  
2887  var _window2 = _interopRequireDefault(_window);
2888  
2889  var _document = _dereq_(2);
2890  
2891  var _document2 = _interopRequireDefault(_document);
2892  
2893  var _mejs = _dereq_(9);
2894  
2895  var _mejs2 = _interopRequireDefault(_mejs);
2896  
2897  var _renderer = _dereq_(10);
2898  
2899  var _general = _dereq_(20);
2900  
2901  var _media = _dereq_(21);
2902  
2903  var _dom = _dereq_(19);
2904  
2905  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2906  
2907  var YouTubeApi = {
2908      isIframeStarted: false,
2909  
2910      isIframeLoaded: false,
2911  
2912      iframeQueue: [],
2913  
2914      enqueueIframe: function enqueueIframe(settings) {
2915          YouTubeApi.isLoaded = typeof YT !== 'undefined' && YT.loaded;
2916  
2917          if (YouTubeApi.isLoaded) {
2918              YouTubeApi.createIframe(settings);
2919          } else {
2920              YouTubeApi.loadIframeApi();
2921              YouTubeApi.iframeQueue.push(settings);
2922          }
2923      },
2924  
2925      loadIframeApi: function loadIframeApi() {
2926          if (!YouTubeApi.isIframeStarted) {
2927              (0, _dom.loadScript)('https://www.youtube.com/player_api');
2928              YouTubeApi.isIframeStarted = true;
2929          }
2930      },
2931  
2932      iFrameReady: function iFrameReady() {
2933  
2934          YouTubeApi.isLoaded = true;
2935          YouTubeApi.isIframeLoaded = true;
2936  
2937          while (YouTubeApi.iframeQueue.length > 0) {
2938              var settings = YouTubeApi.iframeQueue.pop();
2939              YouTubeApi.createIframe(settings);
2940          }
2941      },
2942  
2943      createIframe: function createIframe(settings) {
2944          return new YT.Player(settings.containerId, settings);
2945      },
2946  
2947      getYouTubeId: function getYouTubeId(url) {
2948  
2949          var youTubeId = '';
2950  
2951          if (url.indexOf('?') > 0) {
2952              youTubeId = YouTubeApi.getYouTubeIdFromParam(url);
2953  
2954              if (youTubeId === '') {
2955                  youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
2956              }
2957          } else {
2958              youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
2959          }
2960  
2961          var id = youTubeId.substring(youTubeId.lastIndexOf('/') + 1);
2962          youTubeId = id.split('?');
2963          return youTubeId[0];
2964      },
2965  
2966      getYouTubeIdFromParam: function getYouTubeIdFromParam(url) {
2967  
2968          if (url === undefined || url === null || !url.trim().length) {
2969              return null;
2970          }
2971  
2972          var parts = url.split('?'),
2973              parameters = parts[1].split('&');
2974  
2975          var youTubeId = '';
2976  
2977          for (var i = 0, total = parameters.length; i < total; i++) {
2978              var paramParts = parameters[i].split('=');
2979              if (paramParts[0] === 'v') {
2980                  youTubeId = paramParts[1];
2981                  break;
2982              }
2983          }
2984  
2985          return youTubeId;
2986      },
2987  
2988      getYouTubeIdFromUrl: function getYouTubeIdFromUrl(url) {
2989  
2990          if (url === undefined || url === null || !url.trim().length) {
2991              return null;
2992          }
2993  
2994          var parts = url.split('?');
2995          url = parts[0];
2996          return url.substring(url.lastIndexOf('/') + 1);
2997      },
2998  
2999      getYouTubeNoCookieUrl: function getYouTubeNoCookieUrl(url) {
3000          if (url === undefined || url === null || !url.trim().length || url.indexOf('//www.youtube') === -1) {
3001              return url;
3002          }
3003  
3004          var parts = url.split('/');
3005          parts[2] = parts[2].replace('.com', '-nocookie.com');
3006          return parts.join('/');
3007      }
3008  };
3009  
3010  var YouTubeIframeRenderer = {
3011      name: 'youtube_iframe',
3012  
3013      options: {
3014          prefix: 'youtube_iframe',
3015  
3016          youtube: {
3017              autoplay: 0,
3018              controls: 0,
3019              disablekb: 1,
3020              end: 0,
3021              loop: 0,
3022              modestbranding: 0,
3023              playsinline: 0,
3024              rel: 0,
3025              showinfo: 0,
3026              start: 0,
3027              iv_load_policy: 3,
3028  
3029              nocookie: false,
3030  
3031              imageQuality: null
3032          }
3033      },
3034  
3035      canPlayType: function canPlayType(type) {
3036          return ~['video/youtube', 'video/x-youtube'].indexOf(type.toLowerCase());
3037      },
3038  
3039      create: function create(mediaElement, options, mediaFiles) {
3040  
3041          var youtube = {},
3042              apiStack = [],
3043              readyState = 4;
3044  
3045          var youTubeApi = null,
3046              paused = true,
3047              ended = false,
3048              youTubeIframe = null,
3049              volume = 1;
3050  
3051          youtube.options = options;
3052          youtube.id = mediaElement.id + '_' + options.prefix;
3053          youtube.mediaElement = mediaElement;
3054  
3055          var props = _mejs2.default.html5media.properties,
3056              assignGettersSetters = function assignGettersSetters(propName) {
3057  
3058              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
3059  
3060              youtube['get' + capName] = function () {
3061                  if (youTubeApi !== null) {
3062                      var value = null;
3063  
3064                      switch (propName) {
3065                          case 'currentTime':
3066                              return youTubeApi.getCurrentTime();
3067                          case 'duration':
3068                              return youTubeApi.getDuration();
3069                          case 'volume':
3070                              volume = youTubeApi.getVolume() / 100;
3071                              return volume;
3072                          case 'playbackRate':
3073                              return youTubeApi.getPlaybackRate();
3074                          case 'paused':
3075                              return paused;
3076                          case 'ended':
3077                              return ended;
3078                          case 'muted':
3079                              return youTubeApi.isMuted();
3080                          case 'buffered':
3081                              var percentLoaded = youTubeApi.getVideoLoadedFraction(),
3082                                  duration = youTubeApi.getDuration();
3083                              return {
3084                                  start: function start() {
3085                                      return 0;
3086                                  },
3087                                  end: function end() {
3088                                      return percentLoaded * duration;
3089                                  },
3090                                  length: 1
3091                              };
3092                          case 'src':
3093                              return youTubeApi.getVideoUrl();
3094                          case 'readyState':
3095                              return readyState;
3096                      }
3097  
3098                      return value;
3099                  } else {
3100                      return null;
3101                  }
3102              };
3103  
3104              youtube['set' + capName] = function (value) {
3105                  if (youTubeApi !== null) {
3106                      switch (propName) {
3107                          case 'src':
3108                              var url = typeof value === 'string' ? value : value[0].src,
3109                                  _videoId = YouTubeApi.getYouTubeId(url);
3110  
3111                              if (mediaElement.originalNode.autoplay) {
3112                                  youTubeApi.loadVideoById(_videoId);
3113                              } else {
3114                                  youTubeApi.cueVideoById(_videoId);
3115                              }
3116                              break;
3117                          case 'currentTime':
3118                              youTubeApi.seekTo(value);
3119                              break;
3120                          case 'muted':
3121                              if (value) {
3122                                  youTubeApi.mute();
3123                              } else {
3124                                  youTubeApi.unMute();
3125                              }
3126                              setTimeout(function () {
3127                                  var event = (0, _general.createEvent)('volumechange', youtube);
3128                                  mediaElement.dispatchEvent(event);
3129                              }, 50);
3130                              break;
3131                          case 'volume':
3132                              volume = value;
3133                              youTubeApi.setVolume(value * 100);
3134                              setTimeout(function () {
3135                                  var event = (0, _general.createEvent)('volumechange', youtube);
3136                                  mediaElement.dispatchEvent(event);
3137                              }, 50);
3138                              break;
3139                          case 'playbackRate':
3140                              youTubeApi.setPlaybackRate(value);
3141                              setTimeout(function () {
3142                                  var event = (0, _general.createEvent)('ratechange', youtube);
3143                                  mediaElement.dispatchEvent(event);
3144                              }, 50);
3145                              break;
3146                          case 'readyState':
3147                              var event = (0, _general.createEvent)('canplay', youtube);
3148                              mediaElement.dispatchEvent(event);
3149                              break;
3150                          default:
3151                              
3152                              break;
3153                      }
3154                  } else {
3155                      apiStack.push({ type: 'set', propName: propName, value: value });
3156                  }
3157              };
3158          };
3159  
3160          for (var i = 0, total = props.length; i < total; i++) {
3161              assignGettersSetters(props[i]);
3162          }
3163  
3164          var methods = _mejs2.default.html5media.methods,
3165              assignMethods = function assignMethods(methodName) {
3166              youtube[methodName] = function () {
3167                  if (youTubeApi !== null) {
3168                      switch (methodName) {
3169                          case 'play':
3170                              paused = false;
3171                              return youTubeApi.playVideo();
3172                          case 'pause':
3173                              paused = true;
3174                              return youTubeApi.pauseVideo();
3175                          case 'load':
3176                              return null;
3177                      }
3178                  } else {
3179                      apiStack.push({ type: 'call', methodName: methodName });
3180                  }
3181              };
3182          };
3183  
3184          for (var _i = 0, _total = methods.length; _i < _total; _i++) {
3185              assignMethods(methods[_i]);
3186          }
3187  
3188          var errorHandler = function errorHandler(error) {
3189              var message = '';
3190              switch (error.data) {
3191                  case 2:
3192                      message = 'The request contains an invalid parameter value. Verify that video ID has 11 characters and that contains no invalid characters, such as exclamation points or asterisks.';
3193                      break;
3194                  case 5:
3195                      message = 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.';
3196                      break;
3197                  case 100:
3198                      message = 'The video requested was not found. Either video has been removed or has been marked as private.';
3199                      break;
3200                  case 101:
3201                  case 105:
3202                      message = 'The owner of the requested video does not allow it to be played in embedded players.';
3203                      break;
3204                  default:
3205                      message = 'Unknown error.';
3206                      break;
3207              }
3208              mediaElement.generateError('Code ' + error.data + ': ' + message, mediaFiles);
3209          };
3210  
3211          var youtubeContainer = _document2.default.createElement('div');
3212          youtubeContainer.id = youtube.id;
3213  
3214          if (youtube.options.youtube.nocookie) {
3215              mediaElement.originalNode.src = YouTubeApi.getYouTubeNoCookieUrl(mediaFiles[0].src);
3216          }
3217  
3218          mediaElement.originalNode.parentNode.insertBefore(youtubeContainer, mediaElement.originalNode);
3219          mediaElement.originalNode.style.display = 'none';
3220  
3221          var isAudio = mediaElement.originalNode.tagName.toLowerCase() === 'audio',
3222              height = isAudio ? '1' : mediaElement.originalNode.height,
3223              width = isAudio ? '1' : mediaElement.originalNode.width,
3224              videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src),
3225              youtubeSettings = {
3226              id: youtube.id,
3227              containerId: youtubeContainer.id,
3228              videoId: videoId,
3229              height: height,
3230              width: width,
3231              playerVars: Object.assign({
3232                  controls: 0,
3233                  rel: 0,
3234                  disablekb: 1,
3235                  showinfo: 0,
3236                  modestbranding: 0,
3237                  html5: 1,
3238                  iv_load_policy: 3
3239              }, youtube.options.youtube),
3240              origin: _window2.default.location.host,
3241              events: {
3242                  onReady: function onReady(e) {
3243                      mediaElement.youTubeApi = youTubeApi = e.target;
3244                      mediaElement.youTubeState = {
3245                          paused: true,
3246                          ended: false
3247                      };
3248  
3249                      if (apiStack.length) {
3250                          for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
3251  
3252                              var stackItem = apiStack[_i2];
3253  
3254                              if (stackItem.type === 'set') {
3255                                  var propName = stackItem.propName,
3256                                      capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
3257  
3258                                  youtube['set' + capName](stackItem.value);
3259                              } else if (stackItem.type === 'call') {
3260                                  youtube[stackItem.methodName]();
3261                              }
3262                          }
3263                      }
3264  
3265                      youTubeIframe = youTubeApi.getIframe();
3266  
3267                      if (mediaElement.originalNode.muted) {
3268                          youTubeApi.mute();
3269                      }
3270  
3271                      var events = ['mouseover', 'mouseout'],
3272                          assignEvents = function assignEvents(e) {
3273                          var newEvent = (0, _general.createEvent)(e.type, youtube);
3274                          mediaElement.dispatchEvent(newEvent);
3275                      };
3276  
3277                      for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
3278                          youTubeIframe.addEventListener(events[_i3], assignEvents, false);
3279                      }
3280  
3281                      var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
3282  
3283                      for (var _i4 = 0, _total4 = initEvents.length; _i4 < _total4; _i4++) {
3284                          var event = (0, _general.createEvent)(initEvents[_i4], youtube);
3285                          mediaElement.dispatchEvent(event);
3286                      }
3287                  },
3288                  onStateChange: function onStateChange(e) {
3289                      var events = [];
3290  
3291                      switch (e.data) {
3292                          case -1:
3293                              events = ['loadedmetadata'];
3294                              paused = true;
3295                              ended = false;
3296                              break;
3297                          case 0:
3298                              events = ['ended'];
3299                              paused = false;
3300                              ended = !youtube.options.youtube.loop;
3301                              if (!youtube.options.youtube.loop) {
3302                                  youtube.stopInterval();
3303                              }
3304                              break;
3305                          case 1:
3306                              events = ['play', 'playing'];
3307                              paused = false;
3308                              ended = false;
3309                              youtube.startInterval();
3310                              break;
3311                          case 2:
3312                              events = ['pause'];
3313                              paused = true;
3314                              ended = false;
3315                              youtube.stopInterval();
3316                              break;
3317                          case 3:
3318                              events = ['progress'];
3319                              ended = false;
3320                              break;
3321                          case 5:
3322                              events = ['loadeddata', 'loadedmetadata', 'canplay'];
3323                              paused = true;
3324                              ended = false;
3325                              break;
3326                      }
3327  
3328                      for (var _i5 = 0, _total5 = events.length; _i5 < _total5; _i5++) {
3329                          var event = (0, _general.createEvent)(events[_i5], youtube);
3330                          mediaElement.dispatchEvent(event);
3331                      }
3332                  },
3333                  onError: function onError(e) {
3334                      return errorHandler(e);
3335                  }
3336              }
3337          };
3338  
3339          if (isAudio || mediaElement.originalNode.hasAttribute('playsinline')) {
3340              youtubeSettings.playerVars.playsinline = 1;
3341          }
3342  
3343          if (mediaElement.originalNode.controls) {
3344              youtubeSettings.playerVars.controls = 1;
3345          }
3346          if (mediaElement.originalNode.autoplay) {
3347              youtubeSettings.playerVars.autoplay = 1;
3348          }
3349          if (mediaElement.originalNode.loop) {
3350              youtubeSettings.playerVars.loop = 1;
3351          }
3352  
3353          if ((youtubeSettings.playerVars.loop && parseInt(youtubeSettings.playerVars.loop, 10) === 1 || mediaElement.originalNode.src.indexOf('loop=') > -1) && !youtubeSettings.playerVars.playlist && mediaElement.originalNode.src.indexOf('playlist=') === -1) {
3354              youtubeSettings.playerVars.playlist = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
3355          }
3356  
3357          YouTubeApi.enqueueIframe(youtubeSettings);
3358  
3359          youtube.onEvent = function (eventName, player, _youTubeState) {
3360              if (_youTubeState !== null && _youTubeState !== undefined) {
3361                  mediaElement.youTubeState = _youTubeState;
3362              }
3363          };
3364  
3365          youtube.setSize = function (width, height) {
3366              if (youTubeApi !== null) {
3367                  youTubeApi.setSize(width, height);
3368              }
3369          };
3370          youtube.hide = function () {
3371              youtube.stopInterval();
3372              youtube.pause();
3373              if (youTubeIframe) {
3374                  youTubeIframe.style.display = 'none';
3375              }
3376          };
3377          youtube.show = function () {
3378              if (youTubeIframe) {
3379                  youTubeIframe.style.display = '';
3380              }
3381          };
3382          youtube.destroy = function () {
3383              youTubeApi.destroy();
3384          };
3385          youtube.interval = null;
3386  
3387          youtube.startInterval = function () {
3388              youtube.interval = setInterval(function () {
3389                  var event = (0, _general.createEvent)('timeupdate', youtube);
3390                  mediaElement.dispatchEvent(event);
3391              }, 250);
3392          };
3393          youtube.stopInterval = function () {
3394              if (youtube.interval) {
3395                  clearInterval(youtube.interval);
3396              }
3397          };
3398          youtube.getPosterUrl = function () {
3399              var quality = options.youtube.imageQuality,
3400                  resolutions = ['default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault'],
3401                  id = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
3402              return quality && resolutions.indexOf(quality) > -1 && id ? 'https://img.youtube.com/vi/' + id + '/' + quality + '.jpg' : '';
3403          };
3404  
3405          return youtube;
3406      }
3407  };
3408  
3409  _window2.default.onYouTubePlayerAPIReady = function () {
3410      YouTubeApi.iFrameReady();
3411  };
3412  
3413  _media.typeChecks.push(function (url) {
3414      return (/\/\/(www\.youtube|youtu\.?be)/i.test(url) ? 'video/x-youtube' : null
3415      );
3416  });
3417  
3418  _renderer.renderer.add(YouTubeIframeRenderer);
3419  
3420  },{"10":10,"19":19,"2":2,"20":20,"21":21,"3":3,"9":9}],18:[function(_dereq_,module,exports){
3421  'use strict';
3422  
3423  Object.defineProperty(exports, "__esModule", {
3424      value: true
3425  });
3426  exports.cancelFullScreen = exports.requestFullScreen = exports.isFullScreen = exports.FULLSCREEN_EVENT_NAME = exports.HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = exports.SUPPORTS_NATIVE_HLS = exports.SUPPORT_PASSIVE_EVENT = exports.SUPPORT_POINTER_EVENTS = exports.HAS_MSE = exports.IS_STOCK_ANDROID = exports.IS_SAFARI = exports.IS_FIREFOX = exports.IS_CHROME = exports.IS_EDGE = exports.IS_IE = exports.IS_ANDROID = exports.IS_IOS = exports.IS_IPOD = exports.IS_IPHONE = exports.IS_IPAD = exports.UA = exports.NAV = undefined;
3427  
3428  var _window = _dereq_(3);
3429  
3430  var _window2 = _interopRequireDefault(_window);
3431  
3432  var _document = _dereq_(2);
3433  
3434  var _document2 = _interopRequireDefault(_document);
3435  
3436  var _mejs = _dereq_(9);
3437  
3438  var _mejs2 = _interopRequireDefault(_mejs);
3439  
3440  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3441  
3442  var NAV = exports.NAV = _window2.default.navigator;
3443  var UA = exports.UA = NAV.userAgent.toLowerCase();
3444  var IS_IPAD = exports.IS_IPAD = /ipad/i.test(UA) && !_window2.default.MSStream;
3445  var IS_IPHONE = exports.IS_IPHONE = /iphone/i.test(UA) && !_window2.default.MSStream;
3446  var IS_IPOD = exports.IS_IPOD = /ipod/i.test(UA) && !_window2.default.MSStream;
3447  var IS_IOS = exports.IS_IOS = /ipad|iphone|ipod/i.test(UA) && !_window2.default.MSStream;
3448  var IS_ANDROID = exports.IS_ANDROID = /android/i.test(UA);
3449  var IS_IE = exports.IS_IE = /(trident|microsoft)/i.test(NAV.appName);
3450  var IS_EDGE = exports.IS_EDGE = 'msLaunchUri' in NAV && !('documentMode' in _document2.default);
3451  var IS_CHROME = exports.IS_CHROME = /chrome/i.test(UA);
3452  var IS_FIREFOX = exports.IS_FIREFOX = /firefox/i.test(UA);
3453  var IS_SAFARI = exports.IS_SAFARI = /safari/i.test(UA) && !IS_CHROME;
3454  var IS_STOCK_ANDROID = exports.IS_STOCK_ANDROID = /^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(UA);
3455  var HAS_MSE = exports.HAS_MSE = 'MediaSource' in _window2.default;
3456  var SUPPORT_POINTER_EVENTS = exports.SUPPORT_POINTER_EVENTS = function () {
3457      var element = _document2.default.createElement('x'),
3458          documentElement = _document2.default.documentElement,
3459          getComputedStyle = _window2.default.getComputedStyle;
3460  
3461      if (!('pointerEvents' in element.style)) {
3462          return false;
3463      }
3464  
3465      element.style.pointerEvents = 'auto';
3466      element.style.pointerEvents = 'x';
3467      documentElement.appendChild(element);
3468      var supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto';
3469      element.remove();
3470      return !!supports;
3471  }();
3472  
3473  var SUPPORT_PASSIVE_EVENT = exports.SUPPORT_PASSIVE_EVENT = function () {
3474      var supportsPassive = false;
3475      try {
3476          var opts = Object.defineProperty({}, 'passive', {
3477              get: function get() {
3478                  supportsPassive = true;
3479              }
3480          });
3481          _window2.default.addEventListener('test', null, opts);
3482      } catch (e) {}
3483  
3484      return supportsPassive;
3485  }();
3486  
3487  var html5Elements = ['source', 'track', 'audio', 'video'];
3488  var video = void 0;
3489  
3490  for (var i = 0, total = html5Elements.length; i < total; i++) {
3491      video = _document2.default.createElement(html5Elements[i]);
3492  }
3493  
3494  var SUPPORTS_NATIVE_HLS = exports.SUPPORTS_NATIVE_HLS = IS_SAFARI || IS_ANDROID && (IS_CHROME || IS_STOCK_ANDROID) || IS_IE && /edge/i.test(UA);
3495  
3496  var hasiOSFullScreen = video.webkitEnterFullscreen !== undefined;
3497  
3498  var hasNativeFullscreen = video.requestFullscreen !== undefined;
3499  
3500  if (hasiOSFullScreen && /mac os x 10_5/i.test(UA)) {
3501      hasNativeFullscreen = false;
3502      hasiOSFullScreen = false;
3503  }
3504  
3505  var hasWebkitNativeFullScreen = video.webkitRequestFullScreen !== undefined;
3506  var hasMozNativeFullScreen = video.mozRequestFullScreen !== undefined;
3507  var hasMsNativeFullScreen = video.msRequestFullscreen !== undefined;
3508  var hasTrueNativeFullScreen = hasWebkitNativeFullScreen || hasMozNativeFullScreen || hasMsNativeFullScreen;
3509  var nativeFullScreenEnabled = hasTrueNativeFullScreen;
3510  var fullScreenEventName = '';
3511  var isFullScreen = void 0,
3512      requestFullScreen = void 0,
3513      cancelFullScreen = void 0;
3514  
3515  if (hasMozNativeFullScreen) {
3516      nativeFullScreenEnabled = _document2.default.mozFullScreenEnabled;
3517  } else if (hasMsNativeFullScreen) {
3518      nativeFullScreenEnabled = _document2.default.msFullscreenEnabled;
3519  }
3520  
3521  if (IS_CHROME) {
3522      hasiOSFullScreen = false;
3523  }
3524  
3525  if (hasTrueNativeFullScreen) {
3526      if (hasWebkitNativeFullScreen) {
3527          fullScreenEventName = 'webkitfullscreenchange';
3528      } else if (hasMozNativeFullScreen) {
3529          fullScreenEventName = 'mozfullscreenchange';
3530      } else if (hasMsNativeFullScreen) {
3531          fullScreenEventName = 'MSFullscreenChange';
3532      }
3533  
3534      exports.isFullScreen = isFullScreen = function isFullScreen() {
3535          if (hasMozNativeFullScreen) {
3536              return _document2.default.mozFullScreen;
3537          } else if (hasWebkitNativeFullScreen) {
3538              return _document2.default.webkitIsFullScreen;
3539          } else if (hasMsNativeFullScreen) {
3540              return _document2.default.msFullscreenElement !== null;
3541          }
3542      };
3543  
3544      exports.requestFullScreen = requestFullScreen = function requestFullScreen(el) {
3545          if (hasWebkitNativeFullScreen) {
3546              el.webkitRequestFullScreen();
3547          } else if (hasMozNativeFullScreen) {
3548              el.mozRequestFullScreen();
3549          } else if (hasMsNativeFullScreen) {
3550              el.msRequestFullscreen();
3551          }
3552      };
3553  
3554      exports.cancelFullScreen = cancelFullScreen = function cancelFullScreen() {
3555          if (hasWebkitNativeFullScreen) {
3556              _document2.default.webkitCancelFullScreen();
3557          } else if (hasMozNativeFullScreen) {
3558              _document2.default.mozCancelFullScreen();
3559          } else if (hasMsNativeFullScreen) {
3560              _document2.default.msExitFullscreen();
3561          }
3562      };
3563  }
3564  
3565  var HAS_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = hasNativeFullscreen;
3566  var HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = hasWebkitNativeFullScreen;
3567  var HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = hasMozNativeFullScreen;
3568  var HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = hasMsNativeFullScreen;
3569  var HAS_IOS_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = hasiOSFullScreen;
3570  var HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_TRUE_NATIVE_FULLSCREEN = hasTrueNativeFullScreen;
3571  var HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_NATIVE_FULLSCREEN_ENABLED = nativeFullScreenEnabled;
3572  var FULLSCREEN_EVENT_NAME = exports.FULLSCREEN_EVENT_NAME = fullScreenEventName;
3573  exports.isFullScreen = isFullScreen;
3574  exports.requestFullScreen = requestFullScreen;
3575  exports.cancelFullScreen = cancelFullScreen;
3576  
3577  
3578  _mejs2.default.Features = _mejs2.default.Features || {};
3579  _mejs2.default.Features.isiPad = IS_IPAD;
3580  _mejs2.default.Features.isiPod = IS_IPOD;
3581  _mejs2.default.Features.isiPhone = IS_IPHONE;
3582  _mejs2.default.Features.isiOS = _mejs2.default.Features.isiPhone || _mejs2.default.Features.isiPad;
3583  _mejs2.default.Features.isAndroid = IS_ANDROID;
3584  _mejs2.default.Features.isIE = IS_IE;
3585  _mejs2.default.Features.isEdge = IS_EDGE;
3586  _mejs2.default.Features.isChrome = IS_CHROME;
3587  _mejs2.default.Features.isFirefox = IS_FIREFOX;
3588  _mejs2.default.Features.isSafari = IS_SAFARI;
3589  _mejs2.default.Features.isStockAndroid = IS_STOCK_ANDROID;
3590  _mejs2.default.Features.hasMSE = HAS_MSE;
3591  _mejs2.default.Features.supportsNativeHLS = SUPPORTS_NATIVE_HLS;
3592  _mejs2.default.Features.supportsPointerEvents = SUPPORT_POINTER_EVENTS;
3593  _mejs2.default.Features.supportsPassiveEvent = SUPPORT_PASSIVE_EVENT;
3594  _mejs2.default.Features.hasiOSFullScreen = HAS_IOS_FULLSCREEN;
3595  _mejs2.default.Features.hasNativeFullscreen = HAS_NATIVE_FULLSCREEN;
3596  _mejs2.default.Features.hasWebkitNativeFullScreen = HAS_WEBKIT_NATIVE_FULLSCREEN;
3597  _mejs2.default.Features.hasMozNativeFullScreen = HAS_MOZ_NATIVE_FULLSCREEN;
3598  _mejs2.default.Features.hasMsNativeFullScreen = HAS_MS_NATIVE_FULLSCREEN;
3599  _mejs2.default.Features.hasTrueNativeFullScreen = HAS_TRUE_NATIVE_FULLSCREEN;
3600  _mejs2.default.Features.nativeFullScreenEnabled = HAS_NATIVE_FULLSCREEN_ENABLED;
3601  _mejs2.default.Features.fullScreenEventName = FULLSCREEN_EVENT_NAME;
3602  _mejs2.default.Features.isFullScreen = isFullScreen;
3603  _mejs2.default.Features.requestFullScreen = requestFullScreen;
3604  _mejs2.default.Features.cancelFullScreen = cancelFullScreen;
3605  
3606  },{"2":2,"3":3,"9":9}],19:[function(_dereq_,module,exports){
3607  'use strict';
3608  
3609  Object.defineProperty(exports, "__esModule", {
3610      value: true
3611  });
3612  exports.removeClass = exports.addClass = exports.hasClass = undefined;
3613  exports.loadScript = loadScript;
3614  exports.offset = offset;
3615  exports.toggleClass = toggleClass;
3616  exports.fadeOut = fadeOut;
3617  exports.fadeIn = fadeIn;
3618  exports.siblings = siblings;
3619  exports.visible = visible;
3620  exports.ajax = ajax;
3621  
3622  var _window = _dereq_(3);
3623  
3624  var _window2 = _interopRequireDefault(_window);
3625  
3626  var _document = _dereq_(2);
3627  
3628  var _document2 = _interopRequireDefault(_document);
3629  
3630  var _mejs = _dereq_(9);
3631  
3632  var _mejs2 = _interopRequireDefault(_mejs);
3633  
3634  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3635  
3636  function loadScript(url) {
3637      return new Promise(function (resolve, reject) {
3638          var script = _document2.default.createElement('script');
3639          script.src = url;
3640          script.async = true;
3641          script.onload = function () {
3642              script.remove();
3643              resolve();
3644          };
3645          script.onerror = function () {
3646              script.remove();
3647              reject();
3648          };
3649          _document2.default.head.appendChild(script);
3650      });
3651  }
3652  
3653  function offset(el) {
3654      var rect = el.getBoundingClientRect(),
3655          scrollLeft = _window2.default.pageXOffset || _document2.default.documentElement.scrollLeft,
3656          scrollTop = _window2.default.pageYOffset || _document2.default.documentElement.scrollTop;
3657      return { top: rect.top + scrollTop, left: rect.left + scrollLeft };
3658  }
3659  
3660  var hasClassMethod = void 0,
3661      addClassMethod = void 0,
3662      removeClassMethod = void 0;
3663  
3664  if ('classList' in _document2.default.documentElement) {
3665      hasClassMethod = function hasClassMethod(el, className) {
3666          return el.classList !== undefined && el.classList.contains(className);
3667      };
3668      addClassMethod = function addClassMethod(el, className) {
3669          return el.classList.add(className);
3670      };
3671      removeClassMethod = function removeClassMethod(el, className) {
3672          return el.classList.remove(className);
3673      };
3674  } else {
3675      hasClassMethod = function hasClassMethod(el, className) {
3676          return new RegExp('\\b' + className + '\\b').test(el.className);
3677      };
3678      addClassMethod = function addClassMethod(el, className) {
3679          if (!hasClass(el, className)) {
3680              el.className += ' ' + className;
3681          }
3682      };
3683      removeClassMethod = function removeClassMethod(el, className) {
3684          el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), '');
3685      };
3686  }
3687  
3688  var hasClass = exports.hasClass = hasClassMethod;
3689  var addClass = exports.addClass = addClassMethod;
3690  var removeClass = exports.removeClass = removeClassMethod;
3691  
3692  function toggleClass(el, className) {
3693      hasClass(el, className) ? removeClass(el, className) : addClass(el, className);
3694  }
3695  
3696  function fadeOut(el) {
3697      var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
3698      var callback = arguments[2];
3699  
3700      if (!el.style.opacity) {
3701          el.style.opacity = 1;
3702      }
3703  
3704      var start = null;
3705      _window2.default.requestAnimationFrame(function animate(timestamp) {
3706          start = start || timestamp;
3707          var progress = timestamp - start;
3708          var opacity = parseFloat(1 - progress / duration, 2);
3709          el.style.opacity = opacity < 0 ? 0 : opacity;
3710          if (progress > duration) {
3711              if (callback && typeof callback === 'function') {
3712                  callback();
3713              }
3714          } else {
3715              _window2.default.requestAnimationFrame(animate);
3716          }
3717      });
3718  }
3719  
3720  function fadeIn(el) {
3721      var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
3722      var callback = arguments[2];
3723  
3724      if (!el.style.opacity) {
3725          el.style.opacity = 0;
3726      }
3727  
3728      var start = null;
3729      _window2.default.requestAnimationFrame(function animate(timestamp) {
3730          start = start || timestamp;
3731          var progress = timestamp - start;
3732          var opacity = parseFloat(progress / duration, 2);
3733          el.style.opacity = opacity > 1 ? 1 : opacity;
3734          if (progress > duration) {
3735              if (callback && typeof callback === 'function') {
3736                  callback();
3737              }
3738          } else {
3739              _window2.default.requestAnimationFrame(animate);
3740          }
3741      });
3742  }
3743  
3744  function siblings(el, filter) {
3745      var siblings = [];
3746      el = el.parentNode.firstChild;
3747      do {
3748          if (!filter || filter(el)) {
3749              siblings.push(el);
3750          }
3751      } while (el = el.nextSibling);
3752      return siblings;
3753  }
3754  
3755  function visible(elem) {
3756      if (elem.getClientRects !== undefined && elem.getClientRects === 'function') {
3757          return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
3758      }
3759      return !!(elem.offsetWidth || elem.offsetHeight);
3760  }
3761  
3762  function ajax(url, dataType, success, error) {
3763      var xhr = _window2.default.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
3764  
3765      var type = 'application/x-www-form-urlencoded; charset=UTF-8',
3766          completed = false,
3767          accept = '*/'.concat('*');
3768  
3769      switch (dataType) {
3770          case 'text':
3771              type = 'text/plain';
3772              break;
3773          case 'json':
3774              type = 'application/json, text/javascript';
3775              break;
3776          case 'html':
3777              type = 'text/html';
3778              break;
3779          case 'xml':
3780              type = 'application/xml, text/xml';
3781              break;
3782      }
3783  
3784      if (type !== 'application/x-www-form-urlencoded') {
3785          accept = type + ', */*; q=0.01';
3786      }
3787  
3788      if (xhr) {
3789          xhr.open('GET', url, true);
3790          xhr.setRequestHeader('Accept', accept);
3791          xhr.onreadystatechange = function () {
3792              if (completed) {
3793                  return;
3794              }
3795  
3796              if (xhr.readyState === 4) {
3797                  if (xhr.status === 200) {
3798                      completed = true;
3799                      var data = void 0;
3800                      switch (dataType) {
3801                          case 'json':
3802                              data = JSON.parse(xhr.responseText);
3803                              break;
3804                          case 'xml':
3805                              data = xhr.responseXML;
3806                              break;
3807                          default:
3808                              data = xhr.responseText;
3809                              break;
3810                      }
3811                      success(data);
3812                  } else if (typeof error === 'function') {
3813                      error(xhr.status);
3814                  }
3815              }
3816          };
3817  
3818          xhr.send();
3819      }
3820  }
3821  
3822  _mejs2.default.Utils = _mejs2.default.Utils || {};
3823  _mejs2.default.Utils.offset = offset;
3824  _mejs2.default.Utils.hasClass = hasClass;
3825  _mejs2.default.Utils.addClass = addClass;
3826  _mejs2.default.Utils.removeClass = removeClass;
3827  _mejs2.default.Utils.toggleClass = toggleClass;
3828  _mejs2.default.Utils.fadeIn = fadeIn;
3829  _mejs2.default.Utils.fadeOut = fadeOut;
3830  _mejs2.default.Utils.siblings = siblings;
3831  _mejs2.default.Utils.visible = visible;
3832  _mejs2.default.Utils.ajax = ajax;
3833  _mejs2.default.Utils.loadScript = loadScript;
3834  
3835  },{"2":2,"3":3,"9":9}],20:[function(_dereq_,module,exports){
3836  'use strict';
3837  
3838  Object.defineProperty(exports, "__esModule", {
3839      value: true
3840  });
3841  exports.escapeHTML = escapeHTML;
3842  exports.debounce = debounce;
3843  exports.isObjectEmpty = isObjectEmpty;
3844  exports.splitEvents = splitEvents;
3845  exports.createEvent = createEvent;
3846  exports.isNodeAfter = isNodeAfter;
3847  exports.isString = isString;
3848  
3849  var _mejs = _dereq_(9);
3850  
3851  var _mejs2 = _interopRequireDefault(_mejs);
3852  
3853  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3854  
3855  function escapeHTML(input) {
3856  
3857      if (typeof input !== 'string') {
3858          throw new Error('Argument passed must be a string');
3859      }
3860  
3861      var map = {
3862          '&': '&amp;',
3863          '<': '&lt;',
3864          '>': '&gt;',
3865          '"': '&quot;'
3866      };
3867  
3868      return input.replace(/[&<>"]/g, function (c) {
3869          return map[c];
3870      });
3871  }
3872  
3873  function debounce(func, wait) {
3874      var _this = this,
3875          _arguments = arguments;
3876  
3877      var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3878  
3879  
3880      if (typeof func !== 'function') {
3881          throw new Error('First argument must be a function');
3882      }
3883  
3884      if (typeof wait !== 'number') {
3885          throw new Error('Second argument must be a numeric value');
3886      }
3887  
3888      var timeout = void 0;
3889      return function () {
3890          var context = _this,
3891              args = _arguments;
3892          var later = function later() {
3893              timeout = null;
3894              if (!immediate) {
3895                  func.apply(context, args);
3896              }
3897          };
3898          var callNow = immediate && !timeout;
3899          clearTimeout(timeout);
3900          timeout = setTimeout(later, wait);
3901  
3902          if (callNow) {
3903              func.apply(context, args);
3904          }
3905      };
3906  }
3907  
3908  function isObjectEmpty(instance) {
3909      return Object.getOwnPropertyNames(instance).length <= 0;
3910  }
3911  
3912  function splitEvents(events, id) {
3913      var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;
3914  
3915      var ret = { d: [], w: [] };
3916      (events || '').split(' ').forEach(function (v) {
3917          var eventName = '' + v + (id ? '.' + id : '');
3918  
3919          if (eventName.startsWith('.')) {
3920              ret.d.push(eventName);
3921              ret.w.push(eventName);
3922          } else {
3923              ret[rwindow.test(v) ? 'w' : 'd'].push(eventName);
3924          }
3925      });
3926  
3927      ret.d = ret.d.join(' ');
3928      ret.w = ret.w.join(' ');
3929      return ret;
3930  }
3931  
3932  function createEvent(eventName, target) {
3933  
3934      if (typeof eventName !== 'string') {
3935          throw new Error('Event name must be a string');
3936      }
3937  
3938      var eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i),
3939          detail = {
3940          target: target
3941      };
3942  
3943      if (eventFrags !== null) {
3944          eventName = eventFrags[1];
3945          detail.namespace = eventFrags[2];
3946      }
3947  
3948      return new window.CustomEvent(eventName, {
3949          detail: detail
3950      });
3951  }
3952  
3953  function isNodeAfter(sourceNode, targetNode) {
3954  
3955      return !!(sourceNode && targetNode && sourceNode.compareDocumentPosition(targetNode) & 2);
3956  }
3957  
3958  function isString(value) {
3959      return typeof value === 'string';
3960  }
3961  
3962  _mejs2.default.Utils = _mejs2.default.Utils || {};
3963  _mejs2.default.Utils.escapeHTML = escapeHTML;
3964  _mejs2.default.Utils.debounce = debounce;
3965  _mejs2.default.Utils.isObjectEmpty = isObjectEmpty;
3966  _mejs2.default.Utils.splitEvents = splitEvents;
3967  _mejs2.default.Utils.createEvent = createEvent;
3968  _mejs2.default.Utils.isNodeAfter = isNodeAfter;
3969  _mejs2.default.Utils.isString = isString;
3970  
3971  },{"9":9}],21:[function(_dereq_,module,exports){
3972  'use strict';
3973  
3974  Object.defineProperty(exports, "__esModule", {
3975      value: true
3976  });
3977  exports.typeChecks = undefined;
3978  exports.absolutizeUrl = absolutizeUrl;
3979  exports.formatType = formatType;
3980  exports.getMimeFromType = getMimeFromType;
3981  exports.getTypeFromFile = getTypeFromFile;
3982  exports.getExtension = getExtension;
3983  exports.normalizeExtension = normalizeExtension;
3984  
3985  var _mejs = _dereq_(9);
3986  
3987  var _mejs2 = _interopRequireDefault(_mejs);
3988  
3989  var _general = _dereq_(20);
3990  
3991  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3992  
3993  var typeChecks = exports.typeChecks = [];
3994  
3995  function absolutizeUrl(url) {
3996  
3997      if (typeof url !== 'string') {
3998          throw new Error('`url` argument must be a string');
3999      }
4000  
4001      var el = document.createElement('div');
4002      el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>';
4003      return el.firstChild.href;
4004  }
4005  
4006  function formatType(url) {
4007      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4008  
4009      return url && !type ? getTypeFromFile(url) : type;
4010  }
4011  
4012  function getMimeFromType(type) {
4013  
4014      if (typeof type !== 'string') {
4015          throw new Error('`type` argument must be a string');
4016      }
4017  
4018      return type && type.indexOf(';') > -1 ? type.substr(0, type.indexOf(';')) : type;
4019  }
4020  
4021  function getTypeFromFile(url) {
4022  
4023      if (typeof url !== 'string') {
4024          throw new Error('`url` argument must be a string');
4025      }
4026  
4027      for (var i = 0, total = typeChecks.length; i < total; i++) {
4028          var type = typeChecks[i](url);
4029  
4030          if (type) {
4031              return type;
4032          }
4033      }
4034  
4035      var ext = getExtension(url),
4036          normalizedExt = normalizeExtension(ext);
4037  
4038      var mime = 'video/mp4';
4039  
4040      if (normalizedExt) {
4041          if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) {
4042              mime = 'video/' + normalizedExt;
4043          } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) {
4044              mime = 'audio/' + normalizedExt;
4045          }
4046      }
4047  
4048      return mime;
4049  }
4050  
4051  function getExtension(url) {
4052  
4053      if (typeof url !== 'string') {
4054          throw new Error('`url` argument must be a string');
4055      }
4056  
4057      var baseUrl = url.split('?')[0],
4058          baseName = baseUrl.split('\\').pop().split('/').pop();
4059      return ~baseName.indexOf('.') ? baseName.substring(baseName.lastIndexOf('.') + 1) : '';
4060  }
4061  
4062  function normalizeExtension(extension) {
4063  
4064      if (typeof extension !== 'string') {
4065          throw new Error('`extension` argument must be a string');
4066      }
4067  
4068      switch (extension) {
4069          case 'mp4':
4070          case 'm4v':
4071              return 'mp4';
4072          case 'webm':
4073          case 'webma':
4074          case 'webmv':
4075              return 'webm';
4076          case 'ogg':
4077          case 'oga':
4078          case 'ogv':
4079              return 'ogg';
4080          default:
4081              return extension;
4082      }
4083  }
4084  
4085  _mejs2.default.Utils = _mejs2.default.Utils || {};
4086  _mejs2.default.Utils.typeChecks = typeChecks;
4087  _mejs2.default.Utils.absolutizeUrl = absolutizeUrl;
4088  _mejs2.default.Utils.formatType = formatType;
4089  _mejs2.default.Utils.getMimeFromType = getMimeFromType;
4090  _mejs2.default.Utils.getTypeFromFile = getTypeFromFile;
4091  _mejs2.default.Utils.getExtension = getExtension;
4092  _mejs2.default.Utils.normalizeExtension = normalizeExtension;
4093  
4094  },{"20":20,"9":9}],22:[function(_dereq_,module,exports){
4095  'use strict';
4096  
4097  var _document = _dereq_(2);
4098  
4099  var _document2 = _interopRequireDefault(_document);
4100  
4101  var _promisePolyfill = _dereq_(5);
4102  
4103  var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill);
4104  
4105  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4106  
4107  (function (arr) {
4108      arr.forEach(function (item) {
4109          if (item.hasOwnProperty('remove')) {
4110              return;
4111          }
4112          Object.defineProperty(item, 'remove', {
4113              configurable: true,
4114              enumerable: true,
4115              writable: true,
4116              value: function remove() {
4117                  this.parentNode.removeChild(this);
4118              }
4119          });
4120      });
4121  })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
4122  
4123  (function () {
4124  
4125      if (typeof window.CustomEvent === 'function') {
4126          return false;
4127      }
4128  
4129      function CustomEvent(event, params) {
4130          params = params || { bubbles: false, cancelable: false, detail: undefined };
4131          var evt = _document2.default.createEvent('CustomEvent');
4132          evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
4133          return evt;
4134      }
4135  
4136      CustomEvent.prototype = window.Event.prototype;
4137      window.CustomEvent = CustomEvent;
4138  })();
4139  
4140  if (typeof Object.assign !== 'function') {
4141      Object.assign = function (target) {
4142  
4143          if (target === null || target === undefined) {
4144              throw new TypeError('Cannot convert undefined or null to object');
4145          }
4146  
4147          var to = Object(target);
4148  
4149          for (var index = 1, total = arguments.length; index < total; index++) {
4150              var nextSource = arguments[index];
4151  
4152              if (nextSource !== null) {
4153                  for (var nextKey in nextSource) {
4154                      if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
4155                          to[nextKey] = nextSource[nextKey];
4156                      }
4157                  }
4158              }
4159          }
4160          return to;
4161      };
4162  }
4163  
4164  if (!String.prototype.startsWith) {
4165      String.prototype.startsWith = function (searchString, position) {
4166          position = position || 0;
4167          return this.substr(position, searchString.length) === searchString;
4168      };
4169  }
4170  
4171  if (!Element.prototype.matches) {
4172      Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) {
4173          var matches = (this.document || this.ownerDocument).querySelectorAll(s),
4174              i = matches.length - 1;
4175          while (--i >= 0 && matches.item(i) !== this) {}
4176          return i > -1;
4177      };
4178  }
4179  
4180  if (window.Element && !Element.prototype.closest) {
4181      Element.prototype.closest = function (s) {
4182          var matches = (this.document || this.ownerDocument).querySelectorAll(s),
4183              i = void 0,
4184              el = this;
4185          do {
4186              i = matches.length;
4187              while (--i >= 0 && matches.item(i) !== el) {}
4188          } while (i < 0 && (el = el.parentElement));
4189          return el;
4190      };
4191  }
4192  
4193  (function () {
4194      var lastTime = 0;
4195      var vendors = ['ms', 'moz', 'webkit', 'o'];
4196      for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
4197          window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
4198          window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
4199      }
4200  
4201      if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback) {
4202          var currTime = new Date().getTime();
4203          var timeToCall = Math.max(0, 16 - (currTime - lastTime));
4204          var id = window.setTimeout(function () {
4205              callback(currTime + timeToCall);
4206          }, timeToCall);
4207          lastTime = currTime + timeToCall;
4208          return id;
4209      };
4210  
4211      if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {
4212          clearTimeout(id);
4213      };
4214  })();
4215  
4216  if (/firefox/i.test(navigator.userAgent)) {
4217      var getComputedStyle = window.getComputedStyle;
4218      window.getComputedStyle = function (el, pseudoEl) {
4219          var t = getComputedStyle(el, pseudoEl);
4220          return t === null ? { getPropertyValue: function getPropertyValue() {} } : t;
4221      };
4222  }
4223  
4224  if (!window.Promise) {
4225      window.Promise = _promisePolyfill2.default;
4226  }
4227  
4228  (function (constructor) {
4229      if (constructor && constructor.prototype && constructor.prototype.children === null) {
4230          Object.defineProperty(constructor.prototype, 'children', {
4231              get: function get() {
4232                  var i = 0,
4233                      node = void 0,
4234                      nodes = this.childNodes,
4235                      children = [];
4236                  while (node = nodes[i++]) {
4237                      if (node.nodeType === 1) {
4238                          children.push(node);
4239                      }
4240                  }
4241                  return children;
4242              }
4243          });
4244      }
4245  })(window.Node || window.Element);
4246  
4247  },{"2":2,"5":5}]},{},[22,8,7,11,16,13,12,14,15,17]);


Generated: Fri Oct 25 08:20:01 2019 Cross-referenced by PHPXref 0.7