[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/js/mediaelement/ -> mediaelement-and-player.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_(17);
 567  
 568  var _general = _dereq_(29);
 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  },{"17":17,"29":29,"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_(29);
 842  
 843  var _media2 = _dereq_(30);
 844  
 845  var _renderer = _dereq_(10);
 846  
 847  var _constants = _dereq_(27);
 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,"2":2,"27":27,"29":29,"3":3,"30":30,"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  var _window = _dereq_(3);
1422  
1423  var _window2 = _interopRequireDefault(_window);
1424  
1425  var _document = _dereq_(2);
1426  
1427  var _document2 = _interopRequireDefault(_document);
1428  
1429  var _i18n = _dereq_(7);
1430  
1431  var _i18n2 = _interopRequireDefault(_i18n);
1432  
1433  var _player = _dereq_(18);
1434  
1435  var _player2 = _interopRequireDefault(_player);
1436  
1437  var _constants = _dereq_(27);
1438  
1439  var Features = _interopRequireWildcard(_constants);
1440  
1441  var _general = _dereq_(29);
1442  
1443  var _dom = _dereq_(28);
1444  
1445  var _media = _dereq_(30);
1446  
1447  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1448  
1449  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1450  
1451  Object.assign(_player.config, {
1452      usePluginFullScreen: true,
1453  
1454      fullscreenText: null,
1455  
1456      useFakeFullscreen: false
1457  });
1458  
1459  Object.assign(_player2.default.prototype, {
1460      isFullScreen: false,
1461  
1462      isNativeFullScreen: false,
1463  
1464      isInIframe: false,
1465  
1466      isPluginClickThroughCreated: false,
1467  
1468      fullscreenMode: '',
1469  
1470      containerSizeTimeout: null,
1471  
1472      buildfullscreen: function buildfullscreen(player) {
1473          if (!player.isVideo) {
1474              return;
1475          }
1476  
1477          player.isInIframe = _window2.default.location !== _window2.default.parent.location;
1478  
1479          player.detectFullscreenMode();
1480  
1481          var t = this,
1482              fullscreenTitle = (0, _general.isString)(t.options.fullscreenText) ? t.options.fullscreenText : _i18n2.default.t('mejs.fullscreen'),
1483              fullscreenBtn = _document2.default.createElement('div');
1484  
1485          fullscreenBtn.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'fullscreen-button';
1486          fullscreenBtn.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + fullscreenTitle + '" aria-label="' + fullscreenTitle + '" tabindex="0"></button>';
1487          t.addControlElement(fullscreenBtn, 'fullscreen');
1488  
1489          fullscreenBtn.addEventListener('click', function () {
1490              var isFullScreen = Features.HAS_TRUE_NATIVE_FULLSCREEN && Features.IS_FULLSCREEN || player.isFullScreen;
1491  
1492              if (isFullScreen) {
1493                  player.exitFullScreen();
1494              } else {
1495                  player.enterFullScreen();
1496              }
1497          });
1498  
1499          player.fullscreenBtn = fullscreenBtn;
1500  
1501          t.options.keyActions.push({
1502              keys: [70],
1503              action: function action(player, media, key, event) {
1504                  if (!event.ctrlKey) {
1505                      if (typeof player.enterFullScreen !== 'undefined') {
1506                          if (player.isFullScreen) {
1507                              player.exitFullScreen();
1508                          } else {
1509                              player.enterFullScreen();
1510                          }
1511                      }
1512                  }
1513              }
1514          });
1515  
1516          t.exitFullscreenCallback = function (e) {
1517              var key = e.which || e.keyCode || 0;
1518              if (t.options.enableKeyboard && key === 27 && (Features.HAS_TRUE_NATIVE_FULLSCREEN && Features.IS_FULLSCREEN || t.isFullScreen)) {
1519                  player.exitFullScreen();
1520              }
1521          };
1522  
1523          t.globalBind('keydown', t.exitFullscreenCallback);
1524  
1525          t.normalHeight = 0;
1526          t.normalWidth = 0;
1527  
1528          if (Features.HAS_TRUE_NATIVE_FULLSCREEN) {
1529              var fullscreenChanged = function fullscreenChanged() {
1530                  if (player.isFullScreen) {
1531                      if (Features.isFullScreen()) {
1532                          player.isNativeFullScreen = true;
1533  
1534                          player.setControlsSize();
1535                      } else {
1536                          player.isNativeFullScreen = false;
1537  
1538                          player.exitFullScreen();
1539                      }
1540                  }
1541              };
1542  
1543              player.globalBind(Features.FULLSCREEN_EVENT_NAME, fullscreenChanged);
1544          }
1545      },
1546      cleanfullscreen: function cleanfullscreen(player) {
1547          player.exitFullScreen();
1548          player.globalUnbind('keydown', player.exitFullscreenCallback);
1549      },
1550      detectFullscreenMode: function detectFullscreenMode() {
1551          var t = this,
1552              isNative = t.media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
1553  
1554          var mode = '';
1555  
1556          if (Features.HAS_TRUE_NATIVE_FULLSCREEN && isNative) {
1557              mode = 'native-native';
1558          } else if (Features.HAS_TRUE_NATIVE_FULLSCREEN && !isNative) {
1559              mode = 'plugin-native';
1560          } else if (t.usePluginFullScreen && Features.SUPPORT_POINTER_EVENTS) {
1561              mode = 'plugin-click';
1562          }
1563  
1564          t.fullscreenMode = mode;
1565          return mode;
1566      },
1567      enterFullScreen: function enterFullScreen() {
1568          var t = this,
1569              isNative = t.media.rendererName !== null && /(html5|native)/i.test(t.media.rendererName),
1570              containerStyles = getComputedStyle(t.getElement(t.container));
1571  
1572          if (!t.isVideo) {
1573              return;
1574          }
1575  
1576          if (t.options.useFakeFullscreen === false && Features.IS_IOS && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) {
1577              t.media.originalNode.webkitEnterFullscreen();
1578              return;
1579          }
1580  
1581          (0, _dom.addClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen');
1582          (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'container-fullscreen');
1583  
1584          t.normalHeight = parseFloat(containerStyles.height);
1585          t.normalWidth = parseFloat(containerStyles.width);
1586  
1587          if (t.fullscreenMode === 'native-native' || t.fullscreenMode === 'plugin-native') {
1588              Features.requestFullScreen(t.getElement(t.container));
1589  
1590              if (t.isInIframe) {
1591                  setTimeout(function checkFullscreen() {
1592  
1593                      if (t.isNativeFullScreen) {
1594                          var percentErrorMargin = 0.002,
1595                              windowWidth = _window2.default.innerWidth || _document2.default.documentElement.clientWidth || _document2.default.body.clientWidth,
1596                              screenWidth = screen.width,
1597                              absDiff = Math.abs(screenWidth - windowWidth),
1598                              marginError = screenWidth * percentErrorMargin;
1599  
1600                          if (absDiff > marginError) {
1601                              t.exitFullScreen();
1602                          } else {
1603                              setTimeout(checkFullscreen, 500);
1604                          }
1605                      }
1606                  }, 1000);
1607              }
1608          }
1609  
1610          t.getElement(t.container).style.width = '100%';
1611          t.getElement(t.container).style.height = '100%';
1612  
1613          t.containerSizeTimeout = setTimeout(function () {
1614              t.getElement(t.container).style.width = '100%';
1615              t.getElement(t.container).style.height = '100%';
1616              t.setControlsSize();
1617          }, 500);
1618  
1619          if (isNative) {
1620              t.node.style.width = '100%';
1621              t.node.style.height = '100%';
1622          } else {
1623              var elements = t.getElement(t.container).querySelectorAll('embed, object, video'),
1624                  _total = elements.length;
1625              for (var i = 0; i < _total; i++) {
1626                  elements[i].style.width = '100%';
1627                  elements[i].style.height = '100%';
1628              }
1629          }
1630  
1631          if (t.options.setDimensions && typeof t.media.setSize === 'function') {
1632              t.media.setSize(screen.width, screen.height);
1633          }
1634  
1635          var layers = t.getElement(t.layers).children,
1636              total = layers.length;
1637          for (var _i = 0; _i < total; _i++) {
1638              layers[_i].style.width = '100%';
1639              layers[_i].style.height = '100%';
1640          }
1641  
1642          if (t.fullscreenBtn) {
1643              (0, _dom.removeClass)(t.fullscreenBtn, t.options.classPrefix + 'fullscreen');
1644              (0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen');
1645          }
1646  
1647          t.setControlsSize();
1648          t.isFullScreen = true;
1649  
1650          var zoomFactor = Math.min(screen.width / t.width, screen.height / t.height),
1651              captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text');
1652          if (captionText) {
1653              captionText.style.fontSize = zoomFactor * 100 + '%';
1654              captionText.style.lineHeight = 'normal';
1655              t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-position').style.bottom = (screen.height - t.normalHeight) / 2 - t.getElement(t.controls).offsetHeight / 2 + zoomFactor + 15 + 'px';
1656          }
1657          var event = (0, _general.createEvent)('enteredfullscreen', t.getElement(t.container));
1658          t.getElement(t.container).dispatchEvent(event);
1659      },
1660      exitFullScreen: function exitFullScreen() {
1661          var t = this,
1662              isNative = t.media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
1663  
1664          if (!t.isVideo) {
1665              return;
1666          }
1667  
1668          clearTimeout(t.containerSizeTimeout);
1669  
1670          if (Features.HAS_TRUE_NATIVE_FULLSCREEN && (Features.IS_FULLSCREEN || t.isFullScreen)) {
1671              Features.cancelFullScreen();
1672          }
1673  
1674          (0, _dom.removeClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen');
1675          (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'container-fullscreen');
1676  
1677          if (t.options.setDimensions) {
1678              t.getElement(t.container).style.width = t.normalWidth + 'px';
1679              t.getElement(t.container).style.height = t.normalHeight + 'px';
1680  
1681              if (isNative) {
1682                  t.node.style.width = t.normalWidth + 'px';
1683                  t.node.style.height = t.normalHeight + 'px';
1684              } else {
1685                  var elements = t.getElement(t.container).querySelectorAll('embed, object, video'),
1686                      _total2 = elements.length;
1687                  for (var i = 0; i < _total2; i++) {
1688                      elements[i].style.width = t.normalWidth + 'px';
1689                      elements[i].style.height = t.normalHeight + 'px';
1690                  }
1691              }
1692  
1693              if (typeof t.media.setSize === 'function') {
1694                  t.media.setSize(t.normalWidth, t.normalHeight);
1695              }
1696  
1697              var layers = t.getElement(t.layers).children,
1698                  total = layers.length;
1699              for (var _i2 = 0; _i2 < total; _i2++) {
1700                  layers[_i2].style.width = t.normalWidth + 'px';
1701                  layers[_i2].style.height = t.normalHeight + 'px';
1702              }
1703          }
1704  
1705          if (t.fullscreenBtn) {
1706              (0, _dom.removeClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen');
1707              (0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'fullscreen');
1708          }
1709  
1710          t.setControlsSize();
1711          t.isFullScreen = false;
1712  
1713          var captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text');
1714          if (captionText) {
1715              captionText.style.fontSize = '';
1716              captionText.style.lineHeight = '';
1717              t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-position').style.bottom = '';
1718          }
1719          var event = (0, _general.createEvent)('exitedfullscreen', t.getElement(t.container));
1720          t.getElement(t.container).dispatchEvent(event);
1721      }
1722  });
1723  
1724  },{"18":18,"2":2,"27":27,"28":28,"29":29,"3":3,"30":30,"7":7}],12:[function(_dereq_,module,exports){
1725  'use strict';
1726  
1727  var _document = _dereq_(2);
1728  
1729  var _document2 = _interopRequireDefault(_document);
1730  
1731  var _player = _dereq_(18);
1732  
1733  var _player2 = _interopRequireDefault(_player);
1734  
1735  var _i18n = _dereq_(7);
1736  
1737  var _i18n2 = _interopRequireDefault(_i18n);
1738  
1739  var _general = _dereq_(29);
1740  
1741  var _dom = _dereq_(28);
1742  
1743  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1744  
1745  Object.assign(_player.config, {
1746      playText: null,
1747  
1748      pauseText: null
1749  });
1750  
1751  Object.assign(_player2.default.prototype, {
1752      buildplaypause: function buildplaypause(player, controls, layers, media) {
1753          var t = this,
1754              op = t.options,
1755              playTitle = (0, _general.isString)(op.playText) ? op.playText : _i18n2.default.t('mejs.play'),
1756              pauseTitle = (0, _general.isString)(op.pauseText) ? op.pauseText : _i18n2.default.t('mejs.pause'),
1757              play = _document2.default.createElement('div');
1758  
1759          play.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'playpause-button ' + t.options.classPrefix + 'play';
1760          play.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + playTitle + '" aria-label="' + pauseTitle + '" tabindex="0"></button>';
1761          play.addEventListener('click', function () {
1762              if (t.paused) {
1763                  t.play();
1764              } else {
1765                  t.pause();
1766              }
1767          });
1768  
1769          var playBtn = play.querySelector('button');
1770          t.addControlElement(play, 'playpause');
1771  
1772  		function togglePlayPause(which) {
1773              if ('play' === which) {
1774                  (0, _dom.removeClass)(play, t.options.classPrefix + 'play');
1775                  (0, _dom.removeClass)(play, t.options.classPrefix + 'replay');
1776                  (0, _dom.addClass)(play, t.options.classPrefix + 'pause');
1777                  playBtn.setAttribute('title', pauseTitle);
1778                  playBtn.setAttribute('aria-label', pauseTitle);
1779              } else {
1780  
1781                  (0, _dom.removeClass)(play, t.options.classPrefix + 'pause');
1782                  (0, _dom.removeClass)(play, t.options.classPrefix + 'replay');
1783                  (0, _dom.addClass)(play, t.options.classPrefix + 'play');
1784                  playBtn.setAttribute('title', playTitle);
1785                  playBtn.setAttribute('aria-label', playTitle);
1786              }
1787          }
1788  
1789          togglePlayPause('pse');
1790  
1791          media.addEventListener('loadedmetadata', function () {
1792              if (media.rendererName.indexOf('flash') === -1) {
1793                  togglePlayPause('pse');
1794              }
1795          });
1796          media.addEventListener('play', function () {
1797              togglePlayPause('play');
1798          });
1799          media.addEventListener('playing', function () {
1800              togglePlayPause('play');
1801          });
1802          media.addEventListener('pause', function () {
1803              togglePlayPause('pse');
1804          });
1805          media.addEventListener('ended', function () {
1806              if (!player.options.loop) {
1807                  (0, _dom.removeClass)(play, t.options.classPrefix + 'pause');
1808                  (0, _dom.removeClass)(play, t.options.classPrefix + 'play');
1809                  (0, _dom.addClass)(play, t.options.classPrefix + 'replay');
1810                  playBtn.setAttribute('title', playTitle);
1811                  playBtn.setAttribute('aria-label', playTitle);
1812              }
1813          });
1814      }
1815  });
1816  
1817  },{"18":18,"2":2,"28":28,"29":29,"7":7}],13:[function(_dereq_,module,exports){
1818  'use strict';
1819  
1820  var _document = _dereq_(2);
1821  
1822  var _document2 = _interopRequireDefault(_document);
1823  
1824  var _player2 = _dereq_(18);
1825  
1826  var _player3 = _interopRequireDefault(_player2);
1827  
1828  var _i18n = _dereq_(7);
1829  
1830  var _i18n2 = _interopRequireDefault(_i18n);
1831  
1832  var _constants = _dereq_(27);
1833  
1834  var _time = _dereq_(32);
1835  
1836  var _dom = _dereq_(28);
1837  
1838  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1839  
1840  Object.assign(_player2.config, {
1841      enableProgressTooltip: true,
1842  
1843      useSmoothHover: true,
1844  
1845      forceLive: false
1846  });
1847  
1848  Object.assign(_player3.default.prototype, {
1849      buildprogress: function buildprogress(player, controls, layers, media) {
1850  
1851          var lastKeyPressTime = 0,
1852              mouseIsDown = false,
1853              startedPaused = false;
1854  
1855          var t = this,
1856              autoRewindInitial = player.options.autoRewind,
1857              tooltip = player.options.enableProgressTooltip ? '<span class="' + t.options.classPrefix + 'time-float">' + ('<span class="' + t.options.classPrefix + 'time-float-current">00:00</span>') + ('<span class="' + t.options.classPrefix + 'time-float-corner"></span>') + '</span>' : '',
1858              rail = _document2.default.createElement('div');
1859  
1860          rail.className = t.options.classPrefix + 'time-rail';
1861          rail.innerHTML = '<span class="' + t.options.classPrefix + 'time-total ' + t.options.classPrefix + 'time-slider">' + ('<span class="' + t.options.classPrefix + 'time-buffering"></span>') + ('<span class="' + t.options.classPrefix + 'time-loaded"></span>') + ('<span class="' + t.options.classPrefix + 'time-current"></span>') + ('<span class="' + t.options.classPrefix + 'time-hovered no-hover"></span>') + ('<span class="' + t.options.classPrefix + 'time-handle"><span class="' + t.options.classPrefix + 'time-handle-content"></span></span>') + ('' + tooltip) + '</span>';
1862  
1863          t.addControlElement(rail, 'progress');
1864  
1865          t.options.keyActions.push({
1866              keys: [37, 227],
1867              action: function action(player) {
1868                  if (!isNaN(player.duration) && player.duration > 0) {
1869                      if (player.isVideo) {
1870                          player.showControls();
1871                          player.startControlsTimer();
1872                      }
1873  
1874                      var timeSlider = player.getElement(player.container).querySelector('.' + _player.config.classPrefix + 'time-total');
1875                      if (timeSlider) {
1876                          timeSlider.focus();
1877                      }
1878  
1879                      var newTime = Math.max(player.currentTime - player.options.defaultSeekBackwardInterval(player), 0);
1880                      player.setCurrentTime(newTime);
1881                  }
1882              }
1883          }, {
1884              keys: [39, 228],
1885              action: function action(player) {
1886  
1887                  if (!isNaN(player.duration) && player.duration > 0) {
1888                      if (player.isVideo) {
1889                          player.showControls();
1890                          player.startControlsTimer();
1891                      }
1892  
1893                      var timeSlider = player.getElement(player.container).querySelector('.' + _player.config.classPrefix + 'time-total');
1894                      if (timeSlider) {
1895                          timeSlider.focus();
1896                      }
1897  
1898                      var newTime = Math.min(player.currentTime + player.options.defaultSeekForwardInterval(player), player.duration);
1899                      player.setCurrentTime(newTime);
1900                  }
1901              }
1902          });
1903  
1904          t.rail = controls.querySelector('.' + t.options.classPrefix + 'time-rail');
1905          t.total = controls.querySelector('.' + t.options.classPrefix + 'time-total');
1906          t.loaded = controls.querySelector('.' + t.options.classPrefix + 'time-loaded');
1907          t.current = controls.querySelector('.' + t.options.classPrefix + 'time-current');
1908          t.handle = controls.querySelector('.' + t.options.classPrefix + 'time-handle');
1909          t.timefloat = controls.querySelector('.' + t.options.classPrefix + 'time-float');
1910          t.timefloatcurrent = controls.querySelector('.' + t.options.classPrefix + 'time-float-current');
1911          t.slider = controls.querySelector('.' + t.options.classPrefix + 'time-slider');
1912          t.hovered = controls.querySelector('.' + t.options.classPrefix + 'time-hovered');
1913          t.buffer = controls.querySelector('.' + t.options.classPrefix + 'time-buffering');
1914          t.newTime = 0;
1915          t.forcedHandlePause = false;
1916          t.setTransformStyle = function (element, value) {
1917              element.style.transform = value;
1918              element.style.webkitTransform = value;
1919              element.style.MozTransform = value;
1920              element.style.msTransform = value;
1921              element.style.OTransform = value;
1922          };
1923  
1924          t.buffer.style.display = 'none';
1925  
1926          var handleMouseMove = function handleMouseMove(e) {
1927              var totalStyles = getComputedStyle(t.total),
1928                  offsetStyles = (0, _dom.offset)(t.total),
1929                  width = t.total.offsetWidth,
1930                  transform = function () {
1931                  if (totalStyles.webkitTransform !== undefined) {
1932                      return 'webkitTransform';
1933                  } else if (totalStyles.mozTransform !== undefined) {
1934                      return 'mozTransform ';
1935                  } else if (totalStyles.oTransform !== undefined) {
1936                      return 'oTransform';
1937                  } else if (totalStyles.msTransform !== undefined) {
1938                      return 'msTransform';
1939                  } else {
1940                      return 'transform';
1941                  }
1942              }(),
1943                  cssMatrix = function () {
1944                  if ('WebKitCSSMatrix' in window) {
1945                      return 'WebKitCSSMatrix';
1946                  } else if ('MSCSSMatrix' in window) {
1947                      return 'MSCSSMatrix';
1948                  } else if ('CSSMatrix' in window) {
1949                      return 'CSSMatrix';
1950                  }
1951              }();
1952  
1953              var percentage = 0,
1954                  leftPos = 0,
1955                  pos = 0,
1956                  x = void 0;
1957  
1958              if (e.originalEvent && e.originalEvent.changedTouches) {
1959                  x = e.originalEvent.changedTouches[0].pageX;
1960              } else if (e.changedTouches) {
1961                  x = e.changedTouches[0].pageX;
1962              } else {
1963                  x = e.pageX;
1964              }
1965  
1966              if (t.getDuration()) {
1967                  if (x < offsetStyles.left) {
1968                      x = offsetStyles.left;
1969                  } else if (x > width + offsetStyles.left) {
1970                      x = width + offsetStyles.left;
1971                  }
1972  
1973                  pos = x - offsetStyles.left;
1974                  percentage = pos / width;
1975                  t.newTime = percentage * t.getDuration();
1976  
1977                  if (mouseIsDown && t.getCurrentTime() !== null && t.newTime.toFixed(4) !== t.getCurrentTime().toFixed(4)) {
1978                      t.setCurrentRailHandle(t.newTime);
1979                      t.updateCurrent(t.newTime);
1980                  }
1981  
1982                  if (!_constants.IS_IOS && !_constants.IS_ANDROID) {
1983                      if (pos < 0) {
1984                          pos = 0;
1985                      }
1986                      if (t.options.useSmoothHover && cssMatrix !== null && typeof window[cssMatrix] !== 'undefined') {
1987                          var matrix = new window[cssMatrix](getComputedStyle(t.handle)[transform]),
1988                              handleLocation = matrix.m41,
1989                              hoverScaleX = pos / parseFloat(getComputedStyle(t.total).width) - handleLocation / parseFloat(getComputedStyle(t.total).width);
1990  
1991                          t.hovered.style.left = handleLocation + 'px';
1992                          t.setTransformStyle(t.hovered, 'scaleX(' + hoverScaleX + ')');
1993                          t.hovered.setAttribute('pos', pos);
1994  
1995                          if (hoverScaleX >= 0) {
1996                              (0, _dom.removeClass)(t.hovered, 'negative');
1997                          } else {
1998                              (0, _dom.addClass)(t.hovered, 'negative');
1999                          }
2000                      }
2001  
2002                      if (t.timefloat) {
2003                          var half = t.timefloat.offsetWidth / 2,
2004                              offsetContainer = mejs.Utils.offset(t.getElement(t.container)),
2005                              tooltipStyles = getComputedStyle(t.timefloat);
2006  
2007                          if (x - offsetContainer.left < t.timefloat.offsetWidth) {
2008                              leftPos = half;
2009                          } else if (x - offsetContainer.left >= t.getElement(t.container).offsetWidth - half) {
2010                              leftPos = t.total.offsetWidth - half;
2011                          } else {
2012                              leftPos = pos;
2013                          }
2014  
2015                          if ((0, _dom.hasClass)(t.getElement(t.container), t.options.classPrefix + 'long-video')) {
2016                              leftPos += parseFloat(tooltipStyles.marginLeft) / 2 + t.timefloat.offsetWidth / 2;
2017                          }
2018  
2019                          t.timefloat.style.left = leftPos + 'px';
2020                          t.timefloatcurrent.innerHTML = (0, _time.secondsToTimeCode)(t.newTime, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat);
2021                          t.timefloat.style.display = 'block';
2022                      }
2023                  }
2024              } else if (!_constants.IS_IOS && !_constants.IS_ANDROID && t.timefloat) {
2025                  leftPos = t.timefloat.offsetWidth + width >= t.getElement(t.container).offsetWidth ? t.timefloat.offsetWidth / 2 : 0;
2026                  t.timefloat.style.left = leftPos + 'px';
2027                  t.timefloat.style.left = leftPos + 'px';
2028                  t.timefloat.style.display = 'block';
2029              }
2030          },
2031              updateSlider = function updateSlider() {
2032              var seconds = t.getCurrentTime(),
2033                  timeSliderText = _i18n2.default.t('mejs.time-slider'),
2034                  time = (0, _time.secondsToTimeCode)(seconds, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat),
2035                  duration = t.getDuration();
2036  
2037              t.slider.setAttribute('role', 'slider');
2038              t.slider.tabIndex = 0;
2039  
2040              if (media.paused) {
2041                  t.slider.setAttribute('aria-label', timeSliderText);
2042                  t.slider.setAttribute('aria-valuemin', 0);
2043                  t.slider.setAttribute('aria-valuemax', isNaN(duration) ? 0 : duration);
2044                  t.slider.setAttribute('aria-valuenow', seconds);
2045                  t.slider.setAttribute('aria-valuetext', time);
2046              } else {
2047                  t.slider.removeAttribute('aria-label');
2048                  t.slider.removeAttribute('aria-valuemin');
2049                  t.slider.removeAttribute('aria-valuemax');
2050                  t.slider.removeAttribute('aria-valuenow');
2051                  t.slider.removeAttribute('aria-valuetext');
2052              }
2053          },
2054              restartPlayer = function restartPlayer() {
2055              if (new Date() - lastKeyPressTime >= 1000) {
2056                  t.play();
2057              }
2058          },
2059              handleMouseup = function handleMouseup() {
2060              if (mouseIsDown && t.getCurrentTime() !== null && t.newTime.toFixed(4) !== t.getCurrentTime().toFixed(4)) {
2061                  t.setCurrentTime(t.newTime);
2062                  t.setCurrentRailHandle(t.newTime);
2063                  t.updateCurrent(t.newTime);
2064              }
2065              if (t.forcedHandlePause) {
2066                  t.slider.focus();
2067                  t.play();
2068              }
2069              t.forcedHandlePause = false;
2070          };
2071  
2072          t.slider.addEventListener('focus', function () {
2073              player.options.autoRewind = false;
2074          });
2075          t.slider.addEventListener('blur', function () {
2076              player.options.autoRewind = autoRewindInitial;
2077          });
2078          t.slider.addEventListener('keydown', function (e) {
2079              if (new Date() - lastKeyPressTime >= 1000) {
2080                  startedPaused = t.paused;
2081              }
2082  
2083              if (t.options.enableKeyboard && t.options.keyActions.length) {
2084  
2085                  var keyCode = e.which || e.keyCode || 0,
2086                      duration = t.getDuration(),
2087                      seekForward = player.options.defaultSeekForwardInterval(media),
2088                      seekBackward = player.options.defaultSeekBackwardInterval(media);
2089  
2090                  var seekTime = t.getCurrentTime();
2091                  var volume = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-slider');
2092  
2093                  if (keyCode === 38 || keyCode === 40) {
2094                      if (volume) {
2095                          volume.style.display = 'block';
2096                      }
2097                      if (t.isVideo) {
2098                          t.showControls();
2099                          t.startControlsTimer();
2100                      }
2101  
2102                      var newVolume = keyCode === 38 ? Math.min(t.volume + 0.1, 1) : Math.max(t.volume - 0.1, 0),
2103                          mutePlayer = newVolume <= 0;
2104                      t.setVolume(newVolume);
2105                      t.setMuted(mutePlayer);
2106                      return;
2107                  } else {
2108                      if (volume) {
2109                          volume.style.display = 'none';
2110                      }
2111                  }
2112  
2113                  switch (keyCode) {
2114                      case 37:
2115                          if (t.getDuration() !== Infinity) {
2116                              seekTime -= seekBackward;
2117                          }
2118                          break;
2119                      case 39:
2120                          if (t.getDuration() !== Infinity) {
2121                              seekTime += seekForward;
2122                          }
2123                          break;
2124                      case 36:
2125                          seekTime = 0;
2126                          break;
2127                      case 35:
2128                          seekTime = duration;
2129                          break;
2130                      case 13:
2131                      case 32:
2132                          if (_constants.IS_FIREFOX) {
2133                              if (t.paused) {
2134                                  t.play();
2135                              } else {
2136                                  t.pause();
2137                              }
2138                          }
2139                          return;
2140                      default:
2141                          return;
2142                  }
2143  
2144                  seekTime = seekTime < 0 || isNaN(seekTime) ? 0 : seekTime >= duration ? duration : Math.floor(seekTime);
2145                  lastKeyPressTime = new Date();
2146                  if (!startedPaused) {
2147                      player.pause();
2148                  }
2149  
2150                  if (seekTime < t.getDuration() && !startedPaused) {
2151                      setTimeout(restartPlayer, 1100);
2152                  }
2153  
2154                  t.setCurrentTime(seekTime);
2155                  player.showControls();
2156  
2157                  e.preventDefault();
2158                  e.stopPropagation();
2159              }
2160          });
2161  
2162          var events = ['mousedown', 'touchstart'];
2163  
2164          t.slider.addEventListener('dragstart', function () {
2165              return false;
2166          });
2167  
2168          for (var i = 0, total = events.length; i < total; i++) {
2169              t.slider.addEventListener(events[i], function (e) {
2170                  t.forcedHandlePause = false;
2171                  if (t.getDuration() !== Infinity) {
2172                      if (e.which === 1 || e.which === 0) {
2173                          if (!t.paused) {
2174                              t.pause();
2175                              t.forcedHandlePause = true;
2176                          }
2177  
2178                          mouseIsDown = true;
2179                          handleMouseMove(e);
2180                          var endEvents = ['mouseup', 'touchend'];
2181  
2182                          for (var j = 0, totalEvents = endEvents.length; j < totalEvents; j++) {
2183                              t.getElement(t.container).addEventListener(endEvents[j], function (event) {
2184                                  var target = event.target;
2185                                  if (target === t.slider || target.closest('.' + t.options.classPrefix + 'time-slider')) {
2186                                      handleMouseMove(event);
2187                                  }
2188                              });
2189                          }
2190                          t.globalBind('mouseup.dur touchend.dur', function () {
2191                              handleMouseup();
2192                              mouseIsDown = false;
2193                              if (t.timefloat) {
2194                                  t.timefloat.style.display = 'none';
2195                              }
2196                          });
2197                      }
2198                  }
2199              }, _constants.SUPPORT_PASSIVE_EVENT && events[i] === 'touchstart' ? { passive: true } : false);
2200          }
2201          t.slider.addEventListener('mouseenter', function (e) {
2202              if (e.target === t.slider && t.getDuration() !== Infinity) {
2203                  t.getElement(t.container).addEventListener('mousemove', function (event) {
2204                      var target = event.target;
2205                      if (target === t.slider || target.closest('.' + t.options.classPrefix + 'time-slider')) {
2206                          handleMouseMove(event);
2207                      }
2208                  });
2209                  if (t.timefloat && !_constants.IS_IOS && !_constants.IS_ANDROID) {
2210                      t.timefloat.style.display = 'block';
2211                  }
2212                  if (t.hovered && !_constants.IS_IOS && !_constants.IS_ANDROID && t.options.useSmoothHover) {
2213                      (0, _dom.removeClass)(t.hovered, 'no-hover');
2214                  }
2215              }
2216          });
2217          t.slider.addEventListener('mouseleave', function () {
2218              if (t.getDuration() !== Infinity) {
2219                  if (!mouseIsDown) {
2220                      if (t.timefloat) {
2221                          t.timefloat.style.display = 'none';
2222                      }
2223                      if (t.hovered && t.options.useSmoothHover) {
2224                          (0, _dom.addClass)(t.hovered, 'no-hover');
2225                      }
2226                  }
2227              }
2228          });
2229  
2230          t.broadcastCallback = function (e) {
2231              var broadcast = controls.querySelector('.' + t.options.classPrefix + 'broadcast');
2232              if (!t.options.forceLive && t.getDuration() !== Infinity) {
2233                  if (broadcast) {
2234                      t.slider.style.display = '';
2235                      broadcast.remove();
2236                  }
2237  
2238                  player.setProgressRail(e);
2239                  if (!t.forcedHandlePause) {
2240                      player.setCurrentRail(e);
2241                  }
2242                  updateSlider();
2243              } else if (!broadcast && t.options.forceLive) {
2244                  var label = _document2.default.createElement('span');
2245                  label.className = t.options.classPrefix + 'broadcast';
2246                  label.innerText = _i18n2.default.t('mejs.live-broadcast');
2247                  t.slider.style.display = 'none';
2248                  t.rail.appendChild(label);
2249              }
2250          };
2251  
2252          media.addEventListener('progress', t.broadcastCallback);
2253          media.addEventListener('timeupdate', t.broadcastCallback);
2254          media.addEventListener('play', function () {
2255              t.buffer.style.display = 'none';
2256          });
2257          media.addEventListener('playing', function () {
2258              t.buffer.style.display = 'none';
2259          });
2260          media.addEventListener('seeking', function () {
2261              t.buffer.style.display = '';
2262          });
2263          media.addEventListener('seeked', function () {
2264              t.buffer.style.display = 'none';
2265          });
2266          media.addEventListener('pause', function () {
2267              t.buffer.style.display = 'none';
2268          });
2269          media.addEventListener('waiting', function () {
2270              t.buffer.style.display = '';
2271          });
2272          media.addEventListener('loadeddata', function () {
2273              t.buffer.style.display = '';
2274          });
2275          media.addEventListener('canplay', function () {
2276              t.buffer.style.display = 'none';
2277          });
2278          media.addEventListener('error', function () {
2279              t.buffer.style.display = 'none';
2280          });
2281  
2282          t.getElement(t.container).addEventListener('controlsresize', function (e) {
2283              if (t.getDuration() !== Infinity) {
2284                  player.setProgressRail(e);
2285                  if (!t.forcedHandlePause) {
2286                      player.setCurrentRail(e);
2287                  }
2288              }
2289          });
2290      },
2291      cleanprogress: function cleanprogress(player, controls, layers, media) {
2292          media.removeEventListener('progress', player.broadcastCallback);
2293          media.removeEventListener('timeupdate', player.broadcastCallback);
2294          if (player.rail) {
2295              player.rail.remove();
2296          }
2297      },
2298      setProgressRail: function setProgressRail(e) {
2299          var t = this,
2300              target = e !== undefined ? e.detail.target || e.target : t.media;
2301  
2302          var percent = null;
2303  
2304          if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && t.getDuration()) {
2305              percent = target.buffered.end(target.buffered.length - 1) / t.getDuration();
2306          } else if (target && target.bytesTotal !== undefined && target.bytesTotal > 0 && target.bufferedBytes !== undefined) {
2307                  percent = target.bufferedBytes / target.bytesTotal;
2308              } else if (e && e.lengthComputable && e.total !== 0) {
2309                      percent = e.loaded / e.total;
2310                  }
2311  
2312          if (percent !== null) {
2313              percent = Math.min(1, Math.max(0, percent));
2314  
2315              if (t.loaded) {
2316                  t.setTransformStyle(t.loaded, 'scaleX(' + percent + ')');
2317              }
2318          }
2319      },
2320      setCurrentRailHandle: function setCurrentRailHandle(fakeTime) {
2321          var t = this;
2322          t.setCurrentRailMain(t, fakeTime);
2323      },
2324      setCurrentRail: function setCurrentRail() {
2325          var t = this;
2326          t.setCurrentRailMain(t);
2327      },
2328      setCurrentRailMain: function setCurrentRailMain(t, fakeTime) {
2329          if (t.getCurrentTime() !== undefined && t.getDuration()) {
2330              var nTime = typeof fakeTime === 'undefined' ? t.getCurrentTime() : fakeTime;
2331  
2332              if (t.total && t.handle) {
2333                  var tW = parseFloat(getComputedStyle(t.total).width);
2334  
2335                  var newWidth = Math.round(tW * nTime / t.getDuration()),
2336                      handlePos = newWidth - Math.round(t.handle.offsetWidth / 2);
2337  
2338                  handlePos = handlePos < 0 ? 0 : handlePos;
2339                  t.setTransformStyle(t.current, 'scaleX(' + newWidth / tW + ')');
2340                  t.setTransformStyle(t.handle, 'translateX(' + handlePos + 'px)');
2341  
2342                  if (t.options.useSmoothHover && !(0, _dom.hasClass)(t.hovered, 'no-hover')) {
2343                      var pos = parseInt(t.hovered.getAttribute('pos'), 10);
2344                      pos = isNaN(pos) ? 0 : pos;
2345  
2346                      var hoverScaleX = pos / tW - handlePos / tW;
2347  
2348                      t.hovered.style.left = handlePos + 'px';
2349                      t.setTransformStyle(t.hovered, 'scaleX(' + hoverScaleX + ')');
2350  
2351                      if (hoverScaleX >= 0) {
2352                          (0, _dom.removeClass)(t.hovered, 'negative');
2353                      } else {
2354                          (0, _dom.addClass)(t.hovered, 'negative');
2355                      }
2356                  }
2357              }
2358          }
2359      }
2360  });
2361  
2362  },{"18":18,"2":2,"27":27,"28":28,"32":32,"7":7}],14:[function(_dereq_,module,exports){
2363  'use strict';
2364  
2365  var _document = _dereq_(2);
2366  
2367  var _document2 = _interopRequireDefault(_document);
2368  
2369  var _player = _dereq_(18);
2370  
2371  var _player2 = _interopRequireDefault(_player);
2372  
2373  var _time = _dereq_(32);
2374  
2375  var _dom = _dereq_(28);
2376  
2377  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2378  
2379  Object.assign(_player.config, {
2380      duration: 0,
2381  
2382      timeAndDurationSeparator: '<span> | </span>'
2383  });
2384  
2385  Object.assign(_player2.default.prototype, {
2386      buildcurrent: function buildcurrent(player, controls, layers, media) {
2387          var t = this,
2388              time = _document2.default.createElement('div');
2389  
2390          time.className = t.options.classPrefix + 'time';
2391          time.setAttribute('role', 'timer');
2392          time.setAttribute('aria-live', 'off');
2393          time.innerHTML = '<span class="' + t.options.classPrefix + 'currenttime">' + (0, _time.secondsToTimeCode)(0, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat) + '</span>';
2394  
2395          t.addControlElement(time, 'current');
2396          player.updateCurrent();
2397          t.updateTimeCallback = function () {
2398              if (t.controlsAreVisible) {
2399                  player.updateCurrent();
2400              }
2401          };
2402          media.addEventListener('timeupdate', t.updateTimeCallback);
2403      },
2404      cleancurrent: function cleancurrent(player, controls, layers, media) {
2405          media.removeEventListener('timeupdate', player.updateTimeCallback);
2406      },
2407      buildduration: function buildduration(player, controls, layers, media) {
2408          var t = this,
2409              currTime = controls.lastChild.querySelector('.' + t.options.classPrefix + 'currenttime');
2410  
2411          if (currTime) {
2412              controls.querySelector('.' + t.options.classPrefix + 'time').innerHTML += t.options.timeAndDurationSeparator + '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>');
2413          } else {
2414              if (controls.querySelector('.' + t.options.classPrefix + 'currenttime')) {
2415                  (0, _dom.addClass)(controls.querySelector('.' + t.options.classPrefix + 'currenttime').parentNode, t.options.classPrefix + 'currenttime-container');
2416              }
2417  
2418              var duration = _document2.default.createElement('div');
2419              duration.className = t.options.classPrefix + 'time ' + t.options.classPrefix + 'duration-container';
2420              duration.innerHTML = '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>');
2421  
2422              t.addControlElement(duration, 'duration');
2423          }
2424  
2425          t.updateDurationCallback = function () {
2426              if (t.controlsAreVisible) {
2427                  player.updateDuration();
2428              }
2429          };
2430  
2431          media.addEventListener('timeupdate', t.updateDurationCallback);
2432      },
2433      cleanduration: function cleanduration(player, controls, layers, media) {
2434          media.removeEventListener('timeupdate', player.updateDurationCallback);
2435      },
2436      updateCurrent: function updateCurrent() {
2437          var t = this;
2438  
2439          var currentTime = t.getCurrentTime();
2440  
2441          if (isNaN(currentTime)) {
2442              currentTime = 0;
2443          }
2444  
2445          var timecode = (0, _time.secondsToTimeCode)(currentTime, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat);
2446  
2447          if (timecode.length > 5) {
2448              (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
2449          } else {
2450              (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
2451          }
2452  
2453          if (t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'currenttime')) {
2454              t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'currenttime').innerText = timecode;
2455          }
2456      },
2457      updateDuration: function updateDuration() {
2458          var t = this;
2459  
2460          var duration = t.getDuration();
2461  
2462          if (t.media !== undefined && (isNaN(duration) || duration === Infinity || duration < 0)) {
2463              t.media.duration = t.options.duration = duration = 0;
2464          }
2465  
2466          if (t.options.duration > 0) {
2467              duration = t.options.duration;
2468          }
2469  
2470          var timecode = (0, _time.secondsToTimeCode)(duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat);
2471  
2472          if (timecode.length > 5) {
2473              (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
2474          } else {
2475              (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
2476          }
2477  
2478          if (t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration') && duration > 0) {
2479              t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration').innerHTML = timecode;
2480          }
2481      }
2482  });
2483  
2484  },{"18":18,"2":2,"28":28,"32":32}],15:[function(_dereq_,module,exports){
2485  'use strict';
2486  
2487  var _document = _dereq_(2);
2488  
2489  var _document2 = _interopRequireDefault(_document);
2490  
2491  var _mejs = _dereq_(9);
2492  
2493  var _mejs2 = _interopRequireDefault(_mejs);
2494  
2495  var _i18n = _dereq_(7);
2496  
2497  var _i18n2 = _interopRequireDefault(_i18n);
2498  
2499  var _player = _dereq_(18);
2500  
2501  var _player2 = _interopRequireDefault(_player);
2502  
2503  var _time = _dereq_(32);
2504  
2505  var _general = _dereq_(29);
2506  
2507  var _dom = _dereq_(28);
2508  
2509  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2510  
2511  Object.assign(_player.config, {
2512      startLanguage: '',
2513  
2514      tracksText: null,
2515  
2516      chaptersText: null,
2517  
2518      tracksAriaLive: false,
2519  
2520      hideCaptionsButtonWhenEmpty: true,
2521  
2522      toggleCaptionsButtonWhenOnlyOne: false,
2523  
2524      slidesSelector: ''
2525  });
2526  
2527  Object.assign(_player2.default.prototype, {
2528      hasChapters: false,
2529  
2530      buildtracks: function buildtracks(player, controls, layers, media) {
2531  
2532          this.findTracks();
2533  
2534          if (!player.tracks.length && (!player.trackFiles || !player.trackFiles.length === 0)) {
2535              return;
2536          }
2537  
2538          var t = this,
2539              attr = t.options.tracksAriaLive ? ' role="log" aria-live="assertive" aria-atomic="false"' : '',
2540              tracksTitle = (0, _general.isString)(t.options.tracksText) ? t.options.tracksText : _i18n2.default.t('mejs.captions-subtitles'),
2541              chaptersTitle = (0, _general.isString)(t.options.chaptersText) ? t.options.chaptersText : _i18n2.default.t('mejs.captions-chapters'),
2542              total = player.trackFiles === null ? player.tracks.length : player.trackFiles.length;
2543  
2544          if (t.domNode.textTracks) {
2545              for (var i = t.domNode.textTracks.length - 1; i >= 0; i--) {
2546                  t.domNode.textTracks[i].mode = 'hidden';
2547              }
2548          }
2549  
2550          t.cleartracks(player);
2551  
2552          player.captions = _document2.default.createElement('div');
2553          player.captions.className = t.options.classPrefix + 'captions-layer ' + t.options.classPrefix + 'layer';
2554          player.captions.innerHTML = '<div class="' + t.options.classPrefix + 'captions-position ' + t.options.classPrefix + 'captions-position-hover"' + attr + '>' + ('<span class="' + t.options.classPrefix + 'captions-text"></span>') + '</div>';
2555          player.captions.style.display = 'none';
2556          layers.insertBefore(player.captions, layers.firstChild);
2557  
2558          player.captionsText = player.captions.querySelector('.' + t.options.classPrefix + 'captions-text');
2559  
2560          player.captionsButton = _document2.default.createElement('div');
2561          player.captionsButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'captions-button';
2562          player.captionsButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + tracksTitle + '" aria-label="' + tracksTitle + '" tabindex="0"></button>' + ('<div class="' + t.options.classPrefix + 'captions-selector ' + t.options.classPrefix + 'offscreen">') + ('<ul class="' + t.options.classPrefix + 'captions-selector-list">') + ('<li class="' + t.options.classPrefix + 'captions-selector-list-item">') + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + player.id + '_captions" id="' + player.id + '_captions_none" ') + 'value="none" checked disabled>' + ('<label class="' + t.options.classPrefix + 'captions-selector-label ') + (t.options.classPrefix + 'captions-selected" ') + ('for="' + player.id + '_captions_none">' + _i18n2.default.t('mejs.none') + '</label>') + '</li>' + '</ul>' + '</div>';
2563  
2564          t.addControlElement(player.captionsButton, 'tracks');
2565  
2566          player.captionsButton.querySelector('.' + t.options.classPrefix + 'captions-selector-input').disabled = false;
2567  
2568          player.chaptersButton = _document2.default.createElement('div');
2569          player.chaptersButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'chapters-button';
2570          player.chaptersButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + chaptersTitle + '" aria-label="' + chaptersTitle + '" tabindex="0"></button>' + ('<div class="' + t.options.classPrefix + 'chapters-selector ' + t.options.classPrefix + 'offscreen">') + ('<ul class="' + t.options.classPrefix + 'chapters-selector-list"></ul>') + '</div>';
2571  
2572          var subtitleCount = 0;
2573  
2574          for (var _i = 0; _i < total; _i++) {
2575              var kind = player.tracks[_i].kind,
2576                  src = player.tracks[_i].src;
2577              if (src.trim()) {
2578                  if (kind === 'subtitles' || kind === 'captions') {
2579                      subtitleCount++;
2580                  } else if (kind === 'chapters' && !controls.querySelector('.' + t.options.classPrefix + 'chapter-selector')) {
2581                      player.captionsButton.parentNode.insertBefore(player.chaptersButton, player.captionsButton);
2582                  }
2583              }
2584          }
2585  
2586          player.trackToLoad = -1;
2587          player.selectedTrack = null;
2588          player.isLoadingTrack = false;
2589  
2590          for (var _i2 = 0; _i2 < total; _i2++) {
2591              var _kind = player.tracks[_i2].kind;
2592              if (player.tracks[_i2].src.trim() && (_kind === 'subtitles' || _kind === 'captions')) {
2593                  player.addTrackButton(player.tracks[_i2].trackId, player.tracks[_i2].srclang, player.tracks[_i2].label);
2594              }
2595          }
2596  
2597          player.loadNextTrack();
2598  
2599          var inEvents = ['mouseenter', 'focusin'],
2600              outEvents = ['mouseleave', 'focusout'];
2601  
2602          if (t.options.toggleCaptionsButtonWhenOnlyOne && subtitleCount === 1) {
2603              player.captionsButton.addEventListener('click', function (e) {
2604                  var trackId = 'none';
2605                  if (player.selectedTrack === null) {
2606                      trackId = player.tracks[0].trackId;
2607                  }
2608                  var keyboard = e.keyCode || e.which;
2609                  player.setTrack(trackId, typeof keyboard !== 'undefined');
2610              });
2611          } else {
2612              var labels = player.captionsButton.querySelectorAll('.' + t.options.classPrefix + 'captions-selector-label'),
2613                  captions = player.captionsButton.querySelectorAll('input[type=radio]');
2614  
2615              for (var _i3 = 0, _total = inEvents.length; _i3 < _total; _i3++) {
2616                  player.captionsButton.addEventListener(inEvents[_i3], function () {
2617                      (0, _dom.removeClass)(this.querySelector('.' + t.options.classPrefix + 'captions-selector'), t.options.classPrefix + 'offscreen');
2618                  });
2619              }
2620  
2621              for (var _i4 = 0, _total2 = outEvents.length; _i4 < _total2; _i4++) {
2622                  player.captionsButton.addEventListener(outEvents[_i4], function () {
2623                      (0, _dom.addClass)(this.querySelector('.' + t.options.classPrefix + 'captions-selector'), t.options.classPrefix + 'offscreen');
2624                  });
2625              }
2626  
2627              for (var _i5 = 0, _total3 = captions.length; _i5 < _total3; _i5++) {
2628                  captions[_i5].addEventListener('click', function (e) {
2629                      var keyboard = e.keyCode || e.which;
2630                      player.setTrack(this.value, typeof keyboard !== 'undefined');
2631                  });
2632              }
2633  
2634              for (var _i6 = 0, _total4 = labels.length; _i6 < _total4; _i6++) {
2635                  labels[_i6].addEventListener('click', function (e) {
2636                      var radio = (0, _dom.siblings)(this, function (el) {
2637                          return el.tagName === 'INPUT';
2638                      })[0],
2639                          event = (0, _general.createEvent)('click', radio);
2640                      radio.dispatchEvent(event);
2641                      e.preventDefault();
2642                  });
2643              }
2644  
2645              player.captionsButton.addEventListener('keydown', function (e) {
2646                  e.stopPropagation();
2647              });
2648          }
2649  
2650          for (var _i7 = 0, _total5 = inEvents.length; _i7 < _total5; _i7++) {
2651              player.chaptersButton.addEventListener(inEvents[_i7], function () {
2652                  if (this.querySelector('.' + t.options.classPrefix + 'chapters-selector-list').children.length) {
2653                      (0, _dom.removeClass)(this.querySelector('.' + t.options.classPrefix + 'chapters-selector'), t.options.classPrefix + 'offscreen');
2654                  }
2655              });
2656          }
2657  
2658          for (var _i8 = 0, _total6 = outEvents.length; _i8 < _total6; _i8++) {
2659              player.chaptersButton.addEventListener(outEvents[_i8], function () {
2660                  (0, _dom.addClass)(this.querySelector('.' + t.options.classPrefix + 'chapters-selector'), t.options.classPrefix + 'offscreen');
2661              });
2662          }
2663  
2664          player.chaptersButton.addEventListener('keydown', function (e) {
2665              e.stopPropagation();
2666          });
2667  
2668          if (!player.options.alwaysShowControls) {
2669              player.getElement(player.container).addEventListener('controlsshown', function () {
2670                  (0, _dom.addClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover');
2671              });
2672  
2673              player.getElement(player.container).addEventListener('controlshidden', function () {
2674                  if (!media.paused) {
2675                      (0, _dom.removeClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover');
2676                  }
2677              });
2678          } else {
2679              (0, _dom.addClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover');
2680          }
2681  
2682          media.addEventListener('timeupdate', function () {
2683              player.displayCaptions();
2684          });
2685  
2686          if (player.options.slidesSelector !== '') {
2687              player.slidesContainer = _document2.default.querySelectorAll(player.options.slidesSelector);
2688  
2689              media.addEventListener('timeupdate', function () {
2690                  player.displaySlides();
2691              });
2692          }
2693      },
2694      cleartracks: function cleartracks(player) {
2695          if (player) {
2696              if (player.captions) {
2697                  player.captions.remove();
2698              }
2699              if (player.chapters) {
2700                  player.chapters.remove();
2701              }
2702              if (player.captionsText) {
2703                  player.captionsText.remove();
2704              }
2705              if (player.captionsButton) {
2706                  player.captionsButton.remove();
2707              }
2708              if (player.chaptersButton) {
2709                  player.chaptersButton.remove();
2710              }
2711          }
2712      },
2713      rebuildtracks: function rebuildtracks() {
2714          var t = this;
2715          t.findTracks();
2716          t.buildtracks(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
2717      },
2718      findTracks: function findTracks() {
2719          var t = this,
2720              tracktags = t.trackFiles === null ? t.node.querySelectorAll('track') : t.trackFiles,
2721              total = tracktags.length;
2722  
2723          t.tracks = [];
2724          for (var i = 0; i < total; i++) {
2725              var track = tracktags[i],
2726                  srclang = track.getAttribute('srclang').toLowerCase() || '',
2727                  trackId = t.id + '_track_' + i + '_' + track.getAttribute('kind') + '_' + srclang;
2728              t.tracks.push({
2729                  trackId: trackId,
2730                  srclang: srclang,
2731                  src: track.getAttribute('src'),
2732                  kind: track.getAttribute('kind'),
2733                  label: track.getAttribute('label') || '',
2734                  entries: [],
2735                  isLoaded: false
2736              });
2737          }
2738      },
2739      setTrack: function setTrack(trackId, setByKeyboard) {
2740  
2741          var t = this,
2742              radios = t.captionsButton.querySelectorAll('input[type="radio"]'),
2743              captions = t.captionsButton.querySelectorAll('.' + t.options.classPrefix + 'captions-selected'),
2744              track = t.captionsButton.querySelector('input[value="' + trackId + '"]');
2745  
2746          for (var i = 0, total = radios.length; i < total; i++) {
2747              radios[i].checked = false;
2748          }
2749  
2750          for (var _i9 = 0, _total7 = captions.length; _i9 < _total7; _i9++) {
2751              (0, _dom.removeClass)(captions[_i9], t.options.classPrefix + 'captions-selected');
2752          }
2753  
2754          track.checked = true;
2755          var labels = (0, _dom.siblings)(track, function (el) {
2756              return (0, _dom.hasClass)(el, t.options.classPrefix + 'captions-selector-label');
2757          });
2758          for (var _i10 = 0, _total8 = labels.length; _i10 < _total8; _i10++) {
2759              (0, _dom.addClass)(labels[_i10], t.options.classPrefix + 'captions-selected');
2760          }
2761  
2762          if (trackId === 'none') {
2763              t.selectedTrack = null;
2764              (0, _dom.removeClass)(t.captionsButton, t.options.classPrefix + 'captions-enabled');
2765          } else {
2766              for (var _i11 = 0, _total9 = t.tracks.length; _i11 < _total9; _i11++) {
2767                  var _track = t.tracks[_i11];
2768                  if (_track.trackId === trackId) {
2769                      if (t.selectedTrack === null) {
2770                          (0, _dom.addClass)(t.captionsButton, t.options.classPrefix + 'captions-enabled');
2771                      }
2772                      t.selectedTrack = _track;
2773                      t.captions.setAttribute('lang', t.selectedTrack.srclang);
2774                      t.displayCaptions();
2775                      break;
2776                  }
2777              }
2778          }
2779  
2780          var event = (0, _general.createEvent)('captionschange', t.media);
2781          event.detail.caption = t.selectedTrack;
2782          t.media.dispatchEvent(event);
2783  
2784          if (!setByKeyboard) {
2785              setTimeout(function () {
2786                  t.getElement(t.container).focus();
2787              }, 500);
2788          }
2789      },
2790      loadNextTrack: function loadNextTrack() {
2791          var t = this;
2792  
2793          t.trackToLoad++;
2794          if (t.trackToLoad < t.tracks.length) {
2795              t.isLoadingTrack = true;
2796              t.loadTrack(t.trackToLoad);
2797          } else {
2798              t.isLoadingTrack = false;
2799              t.checkForTracks();
2800          }
2801      },
2802      loadTrack: function loadTrack(index) {
2803          var t = this,
2804              track = t.tracks[index];
2805  
2806          if (track !== undefined && (track.src !== undefined || track.src !== "")) {
2807              (0, _dom.ajax)(track.src, 'text', function (d) {
2808                  track.entries = typeof d === 'string' && /<tt\s+xml/ig.exec(d) ? _mejs2.default.TrackFormatParser.dfxp.parse(d) : _mejs2.default.TrackFormatParser.webvtt.parse(d);
2809  
2810                  track.isLoaded = true;
2811                  t.enableTrackButton(track);
2812                  t.loadNextTrack();
2813  
2814                  if (track.kind === 'slides') {
2815                      t.setupSlides(track);
2816                  } else if (track.kind === 'chapters' && !t.hasChapters) {
2817                          t.drawChapters(track);
2818                          t.hasChapters = true;
2819                      }
2820              }, function () {
2821                  t.removeTrackButton(track.trackId);
2822                  t.loadNextTrack();
2823              });
2824          }
2825      },
2826      enableTrackButton: function enableTrackButton(track) {
2827          var t = this,
2828              lang = track.srclang,
2829              target = _document2.default.getElementById('' + track.trackId);
2830  
2831          if (!target) {
2832              return;
2833          }
2834  
2835          var label = track.label;
2836  
2837          if (label === '') {
2838              label = _i18n2.default.t(_mejs2.default.language.codes[lang]) || lang;
2839          }
2840          target.disabled = false;
2841          var targetSiblings = (0, _dom.siblings)(target, function (el) {
2842              return (0, _dom.hasClass)(el, t.options.classPrefix + 'captions-selector-label');
2843          });
2844          for (var i = 0, total = targetSiblings.length; i < total; i++) {
2845              targetSiblings[i].innerHTML = label;
2846          }
2847  
2848          if (t.options.startLanguage === lang) {
2849              target.checked = true;
2850              var event = (0, _general.createEvent)('click', target);
2851              target.dispatchEvent(event);
2852          }
2853      },
2854      removeTrackButton: function removeTrackButton(trackId) {
2855          var element = _document2.default.getElementById('' + trackId);
2856          if (element) {
2857              var button = element.closest('li');
2858              if (button) {
2859                  button.remove();
2860              }
2861          }
2862      },
2863      addTrackButton: function addTrackButton(trackId, lang, label) {
2864          var t = this;
2865          if (label === '') {
2866              label = _i18n2.default.t(_mejs2.default.language.codes[lang]) || lang;
2867          }
2868  
2869          t.captionsButton.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'captions-selector-list-item">' + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + t.id + '_captions" id="' + trackId + '" value="' + trackId + '" disabled>') + ('<label class="' + t.options.classPrefix + 'captions-selector-label"') + ('for="' + trackId + '">' + label + ' (loading)</label>') + '</li>';
2870      },
2871      checkForTracks: function checkForTracks() {
2872          var t = this;
2873  
2874          var hasSubtitles = false;
2875  
2876          if (t.options.hideCaptionsButtonWhenEmpty) {
2877              for (var i = 0, total = t.tracks.length; i < total; i++) {
2878                  var kind = t.tracks[i].kind;
2879                  if ((kind === 'subtitles' || kind === 'captions') && t.tracks[i].isLoaded) {
2880                      hasSubtitles = true;
2881                      break;
2882                  }
2883              }
2884  
2885              t.captionsButton.style.display = hasSubtitles ? '' : 'none';
2886              t.setControlsSize();
2887          }
2888      },
2889      displayCaptions: function displayCaptions() {
2890          if (this.tracks === undefined) {
2891              return;
2892          }
2893  
2894          var t = this,
2895              track = t.selectedTrack,
2896              sanitize = function sanitize(html) {
2897              var div = _document2.default.createElement('div');
2898              div.innerHTML = html;
2899  
2900              var scripts = div.getElementsByTagName('script');
2901              var i = scripts.length;
2902              while (i--) {
2903                  scripts[i].remove();
2904              }
2905  
2906              var allElements = div.getElementsByTagName('*');
2907              for (var _i12 = 0, n = allElements.length; _i12 < n; _i12++) {
2908                  var attributesObj = allElements[_i12].attributes,
2909                      attributes = Array.prototype.slice.call(attributesObj);
2910  
2911                  for (var j = 0, total = attributes.length; j < total; j++) {
2912                      if (attributes[j].name.startsWith('on') || attributes[j].value.startsWith('javascript')) {
2913                          allElements[_i12].remove();
2914                      } else if (attributes[j].name === 'style') {
2915                          allElements[_i12].removeAttribute(attributes[j].name);
2916                      }
2917                  }
2918              }
2919              return div.innerHTML;
2920          };
2921  
2922          if (track !== null && track.isLoaded) {
2923              var i = t.searchTrackPosition(track.entries, t.media.currentTime);
2924              if (i > -1) {
2925                  t.captionsText.innerHTML = sanitize(track.entries[i].text);
2926                  t.captionsText.className = t.options.classPrefix + 'captions-text ' + (track.entries[i].identifier || '');
2927                  t.captions.style.display = '';
2928                  t.captions.style.height = '0px';
2929                  return;
2930              }
2931              t.captions.style.display = 'none';
2932          } else {
2933              t.captions.style.display = 'none';
2934          }
2935      },
2936      setupSlides: function setupSlides(track) {
2937          var t = this;
2938          t.slides = track;
2939          t.slides.entries.imgs = [t.slides.entries.length];
2940          t.showSlide(0);
2941      },
2942      showSlide: function showSlide(index) {
2943          var _this = this;
2944  
2945          var t = this;
2946  
2947          if (t.tracks === undefined || t.slidesContainer === undefined) {
2948              return;
2949          }
2950  
2951          var url = t.slides.entries[index].text;
2952  
2953          var img = t.slides.entries[index].imgs;
2954  
2955          if (img === undefined || img.fadeIn === undefined) {
2956              var image = _document2.default.createElement('img');
2957              image.src = url;
2958              image.addEventListener('load', function () {
2959                  var self = _this,
2960                      visible = (0, _dom.siblings)(self, function (el) {
2961                      return visible(el);
2962                  });
2963                  self.style.display = 'none';
2964                  t.slidesContainer.innerHTML += self.innerHTML;
2965                  (0, _dom.fadeIn)(t.slidesContainer.querySelector(image));
2966                  for (var i = 0, total = visible.length; i < total; i++) {
2967                      (0, _dom.fadeOut)(visible[i], 400);
2968                  }
2969              });
2970              t.slides.entries[index].imgs = img = image;
2971          } else if (!(0, _dom.visible)(img)) {
2972              var _visible = (0, _dom.siblings)(self, function (el) {
2973                  return _visible(el);
2974              });
2975              (0, _dom.fadeIn)(t.slidesContainer.querySelector(img));
2976              for (var i = 0, total = _visible.length; i < total; i++) {
2977                  (0, _dom.fadeOut)(_visible[i]);
2978              }
2979          }
2980      },
2981      displaySlides: function displaySlides() {
2982          var t = this;
2983  
2984          if (this.slides === undefined) {
2985              return;
2986          }
2987  
2988          var slides = t.slides,
2989              i = t.searchTrackPosition(slides.entries, t.media.currentTime);
2990  
2991          if (i > -1) {
2992              t.showSlide(i);
2993          }
2994      },
2995      drawChapters: function drawChapters(chapters) {
2996          var t = this,
2997              total = chapters.entries.length;
2998  
2999          if (!total) {
3000              return;
3001          }
3002  
3003          t.chaptersButton.querySelector('ul').innerHTML = '';
3004  
3005          for (var i = 0; i < total; i++) {
3006              t.chaptersButton.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'chapters-selector-list-item" ' + 'role="menuitemcheckbox" aria-live="polite" aria-disabled="false" aria-checked="false">' + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + t.id + '_chapters" id="' + t.id + '_chapters_' + i + '" value="' + chapters.entries[i].start + '" disabled>') + ('<label class="' + t.options.classPrefix + 'chapters-selector-label"') + ('for="' + t.id + '_chapters_' + i + '">' + chapters.entries[i].text + '</label>') + '</li>';
3007          }
3008  
3009          var radios = t.chaptersButton.querySelectorAll('input[type="radio"]'),
3010              labels = t.chaptersButton.querySelectorAll('.' + t.options.classPrefix + 'chapters-selector-label');
3011  
3012          for (var _i13 = 0, _total10 = radios.length; _i13 < _total10; _i13++) {
3013              radios[_i13].disabled = false;
3014              radios[_i13].checked = false;
3015              radios[_i13].addEventListener('click', function (e) {
3016                  var self = this,
3017                      listItems = t.chaptersButton.querySelectorAll('li'),
3018                      label = (0, _dom.siblings)(self, function (el) {
3019                      return (0, _dom.hasClass)(el, t.options.classPrefix + 'chapters-selector-label');
3020                  })[0];
3021  
3022                  self.checked = true;
3023                  self.parentNode.setAttribute('aria-checked', true);
3024                  (0, _dom.addClass)(label, t.options.classPrefix + 'chapters-selected');
3025                  (0, _dom.removeClass)(t.chaptersButton.querySelector('.' + t.options.classPrefix + 'chapters-selected'), t.options.classPrefix + 'chapters-selected');
3026  
3027                  for (var _i14 = 0, _total11 = listItems.length; _i14 < _total11; _i14++) {
3028                      listItems[_i14].setAttribute('aria-checked', false);
3029                  }
3030  
3031                  var keyboard = e.keyCode || e.which;
3032                  if (typeof keyboard === 'undefined') {
3033                      setTimeout(function () {
3034                          t.getElement(t.container).focus();
3035                      }, 500);
3036                  }
3037  
3038                  t.media.setCurrentTime(parseFloat(self.value));
3039                  if (t.media.paused) {
3040                      t.media.play();
3041                  }
3042              });
3043          }
3044  
3045          for (var _i15 = 0, _total12 = labels.length; _i15 < _total12; _i15++) {
3046              labels[_i15].addEventListener('click', function (e) {
3047                  var radio = (0, _dom.siblings)(this, function (el) {
3048                      return el.tagName === 'INPUT';
3049                  })[0],
3050                      event = (0, _general.createEvent)('click', radio);
3051                  radio.dispatchEvent(event);
3052                  e.preventDefault();
3053              });
3054          }
3055      },
3056      searchTrackPosition: function searchTrackPosition(tracks, currentTime) {
3057          var lo = 0,
3058              hi = tracks.length - 1,
3059              mid = void 0,
3060              start = void 0,
3061              stop = void 0;
3062  
3063          while (lo <= hi) {
3064              mid = lo + hi >> 1;
3065              start = tracks[mid].start;
3066              stop = tracks[mid].stop;
3067  
3068              if (currentTime >= start && currentTime < stop) {
3069                  return mid;
3070              } else if (start < currentTime) {
3071                  lo = mid + 1;
3072              } else if (start > currentTime) {
3073                  hi = mid - 1;
3074              }
3075          }
3076  
3077          return -1;
3078      }
3079  });
3080  
3081  _mejs2.default.language = {
3082      codes: {
3083          af: 'mejs.afrikaans',
3084          sq: 'mejs.albanian',
3085          ar: 'mejs.arabic',
3086          be: 'mejs.belarusian',
3087          bg: 'mejs.bulgarian',
3088          ca: 'mejs.catalan',
3089          zh: 'mejs.chinese',
3090          'zh-cn': 'mejs.chinese-simplified',
3091          'zh-tw': 'mejs.chines-traditional',
3092          hr: 'mejs.croatian',
3093          cs: 'mejs.czech',
3094          da: 'mejs.danish',
3095          nl: 'mejs.dutch',
3096          en: 'mejs.english',
3097          et: 'mejs.estonian',
3098          fl: 'mejs.filipino',
3099          fi: 'mejs.finnish',
3100          fr: 'mejs.french',
3101          gl: 'mejs.galician',
3102          de: 'mejs.german',
3103          el: 'mejs.greek',
3104          ht: 'mejs.haitian-creole',
3105          iw: 'mejs.hebrew',
3106          hi: 'mejs.hindi',
3107          hu: 'mejs.hungarian',
3108          is: 'mejs.icelandic',
3109          id: 'mejs.indonesian',
3110          ga: 'mejs.irish',
3111          it: 'mejs.italian',
3112          ja: 'mejs.japanese',
3113          ko: 'mejs.korean',
3114          lv: 'mejs.latvian',
3115          lt: 'mejs.lithuanian',
3116          mk: 'mejs.macedonian',
3117          ms: 'mejs.malay',
3118          mt: 'mejs.maltese',
3119          no: 'mejs.norwegian',
3120          fa: 'mejs.persian',
3121          pl: 'mejs.polish',
3122          pt: 'mejs.portuguese',
3123          ro: 'mejs.romanian',
3124          ru: 'mejs.russian',
3125          sr: 'mejs.serbian',
3126          sk: 'mejs.slovak',
3127          sl: 'mejs.slovenian',
3128          es: 'mejs.spanish',
3129          sw: 'mejs.swahili',
3130          sv: 'mejs.swedish',
3131          tl: 'mejs.tagalog',
3132          th: 'mejs.thai',
3133          tr: 'mejs.turkish',
3134          uk: 'mejs.ukrainian',
3135          vi: 'mejs.vietnamese',
3136          cy: 'mejs.welsh',
3137          yi: 'mejs.yiddish'
3138      }
3139  };
3140  
3141  _mejs2.default.TrackFormatParser = {
3142      webvtt: {
3143          pattern: /^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
3144  
3145          parse: function parse(trackText) {
3146              var lines = trackText.split(/\r?\n/),
3147                  entries = [];
3148  
3149              var timecode = void 0,
3150                  text = void 0,
3151                  identifier = void 0;
3152  
3153              for (var i = 0, total = lines.length; i < total; i++) {
3154                  timecode = this.pattern.exec(lines[i]);
3155  
3156                  if (timecode && i < lines.length) {
3157                      if (i - 1 >= 0 && lines[i - 1] !== '') {
3158                          identifier = lines[i - 1];
3159                      }
3160                      i++;
3161  
3162                      text = lines[i];
3163                      i++;
3164                      while (lines[i] !== '' && i < lines.length) {
3165                          text = text + '\n' + lines[i];
3166                          i++;
3167                      }
3168                      text = text.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
3169                      entries.push({
3170                          identifier: identifier,
3171                          start: (0, _time.convertSMPTEtoSeconds)(timecode[1]) === 0 ? 0.200 : (0, _time.convertSMPTEtoSeconds)(timecode[1]),
3172                          stop: (0, _time.convertSMPTEtoSeconds)(timecode[3]),
3173                          text: text,
3174                          settings: timecode[5]
3175                      });
3176                  }
3177                  identifier = '';
3178              }
3179              return entries;
3180          }
3181      },
3182  
3183      dfxp: {
3184          parse: function parse(trackText) {
3185              trackText = $(trackText).filter('tt');
3186              var container = trackText.firstChild,
3187                  lines = container.querySelectorAll('p'),
3188                  styleNode = trackText.getElementById('' + container.attr('style')),
3189                  entries = [];
3190  
3191              var styles = void 0;
3192  
3193              if (styleNode.length) {
3194                  styleNode.removeAttribute('id');
3195                  var attributes = styleNode.attributes;
3196                  if (attributes.length) {
3197                      styles = {};
3198                      for (var i = 0, total = attributes.length; i < total; i++) {
3199                          styles[attributes[i].name.split(":")[1]] = attributes[i].value;
3200                      }
3201                  }
3202              }
3203  
3204              for (var _i16 = 0, _total13 = lines.length; _i16 < _total13; _i16++) {
3205                  var style = void 0,
3206                      _temp = {
3207                      start: null,
3208                      stop: null,
3209                      style: null,
3210                      text: null
3211                  };
3212  
3213                  if (lines.eq(_i16).attr('begin')) {
3214                      _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('begin'));
3215                  }
3216                  if (!_temp.start && lines.eq(_i16 - 1).attr('end')) {
3217                      _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 - 1).attr('end'));
3218                  }
3219                  if (lines.eq(_i16).attr('end')) {
3220                      _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('end'));
3221                  }
3222                  if (!_temp.stop && lines.eq(_i16 + 1).attr('begin')) {
3223                      _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 + 1).attr('begin'));
3224                  }
3225  
3226                  if (styles) {
3227                      style = '';
3228                      for (var _style in styles) {
3229                          style += _style + ':' + styles[_style] + ';';
3230                      }
3231                  }
3232                  if (style) {
3233                      _temp.style = style;
3234                  }
3235                  if (_temp.start === 0) {
3236                      _temp.start = 0.200;
3237                  }
3238                  _temp.text = lines.eq(_i16).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
3239                  entries.push(_temp);
3240              }
3241              return entries;
3242          }
3243      }
3244  };
3245  
3246  },{"18":18,"2":2,"28":28,"29":29,"32":32,"7":7,"9":9}],16:[function(_dereq_,module,exports){
3247  'use strict';
3248  
3249  var _document = _dereq_(2);
3250  
3251  var _document2 = _interopRequireDefault(_document);
3252  
3253  var _player = _dereq_(18);
3254  
3255  var _player2 = _interopRequireDefault(_player);
3256  
3257  var _i18n = _dereq_(7);
3258  
3259  var _i18n2 = _interopRequireDefault(_i18n);
3260  
3261  var _constants = _dereq_(27);
3262  
3263  var _general = _dereq_(29);
3264  
3265  var _dom = _dereq_(28);
3266  
3267  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3268  
3269  Object.assign(_player.config, {
3270      muteText: null,
3271  
3272      unmuteText: null,
3273  
3274      allyVolumeControlText: null,
3275  
3276      hideVolumeOnTouchDevices: true,
3277  
3278      audioVolume: 'horizontal',
3279  
3280      videoVolume: 'vertical',
3281  
3282      startVolume: 0.8
3283  });
3284  
3285  Object.assign(_player2.default.prototype, {
3286      buildvolume: function buildvolume(player, controls, layers, media) {
3287          if ((_constants.IS_ANDROID || _constants.IS_IOS) && this.options.hideVolumeOnTouchDevices) {
3288              return;
3289          }
3290  
3291          var t = this,
3292              mode = t.isVideo ? t.options.videoVolume : t.options.audioVolume,
3293              muteText = (0, _general.isString)(t.options.muteText) ? t.options.muteText : _i18n2.default.t('mejs.mute'),
3294              unmuteText = (0, _general.isString)(t.options.unmuteText) ? t.options.unmuteText : _i18n2.default.t('mejs.unmute'),
3295              volumeControlText = (0, _general.isString)(t.options.allyVolumeControlText) ? t.options.allyVolumeControlText : _i18n2.default.t('mejs.volume-help-text'),
3296              mute = _document2.default.createElement('div');
3297  
3298          mute.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'volume-button ' + t.options.classPrefix + 'mute';
3299          mute.innerHTML = mode === 'horizontal' ? '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' : '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' + ('<a href="javascript:void(0);" class="' + t.options.classPrefix + 'volume-slider" ') + ('aria-label="' + _i18n2.default.t('mejs.volume-slider') + '" aria-valuemin="0" aria-valuemax="100" role="slider" ') + 'aria-orientation="vertical">' + ('<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>') + ('<div class="' + t.options.classPrefix + 'volume-total">') + ('<div class="' + t.options.classPrefix + 'volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'volume-handle"></div>') + '</div>' + '</a>';
3300  
3301          t.addControlElement(mute, 'volume');
3302  
3303          t.options.keyActions.push({
3304              keys: [38],
3305              action: function action(player) {
3306                  var volumeSlider = player.getElement(player.container).querySelector('.' + _player.config.classPrefix + 'volume-slider');
3307                  if (volumeSlider && volumeSlider.matches(':focus')) {
3308                      volumeSlider.style.display = 'block';
3309                  }
3310                  if (player.isVideo) {
3311                      player.showControls();
3312                      player.startControlsTimer();
3313                  }
3314  
3315                  var newVolume = Math.min(player.volume + 0.1, 1);
3316                  player.setVolume(newVolume);
3317                  if (newVolume > 0) {
3318                      player.setMuted(false);
3319                  }
3320              }
3321          }, {
3322              keys: [40],
3323              action: function action(player) {
3324                  var volumeSlider = player.getElement(player.container).querySelector('.' + _player.config.classPrefix + 'volume-slider');
3325                  if (volumeSlider) {
3326                      volumeSlider.style.display = 'block';
3327                  }
3328  
3329                  if (player.isVideo) {
3330                      player.showControls();
3331                      player.startControlsTimer();
3332                  }
3333  
3334                  var newVolume = Math.max(player.volume - 0.1, 0);
3335                  player.setVolume(newVolume);
3336  
3337                  if (newVolume <= 0.1) {
3338                      player.setMuted(true);
3339                  }
3340              }
3341          }, {
3342              keys: [77],
3343              action: function action(player) {
3344                  player.getElement(player.container).querySelector('.' + _player.config.classPrefix + 'volume-slider').style.display = 'block';
3345                  if (player.isVideo) {
3346                      player.showControls();
3347                      player.startControlsTimer();
3348                  }
3349                  if (player.media.muted) {
3350                      player.setMuted(false);
3351                  } else {
3352                      player.setMuted(true);
3353                  }
3354              }
3355          });
3356  
3357          if (mode === 'horizontal') {
3358              var anchor = _document2.default.createElement('a');
3359              anchor.className = t.options.classPrefix + 'horizontal-volume-slider';
3360              anchor.href = 'javascript:void(0);';
3361              anchor.setAttribute('aria-label', _i18n2.default.t('mejs.volume-slider'));
3362              anchor.setAttribute('aria-valuemin', 0);
3363              anchor.setAttribute('aria-valuemax', 100);
3364              anchor.setAttribute('aria-valuenow', 100);
3365              anchor.setAttribute('role', 'slider');
3366              anchor.innerHTML += '<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>' + ('<div class="' + t.options.classPrefix + 'horizontal-volume-total">') + ('<div class="' + t.options.classPrefix + 'horizontal-volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'horizontal-volume-handle"></div>') + '</div>';
3367              mute.parentNode.insertBefore(anchor, mute.nextSibling);
3368          }
3369  
3370          var mouseIsDown = false,
3371              mouseIsOver = false,
3372              modified = false,
3373              updateVolumeSlider = function updateVolumeSlider() {
3374              var volume = Math.floor(media.volume * 100);
3375              volumeSlider.setAttribute('aria-valuenow', volume);
3376              volumeSlider.setAttribute('aria-valuetext', volume + '%');
3377          };
3378  
3379          var volumeSlider = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-slider') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-slider'),
3380              volumeTotal = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-total') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-total'),
3381              volumeCurrent = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-current') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-current'),
3382              volumeHandle = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-handle') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-handle'),
3383              positionVolumeHandle = function positionVolumeHandle(volume) {
3384  
3385              if (volume === null || isNaN(volume) || volume === undefined) {
3386                  return;
3387              }
3388  
3389              volume = Math.max(0, volume);
3390              volume = Math.min(volume, 1);
3391  
3392              if (volume === 0) {
3393                  (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute');
3394                  (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute');
3395                  var button = mute.firstElementChild;
3396                  button.setAttribute('title', unmuteText);
3397                  button.setAttribute('aria-label', unmuteText);
3398              } else {
3399                  (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute');
3400                  (0, _dom.addClass)(mute, t.options.classPrefix + 'mute');
3401                  var _button = mute.firstElementChild;
3402                  _button.setAttribute('title', muteText);
3403                  _button.setAttribute('aria-label', muteText);
3404              }
3405  
3406              var volumePercentage = volume * 100 + '%',
3407                  volumeStyles = getComputedStyle(volumeHandle);
3408  
3409              if (mode === 'vertical') {
3410                  volumeCurrent.style.bottom = 0;
3411                  volumeCurrent.style.height = volumePercentage;
3412                  volumeHandle.style.bottom = volumePercentage;
3413                  volumeHandle.style.marginBottom = -parseFloat(volumeStyles.height) / 2 + 'px';
3414              } else {
3415                  volumeCurrent.style.left = 0;
3416                  volumeCurrent.style.width = volumePercentage;
3417                  volumeHandle.style.left = volumePercentage;
3418                  volumeHandle.style.marginLeft = -parseFloat(volumeStyles.width) / 2 + 'px';
3419              }
3420          },
3421              handleVolumeMove = function handleVolumeMove(e) {
3422              var totalOffset = (0, _dom.offset)(volumeTotal),
3423                  volumeStyles = getComputedStyle(volumeTotal);
3424  
3425              modified = true;
3426  
3427              var volume = null;
3428  
3429              if (mode === 'vertical') {
3430                  var railHeight = parseFloat(volumeStyles.height),
3431                      newY = e.pageY - totalOffset.top;
3432  
3433                  volume = (railHeight - newY) / railHeight;
3434  
3435                  if (totalOffset.top === 0 || totalOffset.left === 0) {
3436                      return;
3437                  }
3438              } else {
3439                  var railWidth = parseFloat(volumeStyles.width),
3440                      newX = e.pageX - totalOffset.left;
3441  
3442                  volume = newX / railWidth;
3443              }
3444  
3445              volume = Math.max(0, volume);
3446              volume = Math.min(volume, 1);
3447  
3448              positionVolumeHandle(volume);
3449  
3450              t.setMuted(volume === 0);
3451              t.setVolume(volume);
3452  
3453              e.preventDefault();
3454              e.stopPropagation();
3455          },
3456              toggleMute = function toggleMute() {
3457              if (t.muted) {
3458                  positionVolumeHandle(0);
3459                  (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute');
3460                  (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute');
3461              } else {
3462                  positionVolumeHandle(media.volume);
3463                  (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute');
3464                  (0, _dom.addClass)(mute, t.options.classPrefix + 'mute');
3465              }
3466          };
3467  
3468          player.getElement(player.container).addEventListener('keydown', function (e) {
3469              var hasFocus = !!e.target.closest('.' + t.options.classPrefix + 'container');
3470              if (!hasFocus && mode === 'vertical') {
3471                  volumeSlider.style.display = 'none';
3472              }
3473          });
3474  
3475          mute.addEventListener('mouseenter', function (e) {
3476              if (e.target === mute) {
3477                  volumeSlider.style.display = 'block';
3478                  mouseIsOver = true;
3479                  e.preventDefault();
3480                  e.stopPropagation();
3481              }
3482          });
3483          mute.addEventListener('focusin', function () {
3484              volumeSlider.style.display = 'block';
3485              mouseIsOver = true;
3486          });
3487  
3488          mute.addEventListener('focusout', function (e) {
3489              if ((!e.relatedTarget || e.relatedTarget && !e.relatedTarget.matches('.' + t.options.classPrefix + 'volume-slider')) && mode === 'vertical') {
3490                  volumeSlider.style.display = 'none';
3491              }
3492          });
3493          mute.addEventListener('mouseleave', function () {
3494              mouseIsOver = false;
3495              if (!mouseIsDown && mode === 'vertical') {
3496                  volumeSlider.style.display = 'none';
3497              }
3498          });
3499          mute.addEventListener('focusout', function () {
3500              mouseIsOver = false;
3501          });
3502          mute.addEventListener('keydown', function (e) {
3503              if (t.options.enableKeyboard && t.options.keyActions.length) {
3504                  var keyCode = e.which || e.keyCode || 0,
3505                      volume = media.volume;
3506  
3507                  switch (keyCode) {
3508                      case 38:
3509                          volume = Math.min(volume + 0.1, 1);
3510                          break;
3511                      case 40:
3512                          volume = Math.max(0, volume - 0.1);
3513                          break;
3514                      default:
3515                          return true;
3516                  }
3517  
3518                  mouseIsDown = false;
3519                  positionVolumeHandle(volume);
3520                  media.setVolume(volume);
3521  
3522                  e.preventDefault();
3523                  e.stopPropagation();
3524              }
3525          });
3526          mute.querySelector('button').addEventListener('click', function () {
3527              media.setMuted(!media.muted);
3528              var event = (0, _general.createEvent)('volumechange', media);
3529              media.dispatchEvent(event);
3530          });
3531  
3532          volumeSlider.addEventListener('dragstart', function () {
3533              return false;
3534          });
3535  
3536          volumeSlider.addEventListener('mouseover', function () {
3537              mouseIsOver = true;
3538          });
3539          volumeSlider.addEventListener('focusin', function () {
3540              volumeSlider.style.display = 'block';
3541              mouseIsOver = true;
3542          });
3543          volumeSlider.addEventListener('focusout', function () {
3544              mouseIsOver = false;
3545              if (!mouseIsDown && mode === 'vertical') {
3546                  volumeSlider.style.display = 'none';
3547              }
3548          });
3549          volumeSlider.addEventListener('mousedown', function (e) {
3550              handleVolumeMove(e);
3551              t.globalBind('mousemove.vol', function (event) {
3552                  var target = event.target;
3553                  if (mouseIsDown && (target === volumeSlider || target.closest(mode === 'vertical' ? '.' + t.options.classPrefix + 'volume-slider' : '.' + t.options.classPrefix + 'horizontal-volume-slider'))) {
3554                      handleVolumeMove(event);
3555                  }
3556              });
3557              t.globalBind('mouseup.vol', function () {
3558                  mouseIsDown = false;
3559                  if (!mouseIsOver && mode === 'vertical') {
3560                      volumeSlider.style.display = 'none';
3561                  }
3562              });
3563              mouseIsDown = true;
3564              e.preventDefault();
3565              e.stopPropagation();
3566          });
3567  
3568          media.addEventListener('volumechange', function (e) {
3569              if (!mouseIsDown) {
3570                  toggleMute();
3571              }
3572              updateVolumeSlider(e);
3573          });
3574  
3575          var rendered = false;
3576          media.addEventListener('rendererready', function () {
3577              if (!modified) {
3578                  setTimeout(function () {
3579                      rendered = true;
3580                      if (player.options.startVolume === 0 || media.originalNode.muted) {
3581                          media.setMuted(true);
3582                          player.options.startVolume = 0;
3583                      }
3584                      media.setVolume(player.options.startVolume);
3585                      t.setControlsSize();
3586                  }, 250);
3587              }
3588          });
3589  
3590          media.addEventListener('loadedmetadata', function () {
3591              setTimeout(function () {
3592                  if (!modified && !rendered) {
3593                      if (player.options.startVolume === 0 || media.originalNode.muted) {
3594                          media.setMuted(true);
3595                      }
3596                      media.setVolume(player.options.startVolume);
3597                      t.setControlsSize();
3598                  }
3599                  rendered = false;
3600              }, 250);
3601          });
3602  
3603          if (player.options.startVolume === 0 || media.originalNode.muted) {
3604              media.setMuted(true);
3605              player.options.startVolume = 0;
3606              toggleMute();
3607          }
3608  
3609          t.getElement(t.container).addEventListener('controlsresize', function () {
3610              toggleMute();
3611          });
3612      }
3613  });
3614  
3615  },{"18":18,"2":2,"27":27,"28":28,"29":29,"7":7}],17:[function(_dereq_,module,exports){
3616  'use strict';
3617  
3618  Object.defineProperty(exports, "__esModule", {
3619      value: true
3620  });
3621  var EN = exports.EN = {
3622      'mejs.plural-form': 1,
3623  
3624      'mejs.download-file': 'Download File',
3625  
3626      '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/',
3627  
3628      'mejs.fullscreen': 'Fullscreen',
3629  
3630      'mejs.play': 'Play',
3631      'mejs.pause': 'Pause',
3632  
3633      'mejs.time-slider': 'Time Slider',
3634      'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.',
3635      'mejs.live-broadcast': 'Live Broadcast',
3636  
3637      'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.',
3638      'mejs.unmute': 'Unmute',
3639      'mejs.mute': 'Mute',
3640      'mejs.volume-slider': 'Volume Slider',
3641  
3642      'mejs.video-player': 'Video Player',
3643      'mejs.audio-player': 'Audio Player',
3644  
3645      'mejs.captions-subtitles': 'Captions/Subtitles',
3646      'mejs.captions-chapters': 'Chapters',
3647      'mejs.none': 'None',
3648      'mejs.afrikaans': 'Afrikaans',
3649      'mejs.albanian': 'Albanian',
3650      'mejs.arabic': 'Arabic',
3651      'mejs.belarusian': 'Belarusian',
3652      'mejs.bulgarian': 'Bulgarian',
3653      'mejs.catalan': 'Catalan',
3654      'mejs.chinese': 'Chinese',
3655      'mejs.chinese-simplified': 'Chinese (Simplified)',
3656      'mejs.chinese-traditional': 'Chinese (Traditional)',
3657      'mejs.croatian': 'Croatian',
3658      'mejs.czech': 'Czech',
3659      'mejs.danish': 'Danish',
3660      'mejs.dutch': 'Dutch',
3661      'mejs.english': 'English',
3662      'mejs.estonian': 'Estonian',
3663      'mejs.filipino': 'Filipino',
3664      'mejs.finnish': 'Finnish',
3665      'mejs.french': 'French',
3666      'mejs.galician': 'Galician',
3667      'mejs.german': 'German',
3668      'mejs.greek': 'Greek',
3669      'mejs.haitian-creole': 'Haitian Creole',
3670      'mejs.hebrew': 'Hebrew',
3671      'mejs.hindi': 'Hindi',
3672      'mejs.hungarian': 'Hungarian',
3673      'mejs.icelandic': 'Icelandic',
3674      'mejs.indonesian': 'Indonesian',
3675      'mejs.irish': 'Irish',
3676      'mejs.italian': 'Italian',
3677      'mejs.japanese': 'Japanese',
3678      'mejs.korean': 'Korean',
3679      'mejs.latvian': 'Latvian',
3680      'mejs.lithuanian': 'Lithuanian',
3681      'mejs.macedonian': 'Macedonian',
3682      'mejs.malay': 'Malay',
3683      'mejs.maltese': 'Maltese',
3684      'mejs.norwegian': 'Norwegian',
3685      'mejs.persian': 'Persian',
3686      'mejs.polish': 'Polish',
3687      'mejs.portuguese': 'Portuguese',
3688      'mejs.romanian': 'Romanian',
3689      'mejs.russian': 'Russian',
3690      'mejs.serbian': 'Serbian',
3691      'mejs.slovak': 'Slovak',
3692      'mejs.slovenian': 'Slovenian',
3693      'mejs.spanish': 'Spanish',
3694      'mejs.swahili': 'Swahili',
3695      'mejs.swedish': 'Swedish',
3696      'mejs.tagalog': 'Tagalog',
3697      'mejs.thai': 'Thai',
3698      'mejs.turkish': 'Turkish',
3699      'mejs.ukrainian': 'Ukrainian',
3700      'mejs.vietnamese': 'Vietnamese',
3701      'mejs.welsh': 'Welsh',
3702      'mejs.yiddish': 'Yiddish'
3703  };
3704  
3705  },{}],18:[function(_dereq_,module,exports){
3706  'use strict';
3707  
3708  Object.defineProperty(exports, "__esModule", {
3709      value: true
3710  });
3711  exports.config = undefined;
3712  
3713  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; };
3714  
3715  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; }; }();
3716  
3717  var _window = _dereq_(3);
3718  
3719  var _window2 = _interopRequireDefault(_window);
3720  
3721  var _document = _dereq_(2);
3722  
3723  var _document2 = _interopRequireDefault(_document);
3724  
3725  var _mejs = _dereq_(9);
3726  
3727  var _mejs2 = _interopRequireDefault(_mejs);
3728  
3729  var _mediaelement = _dereq_(8);
3730  
3731  var _mediaelement2 = _interopRequireDefault(_mediaelement);
3732  
3733  var _default = _dereq_(19);
3734  
3735  var _default2 = _interopRequireDefault(_default);
3736  
3737  var _i18n = _dereq_(7);
3738  
3739  var _i18n2 = _interopRequireDefault(_i18n);
3740  
3741  var _constants = _dereq_(27);
3742  
3743  var _general = _dereq_(29);
3744  
3745  var _time = _dereq_(32);
3746  
3747  var _media = _dereq_(30);
3748  
3749  var _dom = _dereq_(28);
3750  
3751  var dom = _interopRequireWildcard(_dom);
3752  
3753  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
3754  
3755  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3756  
3757  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3758  
3759  _mejs2.default.mepIndex = 0;
3760  
3761  _mejs2.default.players = {};
3762  
3763  var config = exports.config = {
3764      poster: '',
3765  
3766      showPosterWhenEnded: false,
3767  
3768      showPosterWhenPaused: false,
3769  
3770      defaultVideoWidth: 480,
3771  
3772      defaultVideoHeight: 270,
3773  
3774      videoWidth: -1,
3775  
3776      videoHeight: -1,
3777  
3778      defaultAudioWidth: 400,
3779  
3780      defaultAudioHeight: 40,
3781  
3782      defaultSeekBackwardInterval: function defaultSeekBackwardInterval(media) {
3783          return media.getDuration() * 0.05;
3784      },
3785  
3786      defaultSeekForwardInterval: function defaultSeekForwardInterval(media) {
3787          return media.getDuration() * 0.05;
3788      },
3789  
3790      setDimensions: true,
3791  
3792      audioWidth: -1,
3793  
3794      audioHeight: -1,
3795  
3796      loop: false,
3797  
3798      autoRewind: true,
3799  
3800      enableAutosize: true,
3801  
3802      timeFormat: '',
3803  
3804      alwaysShowHours: false,
3805  
3806      showTimecodeFrameCount: false,
3807  
3808      framesPerSecond: 25,
3809  
3810      alwaysShowControls: false,
3811  
3812      hideVideoControlsOnLoad: false,
3813  
3814      hideVideoControlsOnPause: false,
3815  
3816      clickToPlayPause: true,
3817  
3818      controlsTimeoutDefault: 1500,
3819  
3820      controlsTimeoutMouseEnter: 2500,
3821  
3822      controlsTimeoutMouseLeave: 1000,
3823  
3824      iPadUseNativeControls: false,
3825  
3826      iPhoneUseNativeControls: false,
3827  
3828      AndroidUseNativeControls: false,
3829  
3830      features: ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen'],
3831  
3832      useDefaultControls: false,
3833  
3834      isVideo: true,
3835  
3836      stretching: 'auto',
3837  
3838      classPrefix: 'mejs__',
3839  
3840      enableKeyboard: true,
3841  
3842      pauseOtherPlayers: true,
3843  
3844      secondsDecimalLength: 0,
3845  
3846      customError: null,
3847  
3848      keyActions: [{
3849          keys: [32, 179],
3850          action: function action(player) {
3851  
3852              if (!_constants.IS_FIREFOX) {
3853                  if (player.paused || player.ended) {
3854                      player.play();
3855                  } else {
3856                      player.pause();
3857                  }
3858              }
3859          }
3860      }]
3861  };
3862  
3863  _mejs2.default.MepDefaults = config;
3864  
3865  var MediaElementPlayer = function () {
3866  	function MediaElementPlayer(node, o) {
3867          _classCallCheck(this, MediaElementPlayer);
3868  
3869          var t = this,
3870              element = typeof node === 'string' ? _document2.default.getElementById(node) : node;
3871  
3872          if (!(t instanceof MediaElementPlayer)) {
3873              return new MediaElementPlayer(element, o);
3874          }
3875  
3876          t.node = t.media = element;
3877  
3878          if (!t.node) {
3879              return;
3880          }
3881  
3882          if (t.media.player) {
3883              return t.media.player;
3884          }
3885  
3886          t.hasFocus = false;
3887  
3888          t.controlsAreVisible = true;
3889  
3890          t.controlsEnabled = true;
3891  
3892          t.controlsTimer = null;
3893  
3894          t.currentMediaTime = 0;
3895  
3896          t.proxy = null;
3897  
3898          if (o === undefined) {
3899              var options = t.node.getAttribute('data-mejsoptions');
3900              o = options ? JSON.parse(options) : {};
3901          }
3902  
3903          t.options = Object.assign({}, config, o);
3904  
3905          if (t.options.loop && !t.media.getAttribute('loop')) {
3906              t.media.loop = true;
3907              t.node.loop = true;
3908          } else if (t.media.loop) {
3909              t.options.loop = true;
3910          }
3911  
3912          if (!t.options.timeFormat) {
3913              t.options.timeFormat = 'mm:ss';
3914              if (t.options.alwaysShowHours) {
3915                  t.options.timeFormat = 'hh:mm:ss';
3916              }
3917              if (t.options.showTimecodeFrameCount) {
3918                  t.options.timeFormat += ':ff';
3919              }
3920          }
3921  
3922          (0, _time.calculateTimeFormat)(0, t.options, t.options.framesPerSecond || 25);
3923  
3924          t.id = 'mep_' + _mejs2.default.mepIndex++;
3925  
3926          _mejs2.default.players[t.id] = t;
3927  
3928          t.init();
3929  
3930          return t;
3931      }
3932  
3933      _createClass(MediaElementPlayer, [{
3934          key: 'getElement',
3935          value: function getElement(element) {
3936              return element;
3937          }
3938      }, {
3939          key: 'init',
3940          value: function init() {
3941              var t = this,
3942                  playerOptions = Object.assign({}, t.options, {
3943                  success: function success(media, domNode) {
3944                      t._meReady(media, domNode);
3945                  },
3946                  error: function error(e) {
3947                      t._handleError(e);
3948                  }
3949              }),
3950                  tagName = t.node.tagName.toLowerCase();
3951  
3952              t.isDynamic = tagName !== 'audio' && tagName !== 'video' && tagName !== 'iframe';
3953              t.isVideo = t.isDynamic ? t.options.isVideo : tagName !== 'audio' && t.options.isVideo;
3954              t.mediaFiles = null;
3955              t.trackFiles = null;
3956  
3957              if (_constants.IS_IPAD && t.options.iPadUseNativeControls || _constants.IS_IPHONE && t.options.iPhoneUseNativeControls) {
3958                  t.node.setAttribute('controls', true);
3959  
3960                  if (_constants.IS_IPAD && t.node.getAttribute('autoplay')) {
3961                      t.play();
3962                  }
3963              } else if ((t.isVideo || !t.isVideo && (t.options.features.length || t.options.useDefaultControls)) && !(_constants.IS_ANDROID && t.options.AndroidUseNativeControls)) {
3964                  t.node.removeAttribute('controls');
3965                  var videoPlayerTitle = t.isVideo ? _i18n2.default.t('mejs.video-player') : _i18n2.default.t('mejs.audio-player');
3966  
3967                  var offscreen = _document2.default.createElement('span');
3968                  offscreen.className = t.options.classPrefix + 'offscreen';
3969                  offscreen.innerText = videoPlayerTitle;
3970                  t.media.parentNode.insertBefore(offscreen, t.media);
3971  
3972                  t.container = _document2.default.createElement('div');
3973                  t.getElement(t.container).id = t.id;
3974                  t.getElement(t.container).className = t.options.classPrefix + 'container ' + t.options.classPrefix + 'container-keyboard-inactive ' + t.media.className;
3975                  t.getElement(t.container).tabIndex = 0;
3976                  t.getElement(t.container).setAttribute('role', 'application');
3977                  t.getElement(t.container).setAttribute('aria-label', videoPlayerTitle);
3978                  t.getElement(t.container).innerHTML = '<div class="' + t.options.classPrefix + 'inner">' + ('<div class="' + t.options.classPrefix + 'mediaelement"></div>') + ('<div class="' + t.options.classPrefix + 'layers"></div>') + ('<div class="' + t.options.classPrefix + 'controls"></div>') + '</div>';
3979                  t.getElement(t.container).addEventListener('focus', function (e) {
3980                      if (!t.controlsAreVisible && !t.hasFocus && t.controlsEnabled) {
3981                          t.showControls(true);
3982  
3983                          var btnSelector = (0, _general.isNodeAfter)(e.relatedTarget, t.getElement(t.container)) ? '.' + t.options.classPrefix + 'controls .' + t.options.classPrefix + 'button:last-child > button' : '.' + t.options.classPrefix + 'playpause-button > button',
3984                              button = t.getElement(t.container).querySelector(btnSelector);
3985  
3986                          button.focus();
3987                      }
3988                  });
3989                  t.node.parentNode.insertBefore(t.getElement(t.container), t.node);
3990  
3991                  if (!t.options.features.length && !t.options.useDefaultControls) {
3992                      t.getElement(t.container).style.background = 'transparent';
3993                      t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'controls').style.display = 'none';
3994                  }
3995  
3996                  if (t.isVideo && t.options.stretching === 'fill' && !dom.hasClass(t.getElement(t.container).parentNode, t.options.classPrefix + 'fill-container')) {
3997                      t.outerContainer = t.media.parentNode;
3998  
3999                      var wrapper = _document2.default.createElement('div');
4000                      wrapper.className = t.options.classPrefix + 'fill-container';
4001                      t.getElement(t.container).parentNode.insertBefore(wrapper, t.getElement(t.container));
4002                      wrapper.appendChild(t.getElement(t.container));
4003                  }
4004  
4005                  if (_constants.IS_ANDROID) {
4006                      dom.addClass(t.getElement(t.container), t.options.classPrefix + 'android');
4007                  }
4008                  if (_constants.IS_IOS) {
4009                      dom.addClass(t.getElement(t.container), t.options.classPrefix + 'ios');
4010                  }
4011                  if (_constants.IS_IPAD) {
4012                      dom.addClass(t.getElement(t.container), t.options.classPrefix + 'ipad');
4013                  }
4014                  if (_constants.IS_IPHONE) {
4015                      dom.addClass(t.getElement(t.container), t.options.classPrefix + 'iphone');
4016                  }
4017                  dom.addClass(t.getElement(t.container), t.isVideo ? t.options.classPrefix + 'video' : t.options.classPrefix + 'audio');
4018  
4019                  if (_constants.IS_SAFARI && !_constants.IS_IOS) {
4020  
4021                      dom.addClass(t.getElement(t.container), t.options.classPrefix + 'hide-cues');
4022  
4023                      var cloneNode = t.node.cloneNode(),
4024                          children = t.node.children,
4025                          mediaFiles = [],
4026                          tracks = [];
4027  
4028                      for (var i = 0, total = children.length; i < total; i++) {
4029                          var childNode = children[i];
4030  
4031                          (function () {
4032                              switch (childNode.tagName.toLowerCase()) {
4033                                  case 'source':
4034                                      var elements = {};
4035                                      Array.prototype.slice.call(childNode.attributes).forEach(function (item) {
4036                                          elements[item.name] = item.value;
4037                                      });
4038                                      elements.type = (0, _media.formatType)(elements.src, elements.type);
4039                                      mediaFiles.push(elements);
4040                                      break;
4041                                  case 'track':
4042                                      childNode.mode = 'hidden';
4043                                      tracks.push(childNode);
4044                                      break;
4045                                  default:
4046                                      cloneNode.appendChild(childNode.cloneNode(true));
4047                                      break;
4048                              }
4049                          })();
4050                      }
4051  
4052                      t.node.remove();
4053                      t.node = t.media = cloneNode;
4054  
4055                      if (mediaFiles.length) {
4056                          t.mediaFiles = mediaFiles;
4057                      }
4058                      if (tracks.length) {
4059                          t.trackFiles = tracks;
4060                      }
4061                  }
4062  
4063                  t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'mediaelement').appendChild(t.node);
4064  
4065                  t.media.player = t;
4066  
4067                  t.controls = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'controls');
4068                  t.layers = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'layers');
4069  
4070                  var tagType = t.isVideo ? 'video' : 'audio',
4071                      capsTagName = tagType.substring(0, 1).toUpperCase() + tagType.substring(1);
4072  
4073                  if (t.options[tagType + 'Width'] > 0 || t.options[tagType + 'Width'].toString().indexOf('%') > -1) {
4074                      t.width = t.options[tagType + 'Width'];
4075                  } else if (t.node.style.width !== '' && t.node.style.width !== null) {
4076                      t.width = t.node.style.width;
4077                  } else if (t.node.getAttribute('width')) {
4078                      t.width = t.node.getAttribute('width');
4079                  } else {
4080                      t.width = t.options['default' + capsTagName + 'Width'];
4081                  }
4082  
4083                  if (t.options[tagType + 'Height'] > 0 || t.options[tagType + 'Height'].toString().indexOf('%') > -1) {
4084                      t.height = t.options[tagType + 'Height'];
4085                  } else if (t.node.style.height !== '' && t.node.style.height !== null) {
4086                      t.height = t.node.style.height;
4087                  } else if (t.node.getAttribute('height')) {
4088                      t.height = t.node.getAttribute('height');
4089                  } else {
4090                      t.height = t.options['default' + capsTagName + 'Height'];
4091                  }
4092  
4093                  t.initialAspectRatio = t.height >= t.width ? t.width / t.height : t.height / t.width;
4094  
4095                  t.setPlayerSize(t.width, t.height);
4096  
4097                  playerOptions.pluginWidth = t.width;
4098                  playerOptions.pluginHeight = t.height;
4099              } else if (!t.isVideo && !t.options.features.length && !t.options.useDefaultControls) {
4100                      t.node.style.display = 'none';
4101                  }
4102  
4103              _mejs2.default.MepDefaults = playerOptions;
4104  
4105              new _mediaelement2.default(t.media, playerOptions, t.mediaFiles);
4106  
4107              if (t.getElement(t.container) !== undefined && t.options.features.length && t.controlsAreVisible && !t.options.hideVideoControlsOnLoad) {
4108                  var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container));
4109                  t.getElement(t.container).dispatchEvent(event);
4110              }
4111          }
4112      }, {
4113          key: 'showControls',
4114          value: function showControls(doAnimation) {
4115              var t = this;
4116  
4117              doAnimation = doAnimation === undefined || doAnimation;
4118  
4119              if (t.controlsAreVisible || !t.isVideo) {
4120                  return;
4121              }
4122  
4123              if (doAnimation) {
4124                  (function () {
4125                      dom.fadeIn(t.getElement(t.controls), 200, function () {
4126                          dom.removeClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
4127                          var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container));
4128                          t.getElement(t.container).dispatchEvent(event);
4129                      });
4130  
4131                      var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
4132  
4133                      var _loop = function _loop(i, total) {
4134                          dom.fadeIn(controls[i], 200, function () {
4135                              dom.removeClass(controls[i], t.options.classPrefix + 'offscreen');
4136                          });
4137                      };
4138  
4139                      for (var i = 0, total = controls.length; i < total; i++) {
4140                          _loop(i, total);
4141                      }
4142                  })();
4143              } else {
4144                  dom.removeClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
4145                  t.getElement(t.controls).style.display = '';
4146                  t.getElement(t.controls).style.opacity = 1;
4147  
4148                  var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
4149                  for (var i = 0, total = controls.length; i < total; i++) {
4150                      dom.removeClass(controls[i], t.options.classPrefix + 'offscreen');
4151                      controls[i].style.display = '';
4152                  }
4153  
4154                  var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container));
4155                  t.getElement(t.container).dispatchEvent(event);
4156              }
4157  
4158              t.controlsAreVisible = true;
4159              t.setControlsSize();
4160          }
4161      }, {
4162          key: 'hideControls',
4163          value: function hideControls(doAnimation, forceHide) {
4164              var t = this;
4165  
4166              doAnimation = doAnimation === undefined || doAnimation;
4167  
4168              if (forceHide !== true && (!t.controlsAreVisible || t.options.alwaysShowControls || t.paused && t.readyState === 4 && (!t.options.hideVideoControlsOnLoad && t.currentTime <= 0 || !t.options.hideVideoControlsOnPause && t.currentTime > 0) || t.isVideo && !t.options.hideVideoControlsOnLoad && !t.readyState || t.ended)) {
4169                  return;
4170              }
4171  
4172              if (doAnimation) {
4173                  (function () {
4174                      dom.fadeOut(t.getElement(t.controls), 200, function () {
4175                          dom.addClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
4176                          t.getElement(t.controls).style.display = '';
4177                          var event = (0, _general.createEvent)('controlshidden', t.getElement(t.container));
4178                          t.getElement(t.container).dispatchEvent(event);
4179                      });
4180  
4181                      var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
4182  
4183                      var _loop2 = function _loop2(i, total) {
4184                          dom.fadeOut(controls[i], 200, function () {
4185                              dom.addClass(controls[i], t.options.classPrefix + 'offscreen');
4186                              controls[i].style.display = '';
4187                          });
4188                      };
4189  
4190                      for (var i = 0, total = controls.length; i < total; i++) {
4191                          _loop2(i, total);
4192                      }
4193                  })();
4194              } else {
4195                  dom.addClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
4196                  t.getElement(t.controls).style.display = '';
4197                  t.getElement(t.controls).style.opacity = 0;
4198  
4199                  var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
4200                  for (var i = 0, total = controls.length; i < total; i++) {
4201                      dom.addClass(controls[i], t.options.classPrefix + 'offscreen');
4202                      controls[i].style.display = '';
4203                  }
4204  
4205                  var event = (0, _general.createEvent)('controlshidden', t.getElement(t.container));
4206                  t.getElement(t.container).dispatchEvent(event);
4207              }
4208  
4209              t.controlsAreVisible = false;
4210          }
4211      }, {
4212          key: 'startControlsTimer',
4213          value: function startControlsTimer(timeout) {
4214              var t = this;
4215  
4216              timeout = typeof timeout !== 'undefined' ? timeout : t.options.controlsTimeoutDefault;
4217  
4218              t.killControlsTimer('start');
4219  
4220              t.controlsTimer = setTimeout(function () {
4221                  t.hideControls();
4222                  t.killControlsTimer('hide');
4223              }, timeout);
4224          }
4225      }, {
4226          key: 'killControlsTimer',
4227          value: function killControlsTimer() {
4228              var t = this;
4229  
4230              if (t.controlsTimer !== null) {
4231                  clearTimeout(t.controlsTimer);
4232                  delete t.controlsTimer;
4233                  t.controlsTimer = null;
4234              }
4235          }
4236      }, {
4237          key: 'disableControls',
4238          value: function disableControls() {
4239              var t = this;
4240  
4241              t.killControlsTimer();
4242              t.controlsEnabled = false;
4243              t.hideControls(false, true);
4244          }
4245      }, {
4246          key: 'enableControls',
4247          value: function enableControls() {
4248              var t = this;
4249  
4250              t.controlsEnabled = true;
4251              t.showControls(false);
4252          }
4253      }, {
4254          key: '_setDefaultPlayer',
4255          value: function _setDefaultPlayer() {
4256              var t = this;
4257              if (t.proxy) {
4258                  t.proxy.pause();
4259              }
4260              t.proxy = new _default2.default(t);
4261              t.media.addEventListener('loadedmetadata', function () {
4262                  if (t.getCurrentTime() > 0 && t.currentMediaTime > 0) {
4263                      t.setCurrentTime(t.currentMediaTime);
4264                      if (!_constants.IS_IOS && !_constants.IS_ANDROID) {
4265                          t.play();
4266                      }
4267                  }
4268              });
4269          }
4270      }, {
4271          key: '_meReady',
4272          value: function _meReady(media, domNode) {
4273              var t = this,
4274                  autoplayAttr = domNode.getAttribute('autoplay'),
4275                  autoplay = !(autoplayAttr === undefined || autoplayAttr === null || autoplayAttr === 'false'),
4276                  isNative = media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
4277  
4278              if (t.getElement(t.controls)) {
4279                  t.enableControls();
4280              }
4281  
4282              if (t.getElement(t.container) && t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-play')) {
4283                  t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-play').style.display = '';
4284              }
4285  
4286              if (t.created) {
4287                  return;
4288              }
4289  
4290              t.created = true;
4291              t.media = media;
4292              t.domNode = domNode;
4293  
4294              if (!(_constants.IS_ANDROID && t.options.AndroidUseNativeControls) && !(_constants.IS_IPAD && t.options.iPadUseNativeControls) && !(_constants.IS_IPHONE && t.options.iPhoneUseNativeControls)) {
4295                  if (!t.isVideo && !t.options.features.length && !t.options.useDefaultControls) {
4296                      if (autoplay && isNative) {
4297                          t.play();
4298                      }
4299  
4300                      if (t.options.success) {
4301  
4302                          if (typeof t.options.success === 'string') {
4303                              _window2.default[t.options.success](t.media, t.domNode, t);
4304                          } else {
4305                              t.options.success(t.media, t.domNode, t);
4306                          }
4307                      }
4308  
4309                      return;
4310                  }
4311  
4312                  t.featurePosition = {};
4313  
4314                  t._setDefaultPlayer();
4315  
4316                  t.buildposter(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
4317                  t.buildkeyboard(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
4318                  t.buildoverlays(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
4319  
4320                  if (t.options.useDefaultControls) {
4321                      var defaultControls = ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen'];
4322                      t.options.features = defaultControls.concat(t.options.features.filter(function (item) {
4323                          return defaultControls.indexOf(item) === -1;
4324                      }));
4325                  }
4326  
4327                  t.buildfeatures(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
4328  
4329                  var event = (0, _general.createEvent)('controlsready', t.getElement(t.container));
4330                  t.getElement(t.container).dispatchEvent(event);
4331  
4332                  t.setPlayerSize(t.width, t.height);
4333                  t.setControlsSize();
4334  
4335                  if (t.isVideo) {
4336                      t.clickToPlayPauseCallback = function () {
4337  
4338                          if (t.options.clickToPlayPause) {
4339                              var button = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-button'),
4340                                  pressed = button.getAttribute('aria-pressed');
4341  
4342                              if (t.paused && pressed) {
4343                                  t.pause();
4344                              } else if (t.paused) {
4345                                  t.play();
4346                              } else {
4347                                  t.pause();
4348                              }
4349  
4350                              button.setAttribute('aria-pressed', !pressed);
4351                              t.getElement(t.container).focus();
4352                          }
4353                      };
4354  
4355                      t.createIframeLayer();
4356  
4357                      t.media.addEventListener('click', t.clickToPlayPauseCallback);
4358  
4359                      if ((_constants.IS_ANDROID || _constants.IS_IOS) && !t.options.alwaysShowControls) {
4360                          t.node.addEventListener('touchstart', function () {
4361                              if (t.controlsAreVisible) {
4362                                  t.hideControls(false);
4363                              } else {
4364                                  if (t.controlsEnabled) {
4365                                      t.showControls(false);
4366                                  }
4367                              }
4368                          }, _constants.SUPPORT_PASSIVE_EVENT ? { passive: true } : false);
4369                      } else {
4370                          t.getElement(t.container).addEventListener('mouseenter', function () {
4371                              if (t.controlsEnabled) {
4372                                  if (!t.options.alwaysShowControls) {
4373                                      t.killControlsTimer('enter');
4374                                      t.showControls();
4375                                      t.startControlsTimer(t.options.controlsTimeoutMouseEnter);
4376                                  }
4377                              }
4378                          });
4379                          t.getElement(t.container).addEventListener('mousemove', function () {
4380                              if (t.controlsEnabled) {
4381                                  if (!t.controlsAreVisible) {
4382                                      t.showControls();
4383                                  }
4384                                  if (!t.options.alwaysShowControls) {
4385                                      t.startControlsTimer(t.options.controlsTimeoutMouseEnter);
4386                                  }
4387                              }
4388                          });
4389                          t.getElement(t.container).addEventListener('mouseleave', function () {
4390                              if (t.controlsEnabled) {
4391                                  if (!t.paused && !t.options.alwaysShowControls) {
4392                                      t.startControlsTimer(t.options.controlsTimeoutMouseLeave);
4393                                  }
4394                              }
4395                          });
4396                      }
4397  
4398                      if (t.options.hideVideoControlsOnLoad) {
4399                          t.hideControls(false);
4400                      }
4401  
4402                      if (t.options.enableAutosize) {
4403                          t.media.addEventListener('loadedmetadata', function (e) {
4404                              var target = e !== undefined ? e.detail.target || e.target : t.media;
4405                              if (t.options.videoHeight <= 0 && !t.domNode.getAttribute('height') && !t.domNode.style.height && target !== null && !isNaN(target.videoHeight)) {
4406                                  t.setPlayerSize(target.videoWidth, target.videoHeight);
4407                                  t.setControlsSize();
4408                                  t.media.setSize(target.videoWidth, target.videoHeight);
4409                              }
4410                          });
4411                      }
4412                  }
4413  
4414                  t.media.addEventListener('play', function () {
4415                      t.hasFocus = true;
4416  
4417                      for (var playerIndex in _mejs2.default.players) {
4418                          if (_mejs2.default.players.hasOwnProperty(playerIndex)) {
4419                              var p = _mejs2.default.players[playerIndex];
4420  
4421                              if (p.id !== t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended) {
4422                                  p.pause();
4423                                  p.hasFocus = false;
4424                              }
4425                          }
4426                      }
4427  
4428                      if (!(_constants.IS_ANDROID || _constants.IS_IOS) && !t.options.alwaysShowControls && t.isVideo) {
4429                          t.hideControls();
4430                      }
4431                  });
4432  
4433                  t.media.addEventListener('ended', function () {
4434                      if (t.options.autoRewind) {
4435                          try {
4436                              t.setCurrentTime(0);
4437  
4438                              setTimeout(function () {
4439                                  var loadingElement = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-loading');
4440                                  if (loadingElement && loadingElement.parentNode) {
4441                                      loadingElement.parentNode.style.display = 'none';
4442                                  }
4443                              }, 20);
4444                          } catch (exp) {
4445                              
4446                          }
4447                      }
4448  
4449                      if (typeof t.media.renderer.stop === 'function') {
4450                          t.media.renderer.stop();
4451                      } else {
4452                          t.pause();
4453                      }
4454  
4455                      if (t.setProgressRail) {
4456                          t.setProgressRail();
4457                      }
4458                      if (t.setCurrentRail) {
4459                          t.setCurrentRail();
4460                      }
4461  
4462                      if (t.options.loop) {
4463                          t.play();
4464                      } else if (!t.options.alwaysShowControls && t.controlsEnabled) {
4465                          t.showControls();
4466                      }
4467                  });
4468  
4469                  t.media.addEventListener('loadedmetadata', function () {
4470  
4471                      (0, _time.calculateTimeFormat)(t.getDuration(), t.options, t.options.framesPerSecond || 25);
4472  
4473                      if (t.updateDuration) {
4474                          t.updateDuration();
4475                      }
4476                      if (t.updateCurrent) {
4477                          t.updateCurrent();
4478                      }
4479  
4480                      if (!t.isFullScreen) {
4481                          t.setPlayerSize(t.width, t.height);
4482                          t.setControlsSize();
4483                      }
4484                  });
4485  
4486                  var duration = null;
4487                  t.media.addEventListener('timeupdate', function () {
4488                      if (!isNaN(t.getDuration()) && duration !== t.getDuration()) {
4489                          duration = t.getDuration();
4490                          (0, _time.calculateTimeFormat)(duration, t.options, t.options.framesPerSecond || 25);
4491  
4492                          if (t.updateDuration) {
4493                              t.updateDuration();
4494                          }
4495                          if (t.updateCurrent) {
4496                              t.updateCurrent();
4497                          }
4498  
4499                          t.setControlsSize();
4500                      }
4501                  });
4502  
4503                  t.getElement(t.container).addEventListener('click', function (e) {
4504                      dom.addClass(e.currentTarget, t.options.classPrefix + 'container-keyboard-inactive');
4505                  });
4506  
4507                  t.getElement(t.container).addEventListener('focusin', function (e) {
4508                      dom.removeClass(e.currentTarget, t.options.classPrefix + 'container-keyboard-inactive');
4509                      if (t.isVideo && !_constants.IS_ANDROID && !_constants.IS_IOS && t.controlsEnabled && !t.options.alwaysShowControls) {
4510                          t.killControlsTimer('enter');
4511                          t.showControls();
4512                          t.startControlsTimer(t.options.controlsTimeoutMouseEnter);
4513                      }
4514                  });
4515  
4516                  t.getElement(t.container).addEventListener('focusout', function (e) {
4517                      setTimeout(function () {
4518                          if (e.relatedTarget) {
4519                              if (t.keyboardAction && !e.relatedTarget.closest('.' + t.options.classPrefix + 'container')) {
4520                                  t.keyboardAction = false;
4521                                  if (t.isVideo && !t.options.alwaysShowControls && !t.paused) {
4522                                      t.startControlsTimer(t.options.controlsTimeoutMouseLeave);
4523                                  }
4524                              }
4525                          }
4526                      }, 0);
4527                  });
4528  
4529                  setTimeout(function () {
4530                      t.setPlayerSize(t.width, t.height);
4531                      t.setControlsSize();
4532                  }, 0);
4533  
4534                  t.globalResizeCallback = function () {
4535                      if (!(t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen)) {
4536                          t.setPlayerSize(t.width, t.height);
4537                      }
4538  
4539                      t.setControlsSize();
4540                  };
4541  
4542                  t.globalBind('resize', t.globalResizeCallback);
4543              }
4544  
4545              if (autoplay && isNative) {
4546                  t.play();
4547              }
4548  
4549              if (t.options.success) {
4550                  if (typeof t.options.success === 'string') {
4551                      _window2.default[t.options.success](t.media, t.domNode, t);
4552                  } else {
4553                      t.options.success(t.media, t.domNode, t);
4554                  }
4555              }
4556          }
4557      }, {
4558          key: '_handleError',
4559          value: function _handleError(e, media, node) {
4560              var t = this,
4561                  play = t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-play');
4562  
4563              if (play) {
4564                  play.style.display = 'none';
4565              }
4566  
4567              if (t.options.error) {
4568                  t.options.error(e, media, node);
4569              }
4570  
4571              if (t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'cannotplay')) {
4572                  t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'cannotplay').remove();
4573              }
4574  
4575              var errorContainer = _document2.default.createElement('div');
4576              errorContainer.className = t.options.classPrefix + 'cannotplay';
4577              errorContainer.style.width = '100%';
4578              errorContainer.style.height = '100%';
4579  
4580              var errorContent = typeof t.options.customError === 'function' ? t.options.customError(t.media, t.media.originalNode) : t.options.customError,
4581                  imgError = '';
4582  
4583              if (!errorContent) {
4584                  var poster = t.media.originalNode.getAttribute('poster');
4585                  if (poster) {
4586                      imgError = '<img src="' + poster + '" alt="' + _mejs2.default.i18n.t('mejs.download-file') + '">';
4587                  }
4588  
4589                  if (e.message) {
4590                      errorContent = '<p>' + e.message + '</p>';
4591                  }
4592  
4593                  if (e.urls) {
4594                      for (var i = 0, total = e.urls.length; i < total; i++) {
4595                          var url = e.urls[i];
4596                          errorContent += '<a href="' + url.src + '" data-type="' + url.type + '"><span>' + _mejs2.default.i18n.t('mejs.download-file') + ': ' + url.src + '</span></a>';
4597                      }
4598                  }
4599              }
4600  
4601              if (errorContent && t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error')) {
4602                  errorContainer.innerHTML = errorContent;
4603                  t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error').innerHTML = '' + imgError + errorContainer.outerHTML;
4604                  t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error').parentNode.style.display = 'block';
4605              }
4606  
4607              if (t.controlsEnabled) {
4608                  t.disableControls();
4609              }
4610          }
4611      }, {
4612          key: 'setPlayerSize',
4613          value: function setPlayerSize(width, height) {
4614              var t = this;
4615  
4616              if (!t.options.setDimensions) {
4617                  return false;
4618              }
4619  
4620              if (typeof width !== 'undefined') {
4621                  t.width = width;
4622              }
4623  
4624              if (typeof height !== 'undefined') {
4625                  t.height = height;
4626              }
4627  
4628              switch (t.options.stretching) {
4629                  case 'fill':
4630                      if (t.isVideo) {
4631                          t.setFillMode();
4632                      } else {
4633                          t.setDimensions(t.width, t.height);
4634                      }
4635                      break;
4636                  case 'responsive':
4637                      t.setResponsiveMode();
4638                      break;
4639                  case 'none':
4640                      t.setDimensions(t.width, t.height);
4641                      break;
4642  
4643                  default:
4644                      if (t.hasFluidMode() === true) {
4645                          t.setResponsiveMode();
4646                      } else {
4647                          t.setDimensions(t.width, t.height);
4648                      }
4649                      break;
4650              }
4651          }
4652      }, {
4653          key: 'hasFluidMode',
4654          value: function hasFluidMode() {
4655              var t = this;
4656  
4657              return t.height.toString().indexOf('%') !== -1 || t.node && t.node.style.maxWidth && t.node.style.maxWidth !== 'none' && t.node.style.maxWidth !== t.width || t.node && t.node.currentStyle && t.node.currentStyle.maxWidth === '100%';
4658          }
4659      }, {
4660          key: 'setResponsiveMode',
4661          value: function setResponsiveMode() {
4662              var t = this,
4663                  parent = function () {
4664  
4665                  var parentEl = void 0,
4666                      el = t.getElement(t.container);
4667  
4668                  while (el) {
4669                      try {
4670                          if (_constants.IS_FIREFOX && el.tagName.toLowerCase() === 'html' && _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null) {
4671                              return _window2.default.frameElement;
4672                          } else {
4673                              parentEl = el.parentElement;
4674                          }
4675                      } catch (e) {
4676                          parentEl = el.parentElement;
4677                      }
4678  
4679                      if (parentEl && dom.visible(parentEl)) {
4680                          return parentEl;
4681                      }
4682                      el = parentEl;
4683                  }
4684  
4685                  return null;
4686              }(),
4687                  parentStyles = parent ? getComputedStyle(parent, null) : getComputedStyle(_document2.default.body, null),
4688                  nativeWidth = function () {
4689                  if (t.isVideo) {
4690                      if (t.node.videoWidth && t.node.videoWidth > 0) {
4691                          return t.node.videoWidth;
4692                      } else if (t.node.getAttribute('width')) {
4693                          return t.node.getAttribute('width');
4694                      } else {
4695                          return t.options.defaultVideoWidth;
4696                      }
4697                  } else {
4698                      return t.options.defaultAudioWidth;
4699                  }
4700              }(),
4701                  nativeHeight = function () {
4702                  if (t.isVideo) {
4703                      if (t.node.videoHeight && t.node.videoHeight > 0) {
4704                          return t.node.videoHeight;
4705                      } else if (t.node.getAttribute('height')) {
4706                          return t.node.getAttribute('height');
4707                      } else {
4708                          return t.options.defaultVideoHeight;
4709                      }
4710                  } else {
4711                      return t.options.defaultAudioHeight;
4712                  }
4713              }(),
4714                  aspectRatio = function () {
4715                  var ratio = 1;
4716                  if (!t.isVideo) {
4717                      return ratio;
4718                  }
4719  
4720                  if (t.node.videoWidth && t.node.videoWidth > 0 && t.node.videoHeight && t.node.videoHeight > 0) {
4721                      ratio = t.height >= t.width ? t.node.videoWidth / t.node.videoHeight : t.node.videoHeight / t.node.videoWidth;
4722                  } else {
4723                      ratio = t.initialAspectRatio;
4724                  }
4725  
4726                  if (isNaN(ratio) || ratio < 0.01 || ratio > 100) {
4727                      ratio = 1;
4728                  }
4729  
4730                  return ratio;
4731              }(),
4732                  parentHeight = parseFloat(parentStyles.height);
4733  
4734              var newHeight = void 0,
4735                  parentWidth = parseFloat(parentStyles.width);
4736  
4737              if (t.isVideo) {
4738                  if (t.height === '100%') {
4739                      newHeight = parseFloat(parentWidth * nativeHeight / nativeWidth, 10);
4740                  } else {
4741                      newHeight = t.height >= t.width ? parseFloat(parentWidth / aspectRatio, 10) : parseFloat(parentWidth * aspectRatio, 10);
4742                  }
4743              } else {
4744                  newHeight = nativeHeight;
4745              }
4746  
4747              if (isNaN(newHeight)) {
4748                  newHeight = parentHeight;
4749              }
4750  
4751              if (t.getElement(t.container).parentNode.length > 0 && t.getElement(t.container).parentNode.tagName.toLowerCase() === 'body') {
4752                  parentWidth = _window2.default.innerWidth || _document2.default.documentElement.clientWidth || _document2.default.body.clientWidth;
4753                  newHeight = _window2.default.innerHeight || _document2.default.documentElement.clientHeight || _document2.default.body.clientHeight;
4754              }
4755  
4756              if (newHeight && parentWidth) {
4757                  t.getElement(t.container).style.width = parentWidth + 'px';
4758                  t.getElement(t.container).style.height = newHeight + 'px';
4759  
4760                  t.node.style.width = '100%';
4761                  t.node.style.height = '100%';
4762  
4763                  if (t.isVideo && t.media.setSize) {
4764                      t.media.setSize(parentWidth, newHeight);
4765                  }
4766  
4767                  var layerChildren = t.getElement(t.layers).children;
4768                  for (var i = 0, total = layerChildren.length; i < total; i++) {
4769                      layerChildren[i].style.width = '100%';
4770                      layerChildren[i].style.height = '100%';
4771                  }
4772              }
4773          }
4774      }, {
4775          key: 'setFillMode',
4776          value: function setFillMode() {
4777              var t = this;
4778              var isIframe = _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null;
4779              var parent = function () {
4780                  var parentEl = void 0,
4781                      el = t.getElement(t.container);
4782  
4783                  while (el) {
4784                      try {
4785                          if (_constants.IS_FIREFOX && el.tagName.toLowerCase() === 'html' && _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null) {
4786                              return _window2.default.frameElement;
4787                          } else {
4788                              parentEl = el.parentElement;
4789                          }
4790                      } catch (e) {
4791                          parentEl = el.parentElement;
4792                      }
4793  
4794                      if (parentEl && dom.visible(parentEl)) {
4795                          return parentEl;
4796                      }
4797                      el = parentEl;
4798                  }
4799  
4800                  return null;
4801              }();
4802              var parentStyles = parent ? getComputedStyle(parent, null) : getComputedStyle(_document2.default.body, null);
4803  
4804              if (t.node.style.height !== 'none' && t.node.style.height !== t.height) {
4805                  t.node.style.height = 'auto';
4806              }
4807              if (t.node.style.maxWidth !== 'none' && t.node.style.maxWidth !== t.width) {
4808                  t.node.style.maxWidth = 'none';
4809              }
4810  
4811              if (t.node.style.maxHeight !== 'none' && t.node.style.maxHeight !== t.height) {
4812                  t.node.style.maxHeight = 'none';
4813              }
4814  
4815              if (t.node.currentStyle) {
4816                  if (t.node.currentStyle.height === '100%') {
4817                      t.node.currentStyle.height = 'auto';
4818                  }
4819                  if (t.node.currentStyle.maxWidth === '100%') {
4820                      t.node.currentStyle.maxWidth = 'none';
4821                  }
4822                  if (t.node.currentStyle.maxHeight === '100%') {
4823                      t.node.currentStyle.maxHeight = 'none';
4824                  }
4825              }
4826  
4827              if (!isIframe && !parseFloat(parentStyles.width)) {
4828                  parent.style.width = t.media.offsetWidth + 'px';
4829              }
4830  
4831              if (!isIframe && !parseFloat(parentStyles.height)) {
4832                  parent.style.height = t.media.offsetHeight + 'px';
4833              }
4834  
4835              parentStyles = getComputedStyle(parent);
4836  
4837              var parentWidth = parseFloat(parentStyles.width),
4838                  parentHeight = parseFloat(parentStyles.height);
4839  
4840              t.setDimensions('100%', '100%');
4841  
4842              var poster = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster>img');
4843              if (poster) {
4844                  poster.style.display = '';
4845              }
4846  
4847              var targetElement = t.getElement(t.container).querySelectorAll('object, embed, iframe, video'),
4848                  initHeight = t.height,
4849                  initWidth = t.width,
4850                  scaleX1 = parentWidth,
4851                  scaleY1 = initHeight * parentWidth / initWidth,
4852                  scaleX2 = initWidth * parentHeight / initHeight,
4853                  scaleY2 = parentHeight,
4854                  bScaleOnWidth = scaleX2 > parentWidth === false,
4855                  finalWidth = bScaleOnWidth ? Math.floor(scaleX1) : Math.floor(scaleX2),
4856                  finalHeight = bScaleOnWidth ? Math.floor(scaleY1) : Math.floor(scaleY2),
4857                  width = bScaleOnWidth ? parentWidth + 'px' : finalWidth + 'px',
4858                  height = bScaleOnWidth ? finalHeight + 'px' : parentHeight + 'px';
4859  
4860              for (var i = 0, total = targetElement.length; i < total; i++) {
4861                  targetElement[i].style.height = height;
4862                  targetElement[i].style.width = width;
4863                  if (t.media.setSize) {
4864                      t.media.setSize(width, height);
4865                  }
4866  
4867                  targetElement[i].style.marginLeft = Math.floor((parentWidth - finalWidth) / 2) + 'px';
4868                  targetElement[i].style.marginTop = 0;
4869              }
4870          }
4871      }, {
4872          key: 'setDimensions',
4873          value: function setDimensions(width, height) {
4874              var t = this;
4875  
4876              width = (0, _general.isString)(width) && width.indexOf('%') > -1 ? width : parseFloat(width) + 'px';
4877              height = (0, _general.isString)(height) && height.indexOf('%') > -1 ? height : parseFloat(height) + 'px';
4878  
4879              t.getElement(t.container).style.width = width;
4880              t.getElement(t.container).style.height = height;
4881  
4882              var layers = t.getElement(t.layers).children;
4883              for (var i = 0, total = layers.length; i < total; i++) {
4884                  layers[i].style.width = width;
4885                  layers[i].style.height = height;
4886              }
4887          }
4888      }, {
4889          key: 'setControlsSize',
4890          value: function setControlsSize() {
4891              var t = this;
4892  
4893              if (!dom.visible(t.getElement(t.container))) {
4894                  return;
4895              }
4896  
4897              if (t.rail && dom.visible(t.rail)) {
4898                  var totalStyles = t.total ? getComputedStyle(t.total, null) : null,
4899                      totalMargin = totalStyles ? parseFloat(totalStyles.marginLeft) + parseFloat(totalStyles.marginRight) : 0,
4900                      railStyles = getComputedStyle(t.rail),
4901                      railMargin = parseFloat(railStyles.marginLeft) + parseFloat(railStyles.marginRight);
4902  
4903                  var siblingsWidth = 0;
4904  
4905                  var siblings = dom.siblings(t.rail, function (el) {
4906                      return el !== t.rail;
4907                  }),
4908                      total = siblings.length;
4909                  for (var i = 0; i < total; i++) {
4910                      siblingsWidth += siblings[i].offsetWidth;
4911                  }
4912  
4913                  siblingsWidth += totalMargin + (totalMargin === 0 ? railMargin * 2 : railMargin) + 1;
4914  
4915                  t.getElement(t.container).style.minWidth = siblingsWidth + 'px';
4916  
4917                  var event = (0, _general.createEvent)('controlsresize', t.getElement(t.container));
4918                  t.getElement(t.container).dispatchEvent(event);
4919              } else {
4920                  var children = t.getElement(t.controls).children;
4921                  var minWidth = 0;
4922  
4923                  for (var _i = 0, _total = children.length; _i < _total; _i++) {
4924                      minWidth += children[_i].offsetWidth;
4925                  }
4926  
4927                  t.getElement(t.container).style.minWidth = minWidth + 'px';
4928              }
4929          }
4930      }, {
4931          key: 'addControlElement',
4932          value: function addControlElement(element, key) {
4933  
4934              var t = this;
4935  
4936              if (t.featurePosition[key] !== undefined) {
4937                  var child = t.getElement(t.controls).children[t.featurePosition[key] - 1];
4938                  child.parentNode.insertBefore(element, child.nextSibling);
4939              } else {
4940                  t.getElement(t.controls).appendChild(element);
4941                  var children = t.getElement(t.controls).children;
4942                  for (var i = 0, total = children.length; i < total; i++) {
4943                      if (element === children[i]) {
4944                          t.featurePosition[key] = i;
4945                          break;
4946                      }
4947                  }
4948              }
4949          }
4950      }, {
4951          key: 'createIframeLayer',
4952          value: function createIframeLayer() {
4953              var t = this;
4954  
4955              if (t.isVideo && t.media.rendererName !== null && t.media.rendererName.indexOf('iframe') > -1 && !_document2.default.getElementById(t.media.id + '-iframe-overlay')) {
4956  
4957                  var layer = _document2.default.createElement('div'),
4958                      target = _document2.default.getElementById(t.media.id + '_' + t.media.rendererName);
4959  
4960                  layer.id = t.media.id + '-iframe-overlay';
4961                  layer.className = t.options.classPrefix + 'iframe-overlay';
4962                  layer.addEventListener('click', function (e) {
4963                      if (t.options.clickToPlayPause) {
4964                          if (t.paused) {
4965                              t.play();
4966                          } else {
4967                              t.pause();
4968                          }
4969  
4970                          e.preventDefault();
4971                          e.stopPropagation();
4972                      }
4973                  });
4974  
4975                  target.parentNode.insertBefore(layer, target);
4976              }
4977          }
4978      }, {
4979          key: 'resetSize',
4980          value: function resetSize() {
4981              var t = this;
4982  
4983              setTimeout(function () {
4984                  t.setPlayerSize(t.width, t.height);
4985                  t.setControlsSize();
4986              }, 50);
4987          }
4988      }, {
4989          key: 'setPoster',
4990          value: function setPoster(url) {
4991              var t = this;
4992  
4993              if (t.getElement(t.container)) {
4994                  var posterDiv = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster');
4995  
4996                  if (!posterDiv) {
4997                      posterDiv = _document2.default.createElement('div');
4998                      posterDiv.className = t.options.classPrefix + 'poster ' + t.options.classPrefix + 'layer';
4999                      t.getElement(t.layers).appendChild(posterDiv);
5000                  }
5001  
5002                  var posterImg = posterDiv.querySelector('img');
5003  
5004                  if (!posterImg && url) {
5005                      posterImg = _document2.default.createElement('img');
5006                      posterImg.className = t.options.classPrefix + 'poster-img';
5007                      posterImg.width = '100%';
5008                      posterImg.height = '100%';
5009                      posterDiv.style.display = '';
5010                      posterDiv.appendChild(posterImg);
5011                  }
5012  
5013                  if (url) {
5014                      posterImg.setAttribute('src', url);
5015                      posterDiv.style.backgroundImage = 'url("' + url + '")';
5016                      posterDiv.style.display = '';
5017                  } else if (posterImg) {
5018                      posterDiv.style.backgroundImage = 'none';
5019                      posterDiv.style.display = 'none';
5020                      posterImg.remove();
5021                  } else {
5022                      posterDiv.style.display = 'none';
5023                  }
5024              } else if (_constants.IS_IPAD && t.options.iPadUseNativeControls || _constants.IS_IPHONE && t.options.iPhoneUseNativeControls || _constants.IS_ANDROID && t.options.AndroidUseNativeControls) {
5025                  t.media.originalNode.poster = url;
5026              }
5027          }
5028      }, {
5029          key: 'changeSkin',
5030          value: function changeSkin(className) {
5031              var t = this;
5032  
5033              t.getElement(t.container).className = t.options.classPrefix + 'container ' + className;
5034              t.setPlayerSize(t.width, t.height);
5035              t.setControlsSize();
5036          }
5037      }, {
5038          key: 'globalBind',
5039          value: function globalBind(events, callback) {
5040              var t = this,
5041                  doc = t.node ? t.node.ownerDocument : _document2.default;
5042  
5043              events = (0, _general.splitEvents)(events, t.id);
5044              if (events.d) {
5045                  var eventList = events.d.split(' ');
5046                  for (var i = 0, total = eventList.length; i < total; i++) {
5047                      eventList[i].split('.').reduce(function (part, e) {
5048                          doc.addEventListener(e, callback, false);
5049                          return e;
5050                      }, '');
5051                  }
5052              }
5053              if (events.w) {
5054                  var _eventList = events.w.split(' ');
5055                  for (var _i2 = 0, _total2 = _eventList.length; _i2 < _total2; _i2++) {
5056                      _eventList[_i2].split('.').reduce(function (part, e) {
5057                          _window2.default.addEventListener(e, callback, false);
5058                          return e;
5059                      }, '');
5060                  }
5061              }
5062          }
5063      }, {
5064          key: 'globalUnbind',
5065          value: function globalUnbind(events, callback) {
5066              var t = this,
5067                  doc = t.node ? t.node.ownerDocument : _document2.default;
5068  
5069              events = (0, _general.splitEvents)(events, t.id);
5070              if (events.d) {
5071                  var eventList = events.d.split(' ');
5072                  for (var i = 0, total = eventList.length; i < total; i++) {
5073                      eventList[i].split('.').reduce(function (part, e) {
5074                          doc.removeEventListener(e, callback, false);
5075                          return e;
5076                      }, '');
5077                  }
5078              }
5079              if (events.w) {
5080                  var _eventList2 = events.w.split(' ');
5081                  for (var _i3 = 0, _total3 = _eventList2.length; _i3 < _total3; _i3++) {
5082                      _eventList2[_i3].split('.').reduce(function (part, e) {
5083                          _window2.default.removeEventListener(e, callback, false);
5084                          return e;
5085                      }, '');
5086                  }
5087              }
5088          }
5089      }, {
5090          key: 'buildfeatures',
5091          value: function buildfeatures(player, controls, layers, media) {
5092              var t = this;
5093  
5094              for (var i = 0, total = t.options.features.length; i < total; i++) {
5095                  var feature = t.options.features[i];
5096                  if (t['build' + feature]) {
5097                      try {
5098                          t['build' + feature](player, controls, layers, media);
5099                      } catch (e) {
5100                          console.error('error building ' + feature, e);
5101                      }
5102                  }
5103              }
5104          }
5105      }, {
5106          key: 'buildposter',
5107          value: function buildposter(player, controls, layers, media) {
5108              var t = this,
5109                  poster = _document2.default.createElement('div');
5110  
5111              poster.className = t.options.classPrefix + 'poster ' + t.options.classPrefix + 'layer';
5112              layers.appendChild(poster);
5113  
5114              var posterUrl = media.originalNode.getAttribute('poster');
5115  
5116              if (player.options.poster !== '') {
5117                  if (posterUrl && _constants.IS_IOS) {
5118                      media.originalNode.removeAttribute('poster');
5119                  }
5120                  posterUrl = player.options.poster;
5121              }
5122  
5123              if (posterUrl) {
5124                  t.setPoster(posterUrl);
5125              } else if (t.media.renderer !== null && typeof t.media.renderer.getPosterUrl === 'function') {
5126                  t.setPoster(t.media.renderer.getPosterUrl());
5127              } else {
5128                  poster.style.display = 'none';
5129              }
5130  
5131              media.addEventListener('play', function () {
5132                  poster.style.display = 'none';
5133              });
5134  
5135              media.addEventListener('playing', function () {
5136                  poster.style.display = 'none';
5137              });
5138  
5139              if (player.options.showPosterWhenEnded && player.options.autoRewind) {
5140                  media.addEventListener('ended', function () {
5141                      poster.style.display = '';
5142                  });
5143              }
5144  
5145              media.addEventListener('error', function () {
5146                  poster.style.display = 'none';
5147              });
5148  
5149              if (player.options.showPosterWhenPaused) {
5150                  media.addEventListener('pause', function () {
5151                      if (!player.ended) {
5152                          poster.style.display = '';
5153                      }
5154                  });
5155              }
5156          }
5157      }, {
5158          key: 'buildoverlays',
5159          value: function buildoverlays(player, controls, layers, media) {
5160  
5161              if (!player.isVideo) {
5162                  return;
5163              }
5164  
5165              var t = this,
5166                  loading = _document2.default.createElement('div'),
5167                  error = _document2.default.createElement('div'),
5168                  bigPlay = _document2.default.createElement('div');
5169  
5170              loading.style.display = 'none';
5171              loading.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer';
5172              loading.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-loading">' + ('<span class="' + t.options.classPrefix + 'overlay-loading-bg-img"></span>') + '</div>';
5173              layers.appendChild(loading);
5174  
5175              error.style.display = 'none';
5176              error.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer';
5177              error.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-error"></div>';
5178              layers.appendChild(error);
5179  
5180              bigPlay.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer ' + t.options.classPrefix + 'overlay-play';
5181              bigPlay.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-button" role="button" tabindex="0" ' + ('aria-label="' + _i18n2.default.t('mejs.play') + '" aria-pressed="false"></div>');
5182              bigPlay.addEventListener('click', function () {
5183                  if (t.options.clickToPlayPause) {
5184  
5185                      var button = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-button'),
5186                          pressed = button.getAttribute('aria-pressed');
5187  
5188                      if (t.paused) {
5189                          t.play();
5190                      } else {
5191                          t.pause();
5192                      }
5193  
5194                      button.setAttribute('aria-pressed', !!pressed);
5195                      t.getElement(t.container).focus();
5196                  }
5197              });
5198  
5199              bigPlay.addEventListener('keydown', function (e) {
5200                  var keyPressed = e.keyCode || e.which || 0;
5201  
5202                  if (keyPressed === 13 || _constants.IS_FIREFOX && keyPressed === 32) {
5203                      var event = (0, _general.createEvent)('click', bigPlay);
5204                      bigPlay.dispatchEvent(event);
5205                      return false;
5206                  }
5207              });
5208  
5209              layers.appendChild(bigPlay);
5210  
5211              if (t.media.rendererName !== null && (/(youtube|facebook)/i.test(t.media.rendererName) && !(t.media.originalNode.getAttribute('poster') || player.options.poster || typeof t.media.renderer.getPosterUrl === 'function' && t.media.renderer.getPosterUrl()) || _constants.IS_STOCK_ANDROID || t.media.originalNode.getAttribute('autoplay'))) {
5212                  bigPlay.style.display = 'none';
5213              }
5214  
5215              var hasError = false;
5216  
5217              media.addEventListener('play', function () {
5218                  bigPlay.style.display = 'none';
5219                  loading.style.display = 'none';
5220                  error.style.display = 'none';
5221                  hasError = false;
5222              });
5223              media.addEventListener('playing', function () {
5224                  bigPlay.style.display = 'none';
5225                  loading.style.display = 'none';
5226                  error.style.display = 'none';
5227                  hasError = false;
5228              });
5229              media.addEventListener('seeking', function () {
5230                  bigPlay.style.display = 'none';
5231                  loading.style.display = '';
5232                  hasError = false;
5233              });
5234              media.addEventListener('seeked', function () {
5235                  bigPlay.style.display = t.paused && !_constants.IS_STOCK_ANDROID ? '' : 'none';
5236                  loading.style.display = 'none';
5237                  hasError = false;
5238              });
5239              media.addEventListener('pause', function () {
5240                  loading.style.display = 'none';
5241                  if (!_constants.IS_STOCK_ANDROID && !hasError) {
5242                      bigPlay.style.display = '';
5243                  }
5244                  hasError = false;
5245              });
5246              media.addEventListener('waiting', function () {
5247                  loading.style.display = '';
5248                  hasError = false;
5249              });
5250  
5251              media.addEventListener('loadeddata', function () {
5252                  loading.style.display = '';
5253  
5254                  if (_constants.IS_ANDROID) {
5255                      media.canplayTimeout = setTimeout(function () {
5256                          if (_document2.default.createEvent) {
5257                              var evt = _document2.default.createEvent('HTMLEvents');
5258                              evt.initEvent('canplay', true, true);
5259                              return media.dispatchEvent(evt);
5260                          }
5261                      }, 300);
5262                  }
5263                  hasError = false;
5264              });
5265              media.addEventListener('canplay', function () {
5266                  loading.style.display = 'none';
5267  
5268                  clearTimeout(media.canplayTimeout);
5269                  hasError = false;
5270              });
5271  
5272              media.addEventListener('error', function (e) {
5273                  t._handleError(e, t.media, t.node);
5274                  loading.style.display = 'none';
5275                  bigPlay.style.display = 'none';
5276                  hasError = true;
5277              });
5278  
5279              media.addEventListener('loadedmetadata', function () {
5280                  if (!t.controlsEnabled) {
5281                      t.enableControls();
5282                  }
5283              });
5284  
5285              media.addEventListener('keydown', function (e) {
5286                  t.onkeydown(player, media, e);
5287                  hasError = false;
5288              });
5289          }
5290      }, {
5291          key: 'buildkeyboard',
5292          value: function buildkeyboard(player, controls, layers, media) {
5293  
5294              var t = this;
5295  
5296              t.getElement(t.container).addEventListener('keydown', function () {
5297                  t.keyboardAction = true;
5298              });
5299  
5300              t.globalKeydownCallback = function (event) {
5301                  var container = _document2.default.activeElement.closest('.' + t.options.classPrefix + 'container'),
5302                      target = t.media.closest('.' + t.options.classPrefix + 'container');
5303                  t.hasFocus = !!(container && target && container.id === target.id);
5304                  return t.onkeydown(player, media, event);
5305              };
5306  
5307              t.globalClickCallback = function (event) {
5308                  t.hasFocus = !!event.target.closest('.' + t.options.classPrefix + 'container');
5309              };
5310  
5311              t.globalBind('keydown', t.globalKeydownCallback);
5312  
5313              t.globalBind('click', t.globalClickCallback);
5314          }
5315      }, {
5316          key: 'onkeydown',
5317          value: function onkeydown(player, media, e) {
5318  
5319              if (player.hasFocus && player.options.enableKeyboard) {
5320                  for (var i = 0, total = player.options.keyActions.length; i < total; i++) {
5321                      var keyAction = player.options.keyActions[i];
5322  
5323                      for (var j = 0, jl = keyAction.keys.length; j < jl; j++) {
5324                          if (e.keyCode === keyAction.keys[j]) {
5325                              keyAction.action(player, media, e.keyCode, e);
5326                              e.preventDefault();
5327                              e.stopPropagation();
5328                              return;
5329                          }
5330                      }
5331                  }
5332              }
5333  
5334              return true;
5335          }
5336      }, {
5337          key: 'play',
5338          value: function play() {
5339              this.proxy.play();
5340          }
5341      }, {
5342          key: 'pause',
5343          value: function pause() {
5344              this.proxy.pause();
5345          }
5346      }, {
5347          key: 'load',
5348          value: function load() {
5349              this.proxy.load();
5350          }
5351      }, {
5352          key: 'setCurrentTime',
5353          value: function setCurrentTime(time) {
5354              this.proxy.setCurrentTime(time);
5355          }
5356      }, {
5357          key: 'getCurrentTime',
5358          value: function getCurrentTime() {
5359              return this.proxy.currentTime;
5360          }
5361      }, {
5362          key: 'getDuration',
5363          value: function getDuration() {
5364              return this.proxy.duration;
5365          }
5366      }, {
5367          key: 'setVolume',
5368          value: function setVolume(volume) {
5369              this.proxy.volume = volume;
5370          }
5371      }, {
5372          key: 'getVolume',
5373          value: function getVolume() {
5374              return this.proxy.getVolume();
5375          }
5376      }, {
5377          key: 'setMuted',
5378          value: function setMuted(value) {
5379              this.proxy.setMuted(value);
5380          }
5381      }, {
5382          key: 'setSrc',
5383          value: function setSrc(src) {
5384              if (!this.controlsEnabled) {
5385                  this.enableControls();
5386              }
5387              this.proxy.setSrc(src);
5388          }
5389      }, {
5390          key: 'getSrc',
5391          value: function getSrc() {
5392              return this.proxy.getSrc();
5393          }
5394      }, {
5395          key: 'canPlayType',
5396          value: function canPlayType(type) {
5397              return this.proxy.canPlayType(type);
5398          }
5399      }, {
5400          key: 'remove',
5401          value: function remove() {
5402              var t = this,
5403                  rendererName = t.media.rendererName,
5404                  src = t.media.originalNode.src;
5405  
5406              for (var featureIndex in t.options.features) {
5407                  var feature = t.options.features[featureIndex];
5408                  if (t['clean' + feature]) {
5409                      try {
5410                          t['clean' + feature](t, t.getElement(t.layers), t.getElement(t.controls), t.media);
5411                      } catch (e) {
5412                          console.error('error cleaning ' + feature, e);
5413                      }
5414                  }
5415              }
5416  
5417              var nativeWidth = t.node.getAttribute('width'),
5418                  nativeHeight = t.node.getAttribute('height');
5419  
5420              if (nativeWidth) {
5421                  if (nativeWidth.indexOf('%') === -1) {
5422                      nativeWidth = nativeWidth + 'px';
5423                  }
5424              } else {
5425                  nativeWidth = 'auto';
5426              }
5427  
5428              if (nativeHeight) {
5429                  if (nativeHeight.indexOf('%') === -1) {
5430                      nativeHeight = nativeHeight + 'px';
5431                  }
5432              } else {
5433                  nativeHeight = 'auto';
5434              }
5435  
5436              t.node.style.width = nativeWidth;
5437              t.node.style.height = nativeHeight;
5438  
5439              t.setPlayerSize(0, 0);
5440  
5441              if (!t.isDynamic) {
5442                  (function () {
5443                      t.node.setAttribute('controls', true);
5444                      t.node.setAttribute('id', t.node.getAttribute('id').replace('_' + rendererName, '').replace('_from_mejs', ''));
5445                      var poster = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster>img');
5446                      if (poster) {
5447                          t.node.setAttribute('poster', poster.src);
5448                      }
5449  
5450                      delete t.node.autoplay;
5451  
5452                      t.node.setAttribute('src', '');
5453                      if (t.media.canPlayType((0, _media.getTypeFromFile)(src)) !== '') {
5454                          t.node.setAttribute('src', src);
5455                      }
5456  
5457                      if (rendererName && rendererName.indexOf('iframe') > -1) {
5458                          var layer = _document2.default.getElementById(t.media.id + '-iframe-overlay');
5459                          layer.remove();
5460                      }
5461  
5462                      var node = t.node.cloneNode();
5463                      node.style.display = '';
5464                      t.getElement(t.container).parentNode.insertBefore(node, t.getElement(t.container));
5465                      t.node.remove();
5466  
5467                      if (t.mediaFiles) {
5468                          for (var i = 0, total = t.mediaFiles.length; i < total; i++) {
5469                              var source = _document2.default.createElement('source');
5470                              source.setAttribute('src', t.mediaFiles[i].src);
5471                              source.setAttribute('type', t.mediaFiles[i].type);
5472                              node.appendChild(source);
5473                          }
5474                      }
5475                      if (t.trackFiles) {
5476                          var _loop3 = function _loop3(_i4, _total4) {
5477                              var track = t.trackFiles[_i4];
5478                              var newTrack = _document2.default.createElement('track');
5479                              newTrack.kind = track.kind;
5480                              newTrack.label = track.label;
5481                              newTrack.srclang = track.srclang;
5482                              newTrack.src = track.src;
5483  
5484                              node.appendChild(newTrack);
5485                              newTrack.addEventListener('load', function () {
5486                                  this.mode = 'showing';
5487                                  node.textTracks[_i4].mode = 'showing';
5488                              });
5489                          };
5490  
5491                          for (var _i4 = 0, _total4 = t.trackFiles.length; _i4 < _total4; _i4++) {
5492                              _loop3(_i4, _total4);
5493                          }
5494                      }
5495  
5496                      delete t.node;
5497                      delete t.mediaFiles;
5498                      delete t.trackFiles;
5499                  })();
5500              } else {
5501                  t.getElement(t.container).parentNode.insertBefore(t.node, t.getElement(t.container));
5502              }
5503  
5504              if (t.media.renderer && typeof t.media.renderer.destroy === 'function') {
5505                  t.media.renderer.destroy();
5506              }
5507  
5508              delete _mejs2.default.players[t.id];
5509  
5510              if (_typeof(t.getElement(t.container)) === 'object') {
5511                  var offscreen = t.getElement(t.container).parentNode.querySelector('.' + t.options.classPrefix + 'offscreen');
5512                  offscreen.remove();
5513                  t.getElement(t.container).remove();
5514              }
5515              t.globalUnbind('resize', t.globalResizeCallback);
5516              t.globalUnbind('keydown', t.globalKeydownCallback);
5517              t.globalUnbind('click', t.globalClickCallback);
5518  
5519              delete t.media.player;
5520          }
5521      }, {
5522          key: 'paused',
5523          get: function get() {
5524              return this.proxy.paused;
5525          }
5526      }, {
5527          key: 'muted',
5528          get: function get() {
5529              return this.proxy.muted;
5530          },
5531          set: function set(muted) {
5532              this.setMuted(muted);
5533          }
5534      }, {
5535          key: 'ended',
5536          get: function get() {
5537              return this.proxy.ended;
5538          }
5539      }, {
5540          key: 'readyState',
5541          get: function get() {
5542              return this.proxy.readyState;
5543          }
5544      }, {
5545          key: 'currentTime',
5546          set: function set(time) {
5547              this.setCurrentTime(time);
5548          },
5549          get: function get() {
5550              return this.getCurrentTime();
5551          }
5552      }, {
5553          key: 'duration',
5554          get: function get() {
5555              return this.getDuration();
5556          }
5557      }, {
5558          key: 'volume',
5559          set: function set(volume) {
5560              this.setVolume(volume);
5561          },
5562          get: function get() {
5563              return this.getVolume();
5564          }
5565      }, {
5566          key: 'src',
5567          set: function set(src) {
5568              this.setSrc(src);
5569          },
5570          get: function get() {
5571              return this.getSrc();
5572          }
5573      }]);
5574  
5575      return MediaElementPlayer;
5576  }();
5577  
5578  _window2.default.MediaElementPlayer = MediaElementPlayer;
5579  _mejs2.default.MediaElementPlayer = MediaElementPlayer;
5580  
5581  exports.default = MediaElementPlayer;
5582  
5583  },{"19":19,"2":2,"27":27,"28":28,"29":29,"3":3,"30":30,"32":32,"7":7,"8":8,"9":9}],19:[function(_dereq_,module,exports){
5584  'use strict';
5585  
5586  Object.defineProperty(exports, "__esModule", {
5587      value: true
5588  });
5589  
5590  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; }; }();
5591  
5592  var _window = _dereq_(3);
5593  
5594  var _window2 = _interopRequireDefault(_window);
5595  
5596  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5597  
5598  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5599  
5600  var DefaultPlayer = function () {
5601  	function DefaultPlayer(player) {
5602          _classCallCheck(this, DefaultPlayer);
5603  
5604          this.media = player.media;
5605          this.isVideo = player.isVideo;
5606          this.classPrefix = player.options.classPrefix;
5607          this.createIframeLayer = function () {
5608              return player.createIframeLayer();
5609          };
5610          this.setPoster = function (url) {
5611              return player.setPoster(url);
5612          };
5613          return this;
5614      }
5615  
5616      _createClass(DefaultPlayer, [{
5617          key: 'play',
5618          value: function play() {
5619              this.media.play();
5620          }
5621      }, {
5622          key: 'pause',
5623          value: function pause() {
5624              this.media.pause();
5625          }
5626      }, {
5627          key: 'load',
5628          value: function load() {
5629              var t = this;
5630  
5631              if (!t.isLoaded) {
5632                  t.media.load();
5633              }
5634  
5635              t.isLoaded = true;
5636          }
5637      }, {
5638          key: 'setCurrentTime',
5639          value: function setCurrentTime(time) {
5640              this.media.setCurrentTime(time);
5641          }
5642      }, {
5643          key: 'getCurrentTime',
5644          value: function getCurrentTime() {
5645              return this.media.currentTime;
5646          }
5647      }, {
5648          key: 'getDuration',
5649          value: function getDuration() {
5650              return this.media.getDuration();
5651          }
5652      }, {
5653          key: 'setVolume',
5654          value: function setVolume(volume) {
5655              this.media.setVolume(volume);
5656          }
5657      }, {
5658          key: 'getVolume',
5659          value: function getVolume() {
5660              return this.media.getVolume();
5661          }
5662      }, {
5663          key: 'setMuted',
5664          value: function setMuted(value) {
5665              this.media.setMuted(value);
5666          }
5667      }, {
5668          key: 'setSrc',
5669          value: function setSrc(src) {
5670              var t = this,
5671                  layer = document.getElementById(t.media.id + '-iframe-overlay');
5672  
5673              if (layer) {
5674                  layer.remove();
5675              }
5676  
5677              t.media.setSrc(src);
5678              t.createIframeLayer();
5679              if (t.media.renderer !== null && typeof t.media.renderer.getPosterUrl === 'function') {
5680                  t.setPoster(t.media.renderer.getPosterUrl());
5681              }
5682          }
5683      }, {
5684          key: 'getSrc',
5685          value: function getSrc() {
5686              return this.media.getSrc();
5687          }
5688      }, {
5689          key: 'canPlayType',
5690          value: function canPlayType(type) {
5691              return this.media.canPlayType(type);
5692          }
5693      }, {
5694          key: 'paused',
5695          get: function get() {
5696              return this.media.paused;
5697          }
5698      }, {
5699          key: 'muted',
5700          set: function set(muted) {
5701              this.setMuted(muted);
5702          },
5703          get: function get() {
5704              return this.media.muted;
5705          }
5706      }, {
5707          key: 'ended',
5708          get: function get() {
5709              return this.media.ended;
5710          }
5711      }, {
5712          key: 'readyState',
5713          get: function get() {
5714              return this.media.readyState;
5715          }
5716      }, {
5717          key: 'currentTime',
5718          set: function set(time) {
5719              this.setCurrentTime(time);
5720          },
5721          get: function get() {
5722              return this.getCurrentTime();
5723          }
5724      }, {
5725          key: 'duration',
5726          get: function get() {
5727              return this.getDuration();
5728          }
5729      }, {
5730          key: 'remainingTime',
5731          get: function get() {
5732              return this.getDuration() - this.currentTime();
5733          }
5734      }, {
5735          key: 'volume',
5736          set: function set(volume) {
5737              this.setVolume(volume);
5738          },
5739          get: function get() {
5740              return this.getVolume();
5741          }
5742      }, {
5743          key: 'src',
5744          set: function set(src) {
5745              this.setSrc(src);
5746          },
5747          get: function get() {
5748              return this.getSrc();
5749          }
5750      }]);
5751  
5752      return DefaultPlayer;
5753  }();
5754  
5755  exports.default = DefaultPlayer;
5756  
5757  
5758  _window2.default.DefaultPlayer = DefaultPlayer;
5759  
5760  },{"3":3}],20:[function(_dereq_,module,exports){
5761  'use strict';
5762  
5763  var _window = _dereq_(3);
5764  
5765  var _window2 = _interopRequireDefault(_window);
5766  
5767  var _mejs = _dereq_(9);
5768  
5769  var _mejs2 = _interopRequireDefault(_mejs);
5770  
5771  var _player = _dereq_(18);
5772  
5773  var _player2 = _interopRequireDefault(_player);
5774  
5775  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5776  
5777  if (typeof jQuery !== 'undefined') {
5778      _mejs2.default.$ = jQuery;
5779  } else if (typeof Zepto !== 'undefined') {
5780      _mejs2.default.$ = Zepto;
5781  } else if (typeof ender !== 'undefined') {
5782      _mejs2.default.$ = ender;
5783  }
5784  
5785  (function ($) {
5786      if (typeof $ !== 'undefined') {
5787          $.fn.mediaelementplayer = function (options) {
5788              if (options === false) {
5789                  this.each(function () {
5790                      var player = $(this).data('mediaelementplayer');
5791                      if (player) {
5792                          player.remove();
5793                      }
5794                      $(this).removeData('mediaelementplayer');
5795                  });
5796              } else {
5797                  this.each(function () {
5798                      $(this).data('mediaelementplayer', new _player2.default(this, options));
5799                  });
5800              }
5801              return this;
5802          };
5803  
5804          $(document).ready(function () {
5805              $('.' + _mejs2.default.MepDefaults.classPrefix + 'player').mediaelementplayer();
5806          });
5807      }
5808  })(_mejs2.default.$);
5809  
5810  },{"18":18,"3":3,"9":9}],21:[function(_dereq_,module,exports){
5811  'use strict';
5812  
5813  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; };
5814  
5815  var _window = _dereq_(3);
5816  
5817  var _window2 = _interopRequireDefault(_window);
5818  
5819  var _mejs = _dereq_(9);
5820  
5821  var _mejs2 = _interopRequireDefault(_mejs);
5822  
5823  var _renderer = _dereq_(10);
5824  
5825  var _general = _dereq_(29);
5826  
5827  var _media = _dereq_(30);
5828  
5829  var _constants = _dereq_(27);
5830  
5831  var _dom = _dereq_(28);
5832  
5833  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5834  
5835  var NativeDash = {
5836  
5837      promise: null,
5838  
5839      load: function load(settings) {
5840          if (typeof dashjs !== 'undefined') {
5841              NativeDash.promise = new Promise(function (resolve) {
5842                  resolve();
5843              }).then(function () {
5844                  NativeDash._createPlayer(settings);
5845              });
5846          } else {
5847              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js';
5848  
5849              NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path);
5850              NativeDash.promise.then(function () {
5851                  NativeDash._createPlayer(settings);
5852              });
5853          }
5854  
5855          return NativeDash.promise;
5856      },
5857  
5858      _createPlayer: function _createPlayer(settings) {
5859          var player = dashjs.MediaPlayer().create();
5860          _window2.default['__ready__' + settings.id](player);
5861          return player;
5862      }
5863  };
5864  
5865  var DashNativeRenderer = {
5866      name: 'native_dash',
5867      options: {
5868          prefix: 'native_dash',
5869          dash: {
5870              path: 'https://cdn.dashjs.org/latest/dash.all.min.js',
5871              debug: false,
5872              drm: {},
5873  
5874              robustnessLevel: ''
5875          }
5876      },
5877  
5878      canPlayType: function canPlayType(type) {
5879          return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1;
5880      },
5881  
5882      create: function create(mediaElement, options, mediaFiles) {
5883  
5884          var originalNode = mediaElement.originalNode,
5885              id = mediaElement.id + '_' + options.prefix,
5886              autoplay = originalNode.autoplay,
5887              children = originalNode.children;
5888  
5889          var node = null,
5890              dashPlayer = null;
5891  
5892          originalNode.removeAttribute('type');
5893          for (var i = 0, total = children.length; i < total; i++) {
5894              children[i].removeAttribute('type');
5895          }
5896  
5897          node = originalNode.cloneNode(true);
5898          options = Object.assign(options, mediaElement.options);
5899  
5900          var props = _mejs2.default.html5media.properties,
5901              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
5902              return e !== 'error';
5903          }),
5904              attachNativeEvents = function attachNativeEvents(e) {
5905              var event = (0, _general.createEvent)(e.type, mediaElement);
5906              mediaElement.dispatchEvent(event);
5907          },
5908              assignGettersSetters = function assignGettersSetters(propName) {
5909              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
5910  
5911              node['get' + capName] = function () {
5912                  return dashPlayer !== null ? node[propName] : null;
5913              };
5914  
5915              node['set' + capName] = function (value) {
5916                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
5917                      if (propName === 'src') {
5918                          var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
5919                          node[propName] = source;
5920                          if (dashPlayer !== null) {
5921                              dashPlayer.reset();
5922                              for (var _i = 0, _total = events.length; _i < _total; _i++) {
5923                                  node.removeEventListener(events[_i], attachNativeEvents);
5924                              }
5925                              dashPlayer = NativeDash._createPlayer({
5926                                  options: options.dash,
5927                                  id: id
5928                              });
5929  
5930                              if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') {
5931                                  dashPlayer.setProtectionData(value.drm);
5932                                  if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
5933                                      dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
5934                                  }
5935                              }
5936                              dashPlayer.attachSource(source);
5937                              if (autoplay) {
5938                                  dashPlayer.play();
5939                              }
5940                          }
5941                      } else {
5942                          node[propName] = value;
5943                      }
5944                  }
5945              };
5946          };
5947  
5948          for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) {
5949              assignGettersSetters(props[_i2]);
5950          }
5951  
5952          _window2.default['__ready__' + id] = function (_dashPlayer) {
5953              mediaElement.dashPlayer = dashPlayer = _dashPlayer;
5954  
5955              var dashEvents = dashjs.MediaPlayer.events,
5956                  assignEvents = function assignEvents(eventName) {
5957                  if (eventName === 'loadedmetadata') {
5958                      dashPlayer.initialize();
5959                      dashPlayer.attachView(node);
5960                      dashPlayer.setAutoPlay(false);
5961  
5962                      if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) {
5963                          dashPlayer.setProtectionData(options.dash.drm);
5964                          if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
5965                              dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
5966                          }
5967                      }
5968                      dashPlayer.attachSource(node.getSrc());
5969                  }
5970  
5971                  node.addEventListener(eventName, attachNativeEvents);
5972              };
5973  
5974              for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
5975                  assignEvents(events[_i3]);
5976              }
5977  
5978              var assignMdashEvents = function assignMdashEvents(e) {
5979                  if (e.type.toLowerCase() === 'error') {
5980                      mediaElement.generateError(e.message, node.src);
5981                      console.error(e);
5982                  } else {
5983                      var _event = (0, _general.createEvent)(e.type, mediaElement);
5984                      _event.data = e;
5985                      mediaElement.dispatchEvent(_event);
5986                  }
5987              };
5988  
5989              for (var eventType in dashEvents) {
5990                  if (dashEvents.hasOwnProperty(eventType)) {
5991                      dashPlayer.on(dashEvents[eventType], function (e) {
5992                          return assignMdashEvents(e);
5993                      });
5994                  }
5995              }
5996          };
5997  
5998          if (mediaFiles && mediaFiles.length > 0) {
5999              for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
6000                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
6001                      node.setAttribute('src', mediaFiles[_i4].src);
6002                      if (typeof mediaFiles[_i4].drm !== 'undefined') {
6003                          options.dash.drm = mediaFiles[_i4].drm;
6004                      }
6005                      break;
6006                  }
6007              }
6008          }
6009  
6010          node.setAttribute('id', id);
6011  
6012          originalNode.parentNode.insertBefore(node, originalNode);
6013          originalNode.autoplay = false;
6014          originalNode.style.display = 'none';
6015  
6016          node.setSize = function (width, height) {
6017              node.style.width = width + 'px';
6018              node.style.height = height + 'px';
6019              return node;
6020          };
6021  
6022          node.hide = function () {
6023              node.pause();
6024              node.style.display = 'none';
6025              return node;
6026          };
6027  
6028          node.show = function () {
6029              node.style.display = '';
6030              return node;
6031          };
6032  
6033          node.destroy = function () {
6034              if (dashPlayer !== null) {
6035                  dashPlayer.reset();
6036              }
6037          };
6038  
6039          var event = (0, _general.createEvent)('rendererready', node);
6040          mediaElement.dispatchEvent(event);
6041  
6042          mediaElement.promises.push(NativeDash.load({
6043              options: options.dash,
6044              id: id
6045          }));
6046  
6047          return node;
6048      }
6049  };
6050  
6051  _media.typeChecks.push(function (url) {
6052      return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null;
6053  });
6054  
6055  _renderer.renderer.add(DashNativeRenderer);
6056  
6057  },{"10":10,"27":27,"28":28,"29":29,"3":3,"30":30,"9":9}],22:[function(_dereq_,module,exports){
6058  'use strict';
6059  
6060  Object.defineProperty(exports, "__esModule", {
6061      value: true
6062  });
6063  exports.PluginDetector = undefined;
6064  
6065  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; };
6066  
6067  var _window = _dereq_(3);
6068  
6069  var _window2 = _interopRequireDefault(_window);
6070  
6071  var _document = _dereq_(2);
6072  
6073  var _document2 = _interopRequireDefault(_document);
6074  
6075  var _mejs = _dereq_(9);
6076  
6077  var _mejs2 = _interopRequireDefault(_mejs);
6078  
6079  var _i18n = _dereq_(7);
6080  
6081  var _i18n2 = _interopRequireDefault(_i18n);
6082  
6083  var _renderer = _dereq_(10);
6084  
6085  var _general = _dereq_(29);
6086  
6087  var _constants = _dereq_(27);
6088  
6089  var _media = _dereq_(30);
6090  
6091  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6092  
6093  var PluginDetector = exports.PluginDetector = {
6094      plugins: [],
6095  
6096      hasPluginVersion: function hasPluginVersion(plugin, v) {
6097          var pv = PluginDetector.plugins[plugin];
6098          v[1] = v[1] || 0;
6099          v[2] = v[2] || 0;
6100          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];
6101      },
6102  
6103      addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) {
6104          PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect);
6105      },
6106  
6107      detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) {
6108  
6109          var version = [0, 0, 0],
6110              description = void 0,
6111              ax = void 0;
6112  
6113          if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') {
6114              description = _constants.NAV.plugins[pluginName].description;
6115              if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) {
6116                  version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.');
6117                  for (var i = 0, total = version.length; i < total; i++) {
6118                      version[i] = parseInt(version[i].match(/\d+/), 10);
6119                  }
6120              }
6121          } else if (_window2.default.ActiveXObject !== undefined) {
6122              try {
6123                  ax = new ActiveXObject(activeX);
6124                  if (ax) {
6125                      version = axDetect(ax);
6126                  }
6127              } catch (e) {
6128                  
6129              }
6130          }
6131          return version;
6132      }
6133  };
6134  
6135  PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) {
6136      var version = [],
6137          d = ax.GetVariable("$version");
6138  
6139      if (d) {
6140          d = d.split(" ")[1].split(",");
6141          version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
6142      }
6143      return version;
6144  });
6145  
6146  var FlashMediaElementRenderer = {
6147      create: function create(mediaElement, options, mediaFiles) {
6148  
6149          var flash = {};
6150          var isActive = false;
6151  
6152          flash.options = options;
6153          flash.id = mediaElement.id + '_' + flash.options.prefix;
6154          flash.mediaElement = mediaElement;
6155          flash.flashState = {};
6156          flash.flashApi = null;
6157          flash.flashApiStack = [];
6158  
6159          var props = _mejs2.default.html5media.properties,
6160              assignGettersSetters = function assignGettersSetters(propName) {
6161              flash.flashState[propName] = null;
6162  
6163              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
6164  
6165              flash['get' + capName] = function () {
6166                  if (flash.flashApi !== null) {
6167                      if (typeof flash.flashApi['get_' + propName] === 'function') {
6168                          var value = flash.flashApi['get_' + propName]();
6169  
6170                          if (propName === 'buffered') {
6171                              return {
6172                                  start: function start() {
6173                                      return 0;
6174                                  },
6175                                  end: function end() {
6176                                      return value;
6177                                  },
6178                                  length: 1
6179                              };
6180                          }
6181                          return value;
6182                      } else {
6183                          return null;
6184                      }
6185                  } else {
6186                      return null;
6187                  }
6188              };
6189  
6190              flash['set' + capName] = function (value) {
6191                  if (propName === 'src') {
6192                      value = (0, _media.absolutizeUrl)(value);
6193                  }
6194  
6195                  if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) {
6196                      try {
6197                          flash.flashApi['set_' + propName](value);
6198                      } catch (e) {
6199                          
6200                      }
6201                  } else {
6202                      flash.flashApiStack.push({
6203                          type: 'set',
6204                          propName: propName,
6205                          value: value
6206                      });
6207                  }
6208              };
6209          };
6210  
6211          for (var i = 0, total = props.length; i < total; i++) {
6212              assignGettersSetters(props[i]);
6213          }
6214  
6215          var methods = _mejs2.default.html5media.methods,
6216              assignMethods = function assignMethods(methodName) {
6217              flash[methodName] = function () {
6218                  if (isActive) {
6219                      if (flash.flashApi !== null) {
6220                          if (flash.flashApi['fire_' + methodName]) {
6221                              try {
6222                                  flash.flashApi['fire_' + methodName]();
6223                              } catch (e) {
6224                                  
6225                              }
6226                          } else {
6227                              
6228                          }
6229                      } else {
6230                          flash.flashApiStack.push({
6231                              type: 'call',
6232                              methodName: methodName
6233                          });
6234                      }
6235                  }
6236              };
6237          };
6238          methods.push('stop');
6239          for (var _i = 0, _total = methods.length; _i < _total; _i++) {
6240              assignMethods(methods[_i]);
6241          }
6242  
6243          var initEvents = ['rendererready'];
6244  
6245          for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) {
6246              var event = (0, _general.createEvent)(initEvents[_i2], flash);
6247              mediaElement.dispatchEvent(event);
6248          }
6249  
6250          _window2.default['__ready__' + flash.id] = function () {
6251  
6252              flash.flashReady = true;
6253              flash.flashApi = _document2.default.getElementById('__' + flash.id);
6254  
6255              if (flash.flashApiStack.length) {
6256                  for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) {
6257                      var stackItem = flash.flashApiStack[_i3];
6258  
6259                      if (stackItem.type === 'set') {
6260                          var propName = stackItem.propName,
6261                              capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
6262  
6263                          flash['set' + capName](stackItem.value);
6264                      } else if (stackItem.type === 'call') {
6265                          flash[stackItem.methodName]();
6266                      }
6267                  }
6268              }
6269          };
6270  
6271          _window2.default['__event__' + flash.id] = function (eventName, message) {
6272              var event = (0, _general.createEvent)(eventName, flash);
6273              if (message) {
6274                  try {
6275                      event.data = JSON.parse(message);
6276                      event.details.data = JSON.parse(message);
6277                  } catch (e) {
6278                      event.message = message;
6279                  }
6280              }
6281  
6282              flash.mediaElement.dispatchEvent(event);
6283          };
6284  
6285          flash.flashWrapper = _document2.default.createElement('div');
6286  
6287          if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) {
6288              flash.options.shimScriptAccess = 'sameDomain';
6289          }
6290  
6291          var autoplay = mediaElement.originalNode.autoplay,
6292              flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')],
6293              isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video',
6294              flashHeight = isVideo ? mediaElement.originalNode.height : 1,
6295              flashWidth = isVideo ? mediaElement.originalNode.width : 1;
6296  
6297          if (mediaElement.originalNode.getAttribute('src')) {
6298              flashVars.push('src=' + mediaElement.originalNode.getAttribute('src'));
6299          }
6300  
6301          if (flash.options.enablePseudoStreaming === true) {
6302              flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam);
6303              flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType);
6304          }
6305  
6306          if (flash.options.streamDelimiter) {
6307              flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter));
6308          }
6309  
6310          if (flash.options.proxyType) {
6311              flashVars.push('proxytype=' + flash.options.proxyType);
6312          }
6313  
6314          mediaElement.appendChild(flash.flashWrapper);
6315          mediaElement.originalNode.style.display = 'none';
6316  
6317          var settings = [];
6318  
6319          if (_constants.IS_IE || _constants.IS_EDGE) {
6320              var specialIEContainer = _document2.default.createElement('div');
6321              flash.flashWrapper.appendChild(specialIEContainer);
6322  
6323              if (_constants.IS_EDGE) {
6324                  settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"'];
6325              } else {
6326                  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 + '"'];
6327              }
6328  
6329              if (!isVideo) {
6330                  settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
6331              }
6332  
6333              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>';
6334          } else {
6335  
6336              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('&') + '"'];
6337  
6338              if (isVideo) {
6339                  settings.push('width="' + flashWidth + '"');
6340                  settings.push('height="' + flashHeight + '"');
6341              } else {
6342                  settings.push('style="position: fixed; left: -9999em; top: -9999em;"');
6343              }
6344  
6345              flash.flashWrapper.innerHTML = '<embed ' + settings.join(' ') + '>';
6346          }
6347  
6348          flash.flashNode = flash.flashWrapper.lastChild;
6349  
6350          flash.hide = function () {
6351              isActive = false;
6352              if (isVideo) {
6353                  flash.flashNode.style.display = 'none';
6354              }
6355          };
6356          flash.show = function () {
6357              isActive = true;
6358              if (isVideo) {
6359                  flash.flashNode.style.display = '';
6360              }
6361          };
6362          flash.setSize = function (width, height) {
6363              flash.flashNode.style.width = width + 'px';
6364              flash.flashNode.style.height = height + 'px';
6365  
6366              if (flash.flashApi !== null && typeof flash.flashApi.fire_setSize === 'function') {
6367                  flash.flashApi.fire_setSize(width, height);
6368              }
6369          };
6370  
6371          flash.destroy = function () {
6372              flash.flashNode.remove();
6373          };
6374  
6375          if (mediaFiles && mediaFiles.length > 0) {
6376              for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
6377                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
6378                      flash.setSrc(mediaFiles[_i4].src);
6379                      break;
6380                  }
6381              }
6382          }
6383  
6384          return flash;
6385      }
6386  };
6387  
6388  var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]);
6389  
6390  if (hasFlash) {
6391      _media.typeChecks.push(function (url) {
6392          url = url.toLowerCase();
6393  
6394          if (url.startsWith('rtmp')) {
6395              if (~url.indexOf('.mp3')) {
6396                  return 'audio/rtmp';
6397              } else {
6398                  return 'video/rtmp';
6399              }
6400          } else if (/\.og(a|g)/i.test(url)) {
6401              return 'audio/ogg';
6402          } else if (~url.indexOf('.m3u8')) {
6403              return 'application/x-mpegURL';
6404          } else if (~url.indexOf('.mpd')) {
6405              return 'application/dash+xml';
6406          } else if (~url.indexOf('.flv')) {
6407              return 'video/flv';
6408          } else {
6409              return null;
6410          }
6411      });
6412  
6413      var FlashMediaElementVideoRenderer = {
6414          name: 'flash_video',
6415          options: {
6416              prefix: 'flash_video',
6417              filename: 'mediaelement-flash-video.swf',
6418              enablePseudoStreaming: false,
6419  
6420              pseudoStreamingStartQueryParam: 'start',
6421  
6422              pseudoStreamingType: 'byte',
6423  
6424              proxyType: '',
6425  
6426              streamDelimiter: ''
6427          },
6428  
6429          canPlayType: function canPlayType(type) {
6430              return ~['video/mp4', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4', 'video/flv', 'video/x-flv'].indexOf(type.toLowerCase());
6431          },
6432  
6433          create: FlashMediaElementRenderer.create
6434  
6435      };
6436      _renderer.renderer.add(FlashMediaElementVideoRenderer);
6437  
6438      var FlashMediaElementHlsVideoRenderer = {
6439          name: 'flash_hls',
6440          options: {
6441              prefix: 'flash_hls',
6442              filename: 'mediaelement-flash-video-hls.swf'
6443          },
6444  
6445          canPlayType: function canPlayType(type) {
6446              return ~['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase());
6447          },
6448  
6449          create: FlashMediaElementRenderer.create
6450      };
6451      _renderer.renderer.add(FlashMediaElementHlsVideoRenderer);
6452  
6453      var FlashMediaElementMdashVideoRenderer = {
6454          name: 'flash_dash',
6455          options: {
6456              prefix: 'flash_dash',
6457              filename: 'mediaelement-flash-video-mdash.swf'
6458          },
6459  
6460          canPlayType: function canPlayType(type) {
6461              return ~['application/dash+xml'].indexOf(type.toLowerCase());
6462          },
6463  
6464          create: FlashMediaElementRenderer.create
6465      };
6466      _renderer.renderer.add(FlashMediaElementMdashVideoRenderer);
6467  
6468      var FlashMediaElementAudioRenderer = {
6469          name: 'flash_audio',
6470          options: {
6471              prefix: 'flash_audio',
6472              filename: 'mediaelement-flash-audio.swf'
6473          },
6474  
6475          canPlayType: function canPlayType(type) {
6476              return ~['audio/mp3'].indexOf(type.toLowerCase());
6477          },
6478  
6479          create: FlashMediaElementRenderer.create
6480      };
6481      _renderer.renderer.add(FlashMediaElementAudioRenderer);
6482  
6483      var FlashMediaElementAudioOggRenderer = {
6484          name: 'flash_audio_ogg',
6485          options: {
6486              prefix: 'flash_audio_ogg',
6487              filename: 'mediaelement-flash-audio-ogg.swf'
6488          },
6489  
6490          canPlayType: function canPlayType(type) {
6491              return ~['audio/ogg', 'audio/oga', 'audio/ogv'].indexOf(type.toLowerCase());
6492          },
6493  
6494          create: FlashMediaElementRenderer.create
6495      };
6496      _renderer.renderer.add(FlashMediaElementAudioOggRenderer);
6497  }
6498  
6499  },{"10":10,"2":2,"27":27,"29":29,"3":3,"30":30,"7":7,"9":9}],23:[function(_dereq_,module,exports){
6500  'use strict';
6501  
6502  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; };
6503  
6504  var _window = _dereq_(3);
6505  
6506  var _window2 = _interopRequireDefault(_window);
6507  
6508  var _mejs = _dereq_(9);
6509  
6510  var _mejs2 = _interopRequireDefault(_mejs);
6511  
6512  var _renderer = _dereq_(10);
6513  
6514  var _general = _dereq_(29);
6515  
6516  var _constants = _dereq_(27);
6517  
6518  var _media = _dereq_(30);
6519  
6520  var _dom = _dereq_(28);
6521  
6522  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6523  
6524  var NativeFlv = {
6525  
6526      promise: null,
6527  
6528      load: function load(settings) {
6529          if (typeof flvjs !== 'undefined') {
6530              NativeFlv.promise = new Promise(function (resolve) {
6531                  resolve();
6532              }).then(function () {
6533                  NativeFlv._createPlayer(settings);
6534              });
6535          } else {
6536              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/flv.js@latest';
6537  
6538              NativeFlv.promise = NativeFlv.promise || (0, _dom.loadScript)(settings.options.path);
6539              NativeFlv.promise.then(function () {
6540                  NativeFlv._createPlayer(settings);
6541              });
6542          }
6543  
6544          return NativeFlv.promise;
6545      },
6546  
6547      _createPlayer: function _createPlayer(settings) {
6548          flvjs.LoggingControl.enableDebug = settings.options.debug;
6549          flvjs.LoggingControl.enableVerbose = settings.options.debug;
6550          var player = flvjs.createPlayer(settings.options, settings.configs);
6551          _window2.default['__ready__' + settings.id](player);
6552          return player;
6553      }
6554  };
6555  
6556  var FlvNativeRenderer = {
6557      name: 'native_flv',
6558      options: {
6559          prefix: 'native_flv',
6560          flv: {
6561              path: 'https://cdn.jsdelivr.net/npm/flv.js@latest',
6562  
6563              cors: true,
6564              debug: false
6565          }
6566      },
6567  
6568      canPlayType: function canPlayType(type) {
6569          return _constants.HAS_MSE && ['video/x-flv', 'video/flv'].indexOf(type.toLowerCase()) > -1;
6570      },
6571  
6572      create: function create(mediaElement, options, mediaFiles) {
6573  
6574          var originalNode = mediaElement.originalNode,
6575              id = mediaElement.id + '_' + options.prefix;
6576  
6577          var node = null,
6578              flvPlayer = null;
6579  
6580          node = originalNode.cloneNode(true);
6581          options = Object.assign(options, mediaElement.options);
6582  
6583          var props = _mejs2.default.html5media.properties,
6584              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
6585              return e !== 'error';
6586          }),
6587              attachNativeEvents = function attachNativeEvents(e) {
6588              var event = (0, _general.createEvent)(e.type, mediaElement);
6589              mediaElement.dispatchEvent(event);
6590          },
6591              assignGettersSetters = function assignGettersSetters(propName) {
6592              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
6593  
6594              node['get' + capName] = function () {
6595                  return flvPlayer !== null ? node[propName] : null;
6596              };
6597  
6598              node['set' + capName] = function (value) {
6599                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
6600                      if (propName === 'src') {
6601                          node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
6602                          if (flvPlayer !== null) {
6603                              var _flvOptions = {};
6604                              _flvOptions.type = 'flv';
6605                              _flvOptions.url = value;
6606                              _flvOptions.cors = options.flv.cors;
6607                              _flvOptions.debug = options.flv.debug;
6608                              _flvOptions.path = options.flv.path;
6609                              var _flvConfigs = options.flv.configs;
6610  
6611                              flvPlayer.destroy();
6612                              for (var i = 0, total = events.length; i < total; i++) {
6613                                  node.removeEventListener(events[i], attachNativeEvents);
6614                              }
6615                              flvPlayer = NativeFlv._createPlayer({
6616                                  options: _flvOptions,
6617                                  configs: _flvConfigs,
6618                                  id: id
6619                              });
6620                              flvPlayer.attachMediaElement(node);
6621                              flvPlayer.load();
6622                          }
6623                      } else {
6624                          node[propName] = value;
6625                      }
6626                  }
6627              };
6628          };
6629  
6630          for (var i = 0, total = props.length; i < total; i++) {
6631              assignGettersSetters(props[i]);
6632          }
6633  
6634          _window2.default['__ready__' + id] = function (_flvPlayer) {
6635              mediaElement.flvPlayer = flvPlayer = _flvPlayer;
6636  
6637              var flvEvents = flvjs.Events,
6638                  assignEvents = function assignEvents(eventName) {
6639                  if (eventName === 'loadedmetadata') {
6640                      flvPlayer.unload();
6641                      flvPlayer.detachMediaElement();
6642                      flvPlayer.attachMediaElement(node);
6643                      flvPlayer.load();
6644                  }
6645  
6646                  node.addEventListener(eventName, attachNativeEvents);
6647              };
6648  
6649              for (var _i = 0, _total = events.length; _i < _total; _i++) {
6650                  assignEvents(events[_i]);
6651              }
6652  
6653              var assignFlvEvents = function assignFlvEvents(name, data) {
6654                  if (name === 'error') {
6655                      var message = data[0] + ': ' + data[1] + ' ' + data[2].msg;
6656                      mediaElement.generateError(message, node.src);
6657                  } else {
6658                      var _event = (0, _general.createEvent)(name, mediaElement);
6659                      _event.data = data;
6660                      mediaElement.dispatchEvent(_event);
6661                  }
6662              };
6663  
6664              var _loop = function _loop(eventType) {
6665                  if (flvEvents.hasOwnProperty(eventType)) {
6666                      flvPlayer.on(flvEvents[eventType], function () {
6667                          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
6668                              args[_key] = arguments[_key];
6669                          }
6670  
6671                          return assignFlvEvents(flvEvents[eventType], args);
6672                      });
6673                  }
6674              };
6675  
6676              for (var eventType in flvEvents) {
6677                  _loop(eventType);
6678              }
6679          };
6680  
6681          if (mediaFiles && mediaFiles.length > 0) {
6682              for (var _i2 = 0, _total2 = mediaFiles.length; _i2 < _total2; _i2++) {
6683                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i2].type)) {
6684                      node.setAttribute('src', mediaFiles[_i2].src);
6685                      break;
6686                  }
6687              }
6688          }
6689  
6690          node.setAttribute('id', id);
6691  
6692          originalNode.parentNode.insertBefore(node, originalNode);
6693          originalNode.autoplay = false;
6694          originalNode.style.display = 'none';
6695  
6696          var flvOptions = {};
6697          flvOptions.type = 'flv';
6698          flvOptions.url = node.src;
6699          flvOptions.cors = options.flv.cors;
6700          flvOptions.debug = options.flv.debug;
6701          flvOptions.path = options.flv.path;
6702          var flvConfigs = options.flv.configs;
6703  
6704          node.setSize = function (width, height) {
6705              node.style.width = width + 'px';
6706              node.style.height = height + 'px';
6707              return node;
6708          };
6709  
6710          node.hide = function () {
6711              if (flvPlayer !== null) {
6712                  flvPlayer.pause();
6713              }
6714              node.style.display = 'none';
6715              return node;
6716          };
6717  
6718          node.show = function () {
6719              node.style.display = '';
6720              return node;
6721          };
6722  
6723          node.destroy = function () {
6724              if (flvPlayer !== null) {
6725                  flvPlayer.destroy();
6726              }
6727          };
6728  
6729          var event = (0, _general.createEvent)('rendererready', node);
6730          mediaElement.dispatchEvent(event);
6731  
6732          mediaElement.promises.push(NativeFlv.load({
6733              options: flvOptions,
6734              configs: flvConfigs,
6735              id: id
6736          }));
6737  
6738          return node;
6739      }
6740  };
6741  
6742  _media.typeChecks.push(function (url) {
6743      return ~url.toLowerCase().indexOf('.flv') ? 'video/flv' : null;
6744  });
6745  
6746  _renderer.renderer.add(FlvNativeRenderer);
6747  
6748  },{"10":10,"27":27,"28":28,"29":29,"3":3,"30":30,"9":9}],24:[function(_dereq_,module,exports){
6749  'use strict';
6750  
6751  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; };
6752  
6753  var _window = _dereq_(3);
6754  
6755  var _window2 = _interopRequireDefault(_window);
6756  
6757  var _mejs = _dereq_(9);
6758  
6759  var _mejs2 = _interopRequireDefault(_mejs);
6760  
6761  var _renderer = _dereq_(10);
6762  
6763  var _general = _dereq_(29);
6764  
6765  var _constants = _dereq_(27);
6766  
6767  var _media = _dereq_(30);
6768  
6769  var _dom = _dereq_(28);
6770  
6771  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6772  
6773  var NativeHls = {
6774  
6775      promise: null,
6776  
6777      load: function load(settings) {
6778          if (typeof Hls !== 'undefined') {
6779              NativeHls.promise = new Promise(function (resolve) {
6780                  resolve();
6781              }).then(function () {
6782                  NativeHls._createPlayer(settings);
6783              });
6784          } else {
6785              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/hls.js@latest';
6786  
6787              NativeHls.promise = NativeHls.promise || (0, _dom.loadScript)(settings.options.path);
6788              NativeHls.promise.then(function () {
6789                  NativeHls._createPlayer(settings);
6790              });
6791          }
6792  
6793          return NativeHls.promise;
6794      },
6795  
6796      _createPlayer: function _createPlayer(settings) {
6797          var player = new Hls(settings.options);
6798          _window2.default['__ready__' + settings.id](player);
6799          return player;
6800      }
6801  };
6802  
6803  var HlsNativeRenderer = {
6804      name: 'native_hls',
6805      options: {
6806          prefix: 'native_hls',
6807          hls: {
6808              path: 'https://cdn.jsdelivr.net/npm/hls.js@latest',
6809  
6810              autoStartLoad: false,
6811              debug: false
6812          }
6813      },
6814  
6815      canPlayType: function canPlayType(type) {
6816          return _constants.HAS_MSE && ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) > -1;
6817      },
6818  
6819      create: function create(mediaElement, options, mediaFiles) {
6820  
6821          var originalNode = mediaElement.originalNode,
6822              id = mediaElement.id + '_' + options.prefix,
6823              preload = originalNode.getAttribute('preload'),
6824              autoplay = originalNode.autoplay;
6825  
6826          var hlsPlayer = null,
6827              node = null,
6828              index = 0,
6829              total = mediaFiles.length;
6830  
6831          node = originalNode.cloneNode(true);
6832          options = Object.assign(options, mediaElement.options);
6833          options.hls.autoStartLoad = preload && preload !== 'none' || autoplay;
6834  
6835          var props = _mejs2.default.html5media.properties,
6836              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
6837              return e !== 'error';
6838          }),
6839              attachNativeEvents = function attachNativeEvents(e) {
6840              var event = (0, _general.createEvent)(e.type, mediaElement);
6841              mediaElement.dispatchEvent(event);
6842          },
6843              assignGettersSetters = function assignGettersSetters(propName) {
6844              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
6845  
6846              node['get' + capName] = function () {
6847                  return hlsPlayer !== null ? node[propName] : null;
6848              };
6849  
6850              node['set' + capName] = function (value) {
6851                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
6852                      if (propName === 'src') {
6853                          node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
6854                          if (hlsPlayer !== null) {
6855                              hlsPlayer.destroy();
6856                              for (var i = 0, _total = events.length; i < _total; i++) {
6857                                  node.removeEventListener(events[i], attachNativeEvents);
6858                              }
6859                              hlsPlayer = NativeHls._createPlayer({
6860                                  options: options.hls,
6861                                  id: id
6862                              });
6863                              hlsPlayer.loadSource(value);
6864                              hlsPlayer.attachMedia(node);
6865                          }
6866                      } else {
6867                          node[propName] = value;
6868                      }
6869                  }
6870              };
6871          };
6872  
6873          for (var i = 0, _total2 = props.length; i < _total2; i++) {
6874              assignGettersSetters(props[i]);
6875          }
6876  
6877          _window2.default['__ready__' + id] = function (_hlsPlayer) {
6878              mediaElement.hlsPlayer = hlsPlayer = _hlsPlayer;
6879              var hlsEvents = Hls.Events,
6880                  assignEvents = function assignEvents(eventName) {
6881                  if (eventName === 'loadedmetadata') {
6882                      var url = mediaElement.originalNode.src;
6883                      hlsPlayer.detachMedia();
6884                      hlsPlayer.loadSource(url);
6885                      hlsPlayer.attachMedia(node);
6886                  }
6887  
6888                  node.addEventListener(eventName, attachNativeEvents);
6889              };
6890  
6891              for (var _i = 0, _total3 = events.length; _i < _total3; _i++) {
6892                  assignEvents(events[_i]);
6893              }
6894  
6895              var recoverDecodingErrorDate = void 0,
6896                  recoverSwapAudioCodecDate = void 0;
6897              var assignHlsEvents = function assignHlsEvents(name, data) {
6898                  if (name === 'hlsError') {
6899                      console.warn(data);
6900                      data = data[1];
6901  
6902                      if (data.fatal) {
6903                          switch (data.type) {
6904                              case 'mediaError':
6905                                  var now = new Date().getTime();
6906                                  if (!recoverDecodingErrorDate || now - recoverDecodingErrorDate > 3000) {
6907                                      recoverDecodingErrorDate = new Date().getTime();
6908                                      hlsPlayer.recoverMediaError();
6909                                  } else if (!recoverSwapAudioCodecDate || now - recoverSwapAudioCodecDate > 3000) {
6910                                      recoverSwapAudioCodecDate = new Date().getTime();
6911                                      console.warn('Attempting to swap Audio Codec and recover from media error');
6912                                      hlsPlayer.swapAudioCodec();
6913                                      hlsPlayer.recoverMediaError();
6914                                  } else {
6915                                      var message = 'Cannot recover, last media error recovery failed';
6916                                      mediaElement.generateError(message, node.src);
6917                                      console.error(message);
6918                                  }
6919                                  break;
6920                              case 'networkError':
6921                                  if (data.details === 'manifestLoadError') {
6922                                      if (index < total && mediaFiles[index + 1] !== undefined) {
6923                                          node.setSrc(mediaFiles[index++].src);
6924                                          node.load();
6925                                          node.play();
6926                                      } else {
6927                                          var _message = 'Network error';
6928                                          mediaElement.generateError(_message, mediaFiles);
6929                                          console.error(_message);
6930                                      }
6931                                  } else {
6932                                      var _message2 = 'Network error';
6933                                      mediaElement.generateError(_message2, mediaFiles);
6934                                      console.error(_message2);
6935                                  }
6936                                  break;
6937                              default:
6938                                  hlsPlayer.destroy();
6939                                  break;
6940                          }
6941                          return;
6942                      }
6943                  }
6944                  var event = (0, _general.createEvent)(name, mediaElement);
6945                  event.data = data;
6946                  mediaElement.dispatchEvent(event);
6947              };
6948  
6949              var _loop = function _loop(eventType) {
6950                  if (hlsEvents.hasOwnProperty(eventType)) {
6951                      hlsPlayer.on(hlsEvents[eventType], function () {
6952                          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
6953                              args[_key] = arguments[_key];
6954                          }
6955  
6956                          return assignHlsEvents(hlsEvents[eventType], args);
6957                      });
6958                  }
6959              };
6960  
6961              for (var eventType in hlsEvents) {
6962                  _loop(eventType);
6963              }
6964          };
6965  
6966          if (total > 0) {
6967              for (; index < total; index++) {
6968                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
6969                      node.setAttribute('src', mediaFiles[index].src);
6970                      break;
6971                  }
6972              }
6973          }
6974  
6975          if (preload !== 'auto' && !autoplay) {
6976              node.addEventListener('play', function () {
6977                  if (hlsPlayer !== null) {
6978                      hlsPlayer.startLoad();
6979                  }
6980              });
6981  
6982              node.addEventListener('pause', function () {
6983                  if (hlsPlayer !== null) {
6984                      hlsPlayer.stopLoad();
6985                  }
6986              });
6987          }
6988  
6989          node.setAttribute('id', id);
6990  
6991          originalNode.parentNode.insertBefore(node, originalNode);
6992          originalNode.autoplay = false;
6993          originalNode.style.display = 'none';
6994  
6995          node.setSize = function (width, height) {
6996              node.style.width = width + 'px';
6997              node.style.height = height + 'px';
6998              return node;
6999          };
7000  
7001          node.hide = function () {
7002              node.pause();
7003              node.style.display = 'none';
7004              return node;
7005          };
7006  
7007          node.show = function () {
7008              node.style.display = '';
7009              return node;
7010          };
7011  
7012          node.destroy = function () {
7013              if (hlsPlayer !== null) {
7014                  hlsPlayer.stopLoad();
7015                  hlsPlayer.destroy();
7016              }
7017          };
7018  
7019          var event = (0, _general.createEvent)('rendererready', node);
7020          mediaElement.dispatchEvent(event);
7021  
7022          mediaElement.promises.push(NativeHls.load({
7023              options: options.hls,
7024              id: id
7025          }));
7026  
7027          return node;
7028      }
7029  };
7030  
7031  _media.typeChecks.push(function (url) {
7032      return ~url.toLowerCase().indexOf('.m3u8') ? 'application/x-mpegURL' : null;
7033  });
7034  
7035  _renderer.renderer.add(HlsNativeRenderer);
7036  
7037  },{"10":10,"27":27,"28":28,"29":29,"3":3,"30":30,"9":9}],25:[function(_dereq_,module,exports){
7038  'use strict';
7039  
7040  var _window = _dereq_(3);
7041  
7042  var _window2 = _interopRequireDefault(_window);
7043  
7044  var _document = _dereq_(2);
7045  
7046  var _document2 = _interopRequireDefault(_document);
7047  
7048  var _mejs = _dereq_(9);
7049  
7050  var _mejs2 = _interopRequireDefault(_mejs);
7051  
7052  var _renderer = _dereq_(10);
7053  
7054  var _general = _dereq_(29);
7055  
7056  var _constants = _dereq_(27);
7057  
7058  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7059  
7060  var HtmlMediaElement = {
7061      name: 'html5',
7062      options: {
7063          prefix: 'html5'
7064      },
7065  
7066      canPlayType: function canPlayType(type) {
7067  
7068          var mediaElement = _document2.default.createElement('video');
7069  
7070          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) {
7071              return 'yes';
7072          } else if (mediaElement.canPlayType) {
7073              return mediaElement.canPlayType(type.toLowerCase()).replace(/no/, '');
7074          } else {
7075              return '';
7076          }
7077      },
7078  
7079      create: function create(mediaElement, options, mediaFiles) {
7080  
7081          var id = mediaElement.id + '_' + options.prefix;
7082          var isActive = false;
7083  
7084          var node = null;
7085  
7086          if (mediaElement.originalNode === undefined || mediaElement.originalNode === null) {
7087              node = _document2.default.createElement('audio');
7088              mediaElement.appendChild(node);
7089          } else {
7090              node = mediaElement.originalNode;
7091          }
7092  
7093          node.setAttribute('id', id);
7094  
7095          var props = _mejs2.default.html5media.properties,
7096              assignGettersSetters = function assignGettersSetters(propName) {
7097              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
7098  
7099              node['get' + capName] = function () {
7100                  return node[propName];
7101              };
7102  
7103              node['set' + capName] = function (value) {
7104                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
7105                      node[propName] = value;
7106                  }
7107              };
7108          };
7109  
7110          for (var i = 0, _total = props.length; i < _total; i++) {
7111              assignGettersSetters(props[i]);
7112          }
7113  
7114          var events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
7115              return e !== 'error';
7116          }),
7117              assignEvents = function assignEvents(eventName) {
7118              node.addEventListener(eventName, function (e) {
7119                  if (isActive) {
7120                      var _event = (0, _general.createEvent)(e.type, e.target);
7121                      mediaElement.dispatchEvent(_event);
7122                  }
7123              });
7124          };
7125  
7126          for (var _i = 0, _total2 = events.length; _i < _total2; _i++) {
7127              assignEvents(events[_i]);
7128          }
7129  
7130          node.setSize = function (width, height) {
7131              node.style.width = width + 'px';
7132              node.style.height = height + 'px';
7133              return node;
7134          };
7135  
7136          node.hide = function () {
7137              isActive = false;
7138              node.style.display = 'none';
7139  
7140              return node;
7141          };
7142  
7143          node.show = function () {
7144              isActive = true;
7145              node.style.display = '';
7146  
7147              return node;
7148          };
7149  
7150          var index = 0,
7151              total = mediaFiles.length;
7152          if (total > 0) {
7153              for (; index < total; index++) {
7154                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
7155                      node.setAttribute('src', mediaFiles[index].src);
7156                      break;
7157                  }
7158              }
7159          }
7160  
7161          node.addEventListener('error', function (e) {
7162              if (e.target.error.code === 4 && isActive) {
7163                  if (index < total && mediaFiles[index + 1] !== undefined) {
7164                      node.src = mediaFiles[index++].src;
7165                      node.load();
7166                      node.play();
7167                  } else {
7168                      mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles);
7169                  }
7170              }
7171          });
7172  
7173          var event = (0, _general.createEvent)('rendererready', node);
7174          mediaElement.dispatchEvent(event);
7175  
7176          return node;
7177      }
7178  };
7179  
7180  _window2.default.HtmlMediaElement = _mejs2.default.HtmlMediaElement = HtmlMediaElement;
7181  
7182  _renderer.renderer.add(HtmlMediaElement);
7183  
7184  },{"10":10,"2":2,"27":27,"29":29,"3":3,"9":9}],26:[function(_dereq_,module,exports){
7185  'use strict';
7186  
7187  var _window = _dereq_(3);
7188  
7189  var _window2 = _interopRequireDefault(_window);
7190  
7191  var _document = _dereq_(2);
7192  
7193  var _document2 = _interopRequireDefault(_document);
7194  
7195  var _mejs = _dereq_(9);
7196  
7197  var _mejs2 = _interopRequireDefault(_mejs);
7198  
7199  var _renderer = _dereq_(10);
7200  
7201  var _general = _dereq_(29);
7202  
7203  var _media = _dereq_(30);
7204  
7205  var _dom = _dereq_(28);
7206  
7207  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7208  
7209  var YouTubeApi = {
7210      isIframeStarted: false,
7211  
7212      isIframeLoaded: false,
7213  
7214      iframeQueue: [],
7215  
7216      enqueueIframe: function enqueueIframe(settings) {
7217          YouTubeApi.isLoaded = typeof YT !== 'undefined' && YT.loaded;
7218  
7219          if (YouTubeApi.isLoaded) {
7220              YouTubeApi.createIframe(settings);
7221          } else {
7222              YouTubeApi.loadIframeApi();
7223              YouTubeApi.iframeQueue.push(settings);
7224          }
7225      },
7226  
7227      loadIframeApi: function loadIframeApi() {
7228          if (!YouTubeApi.isIframeStarted) {
7229              (0, _dom.loadScript)('https://www.youtube.com/player_api');
7230              YouTubeApi.isIframeStarted = true;
7231          }
7232      },
7233  
7234      iFrameReady: function iFrameReady() {
7235  
7236          YouTubeApi.isLoaded = true;
7237          YouTubeApi.isIframeLoaded = true;
7238  
7239          while (YouTubeApi.iframeQueue.length > 0) {
7240              var settings = YouTubeApi.iframeQueue.pop();
7241              YouTubeApi.createIframe(settings);
7242          }
7243      },
7244  
7245      createIframe: function createIframe(settings) {
7246          return new YT.Player(settings.containerId, settings);
7247      },
7248  
7249      getYouTubeId: function getYouTubeId(url) {
7250  
7251          var youTubeId = '';
7252  
7253          if (url.indexOf('?') > 0) {
7254              youTubeId = YouTubeApi.getYouTubeIdFromParam(url);
7255  
7256              if (youTubeId === '') {
7257                  youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
7258              }
7259          } else {
7260              youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
7261          }
7262  
7263          var id = youTubeId.substring(youTubeId.lastIndexOf('/') + 1);
7264          youTubeId = id.split('?');
7265          return youTubeId[0];
7266      },
7267  
7268      getYouTubeIdFromParam: function getYouTubeIdFromParam(url) {
7269  
7270          if (url === undefined || url === null || !url.trim().length) {
7271              return null;
7272          }
7273  
7274          var parts = url.split('?'),
7275              parameters = parts[1].split('&');
7276  
7277          var youTubeId = '';
7278  
7279          for (var i = 0, total = parameters.length; i < total; i++) {
7280              var paramParts = parameters[i].split('=');
7281              if (paramParts[0] === 'v') {
7282                  youTubeId = paramParts[1];
7283                  break;
7284              }
7285          }
7286  
7287          return youTubeId;
7288      },
7289  
7290      getYouTubeIdFromUrl: function getYouTubeIdFromUrl(url) {
7291  
7292          if (url === undefined || url === null || !url.trim().length) {
7293              return null;
7294          }
7295  
7296          var parts = url.split('?');
7297          url = parts[0];
7298          return url.substring(url.lastIndexOf('/') + 1);
7299      },
7300  
7301      getYouTubeNoCookieUrl: function getYouTubeNoCookieUrl(url) {
7302          if (url === undefined || url === null || !url.trim().length || url.indexOf('//www.youtube') === -1) {
7303              return url;
7304          }
7305  
7306          var parts = url.split('/');
7307          parts[2] = parts[2].replace('.com', '-nocookie.com');
7308          return parts.join('/');
7309      }
7310  };
7311  
7312  var YouTubeIframeRenderer = {
7313      name: 'youtube_iframe',
7314  
7315      options: {
7316          prefix: 'youtube_iframe',
7317  
7318          youtube: {
7319              autoplay: 0,
7320              controls: 0,
7321              disablekb: 1,
7322              end: 0,
7323              loop: 0,
7324              modestbranding: 0,
7325              playsinline: 0,
7326              rel: 0,
7327              showinfo: 0,
7328              start: 0,
7329              iv_load_policy: 3,
7330  
7331              nocookie: false,
7332  
7333              imageQuality: null
7334          }
7335      },
7336  
7337      canPlayType: function canPlayType(type) {
7338          return ~['video/youtube', 'video/x-youtube'].indexOf(type.toLowerCase());
7339      },
7340  
7341      create: function create(mediaElement, options, mediaFiles) {
7342  
7343          var youtube = {},
7344              apiStack = [],
7345              readyState = 4;
7346  
7347          var youTubeApi = null,
7348              paused = true,
7349              ended = false,
7350              youTubeIframe = null,
7351              volume = 1;
7352  
7353          youtube.options = options;
7354          youtube.id = mediaElement.id + '_' + options.prefix;
7355          youtube.mediaElement = mediaElement;
7356  
7357          var props = _mejs2.default.html5media.properties,
7358              assignGettersSetters = function assignGettersSetters(propName) {
7359  
7360              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
7361  
7362              youtube['get' + capName] = function () {
7363                  if (youTubeApi !== null) {
7364                      var value = null;
7365  
7366                      switch (propName) {
7367                          case 'currentTime':
7368                              return youTubeApi.getCurrentTime();
7369                          case 'duration':
7370                              return youTubeApi.getDuration();
7371                          case 'volume':
7372                              volume = youTubeApi.getVolume() / 100;
7373                              return volume;
7374                          case 'playbackRate':
7375                              return youTubeApi.getPlaybackRate();
7376                          case 'paused':
7377                              return paused;
7378                          case 'ended':
7379                              return ended;
7380                          case 'muted':
7381                              return youTubeApi.isMuted();
7382                          case 'buffered':
7383                              var percentLoaded = youTubeApi.getVideoLoadedFraction(),
7384                                  duration = youTubeApi.getDuration();
7385                              return {
7386                                  start: function start() {
7387                                      return 0;
7388                                  },
7389                                  end: function end() {
7390                                      return percentLoaded * duration;
7391                                  },
7392                                  length: 1
7393                              };
7394                          case 'src':
7395                              return youTubeApi.getVideoUrl();
7396                          case 'readyState':
7397                              return readyState;
7398                      }
7399  
7400                      return value;
7401                  } else {
7402                      return null;
7403                  }
7404              };
7405  
7406              youtube['set' + capName] = function (value) {
7407                  if (youTubeApi !== null) {
7408                      switch (propName) {
7409                          case 'src':
7410                              var url = typeof value === 'string' ? value : value[0].src,
7411                                  _videoId = YouTubeApi.getYouTubeId(url);
7412  
7413                              if (mediaElement.originalNode.autoplay) {
7414                                  youTubeApi.loadVideoById(_videoId);
7415                              } else {
7416                                  youTubeApi.cueVideoById(_videoId);
7417                              }
7418                              break;
7419                          case 'currentTime':
7420                              youTubeApi.seekTo(value);
7421                              break;
7422                          case 'muted':
7423                              if (value) {
7424                                  youTubeApi.mute();
7425                              } else {
7426                                  youTubeApi.unMute();
7427                              }
7428                              setTimeout(function () {
7429                                  var event = (0, _general.createEvent)('volumechange', youtube);
7430                                  mediaElement.dispatchEvent(event);
7431                              }, 50);
7432                              break;
7433                          case 'volume':
7434                              volume = value;
7435                              youTubeApi.setVolume(value * 100);
7436                              setTimeout(function () {
7437                                  var event = (0, _general.createEvent)('volumechange', youtube);
7438                                  mediaElement.dispatchEvent(event);
7439                              }, 50);
7440                              break;
7441                          case 'playbackRate':
7442                              youTubeApi.setPlaybackRate(value);
7443                              setTimeout(function () {
7444                                  var event = (0, _general.createEvent)('ratechange', youtube);
7445                                  mediaElement.dispatchEvent(event);
7446                              }, 50);
7447                              break;
7448                          case 'readyState':
7449                              var event = (0, _general.createEvent)('canplay', youtube);
7450                              mediaElement.dispatchEvent(event);
7451                              break;
7452                          default:
7453                              
7454                              break;
7455                      }
7456                  } else {
7457                      apiStack.push({ type: 'set', propName: propName, value: value });
7458                  }
7459              };
7460          };
7461  
7462          for (var i = 0, total = props.length; i < total; i++) {
7463              assignGettersSetters(props[i]);
7464          }
7465  
7466          var methods = _mejs2.default.html5media.methods,
7467              assignMethods = function assignMethods(methodName) {
7468              youtube[methodName] = function () {
7469                  if (youTubeApi !== null) {
7470                      switch (methodName) {
7471                          case 'play':
7472                              paused = false;
7473                              return youTubeApi.playVideo();
7474                          case 'pause':
7475                              paused = true;
7476                              return youTubeApi.pauseVideo();
7477                          case 'load':
7478                              return null;
7479                      }
7480                  } else {
7481                      apiStack.push({ type: 'call', methodName: methodName });
7482                  }
7483              };
7484          };
7485  
7486          for (var _i = 0, _total = methods.length; _i < _total; _i++) {
7487              assignMethods(methods[_i]);
7488          }
7489  
7490          var errorHandler = function errorHandler(error) {
7491              var message = '';
7492              switch (error.data) {
7493                  case 2:
7494                      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.';
7495                      break;
7496                  case 5:
7497                      message = 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.';
7498                      break;
7499                  case 100:
7500                      message = 'The video requested was not found. Either video has been removed or has been marked as private.';
7501                      break;
7502                  case 101:
7503                  case 105:
7504                      message = 'The owner of the requested video does not allow it to be played in embedded players.';
7505                      break;
7506                  default:
7507                      message = 'Unknown error.';
7508                      break;
7509              }
7510              mediaElement.generateError('Code ' + error.data + ': ' + message, mediaFiles);
7511          };
7512  
7513          var youtubeContainer = _document2.default.createElement('div');
7514          youtubeContainer.id = youtube.id;
7515  
7516          if (youtube.options.youtube.nocookie) {
7517              mediaElement.originalNode.src = YouTubeApi.getYouTubeNoCookieUrl(mediaFiles[0].src);
7518          }
7519  
7520          mediaElement.originalNode.parentNode.insertBefore(youtubeContainer, mediaElement.originalNode);
7521          mediaElement.originalNode.style.display = 'none';
7522  
7523          var isAudio = mediaElement.originalNode.tagName.toLowerCase() === 'audio',
7524              height = isAudio ? '1' : mediaElement.originalNode.height,
7525              width = isAudio ? '1' : mediaElement.originalNode.width,
7526              videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src),
7527              youtubeSettings = {
7528              id: youtube.id,
7529              containerId: youtubeContainer.id,
7530              videoId: videoId,
7531              height: height,
7532              width: width,
7533              playerVars: Object.assign({
7534                  controls: 0,
7535                  rel: 0,
7536                  disablekb: 1,
7537                  showinfo: 0,
7538                  modestbranding: 0,
7539                  html5: 1,
7540                  iv_load_policy: 3
7541              }, youtube.options.youtube),
7542              origin: _window2.default.location.host,
7543              events: {
7544                  onReady: function onReady(e) {
7545                      mediaElement.youTubeApi = youTubeApi = e.target;
7546                      mediaElement.youTubeState = {
7547                          paused: true,
7548                          ended: false
7549                      };
7550  
7551                      if (apiStack.length) {
7552                          for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
7553  
7554                              var stackItem = apiStack[_i2];
7555  
7556                              if (stackItem.type === 'set') {
7557                                  var propName = stackItem.propName,
7558                                      capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
7559  
7560                                  youtube['set' + capName](stackItem.value);
7561                              } else if (stackItem.type === 'call') {
7562                                  youtube[stackItem.methodName]();
7563                              }
7564                          }
7565                      }
7566  
7567                      youTubeIframe = youTubeApi.getIframe();
7568  
7569                      if (mediaElement.originalNode.muted) {
7570                          youTubeApi.mute();
7571                      }
7572  
7573                      var events = ['mouseover', 'mouseout'],
7574                          assignEvents = function assignEvents(e) {
7575                          var newEvent = (0, _general.createEvent)(e.type, youtube);
7576                          mediaElement.dispatchEvent(newEvent);
7577                      };
7578  
7579                      for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
7580                          youTubeIframe.addEventListener(events[_i3], assignEvents, false);
7581                      }
7582  
7583                      var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
7584  
7585                      for (var _i4 = 0, _total4 = initEvents.length; _i4 < _total4; _i4++) {
7586                          var event = (0, _general.createEvent)(initEvents[_i4], youtube);
7587                          mediaElement.dispatchEvent(event);
7588                      }
7589                  },
7590                  onStateChange: function onStateChange(e) {
7591                      var events = [];
7592  
7593                      switch (e.data) {
7594                          case -1:
7595                              events = ['loadedmetadata'];
7596                              paused = true;
7597                              ended = false;
7598                              break;
7599                          case 0:
7600                              events = ['ended'];
7601                              paused = false;
7602                              ended = !youtube.options.youtube.loop;
7603                              if (!youtube.options.youtube.loop) {
7604                                  youtube.stopInterval();
7605                              }
7606                              break;
7607                          case 1:
7608                              events = ['play', 'playing'];
7609                              paused = false;
7610                              ended = false;
7611                              youtube.startInterval();
7612                              break;
7613                          case 2:
7614                              events = ['pause'];
7615                              paused = true;
7616                              ended = false;
7617                              youtube.stopInterval();
7618                              break;
7619                          case 3:
7620                              events = ['progress'];
7621                              ended = false;
7622                              break;
7623                          case 5:
7624                              events = ['loadeddata', 'loadedmetadata', 'canplay'];
7625                              paused = true;
7626                              ended = false;
7627                              break;
7628                      }
7629  
7630                      for (var _i5 = 0, _total5 = events.length; _i5 < _total5; _i5++) {
7631                          var event = (0, _general.createEvent)(events[_i5], youtube);
7632                          mediaElement.dispatchEvent(event);
7633                      }
7634                  },
7635                  onError: function onError(e) {
7636                      return errorHandler(e);
7637                  }
7638              }
7639          };
7640  
7641          if (isAudio || mediaElement.originalNode.hasAttribute('playsinline')) {
7642              youtubeSettings.playerVars.playsinline = 1;
7643          }
7644  
7645          if (mediaElement.originalNode.controls) {
7646              youtubeSettings.playerVars.controls = 1;
7647          }
7648          if (mediaElement.originalNode.autoplay) {
7649              youtubeSettings.playerVars.autoplay = 1;
7650          }
7651          if (mediaElement.originalNode.loop) {
7652              youtubeSettings.playerVars.loop = 1;
7653          }
7654  
7655          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) {
7656              youtubeSettings.playerVars.playlist = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
7657          }
7658  
7659          YouTubeApi.enqueueIframe(youtubeSettings);
7660  
7661          youtube.onEvent = function (eventName, player, _youTubeState) {
7662              if (_youTubeState !== null && _youTubeState !== undefined) {
7663                  mediaElement.youTubeState = _youTubeState;
7664              }
7665          };
7666  
7667          youtube.setSize = function (width, height) {
7668              if (youTubeApi !== null) {
7669                  youTubeApi.setSize(width, height);
7670              }
7671          };
7672          youtube.hide = function () {
7673              youtube.stopInterval();
7674              youtube.pause();
7675              if (youTubeIframe) {
7676                  youTubeIframe.style.display = 'none';
7677              }
7678          };
7679          youtube.show = function () {
7680              if (youTubeIframe) {
7681                  youTubeIframe.style.display = '';
7682              }
7683          };
7684          youtube.destroy = function () {
7685              youTubeApi.destroy();
7686          };
7687          youtube.interval = null;
7688  
7689          youtube.startInterval = function () {
7690              youtube.interval = setInterval(function () {
7691                  var event = (0, _general.createEvent)('timeupdate', youtube);
7692                  mediaElement.dispatchEvent(event);
7693              }, 250);
7694          };
7695          youtube.stopInterval = function () {
7696              if (youtube.interval) {
7697                  clearInterval(youtube.interval);
7698              }
7699          };
7700          youtube.getPosterUrl = function () {
7701              var quality = options.youtube.imageQuality,
7702                  resolutions = ['default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault'],
7703                  id = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
7704              return quality && resolutions.indexOf(quality) > -1 && id ? 'https://img.youtube.com/vi/' + id + '/' + quality + '.jpg' : '';
7705          };
7706  
7707          return youtube;
7708      }
7709  };
7710  
7711  _window2.default.onYouTubePlayerAPIReady = function () {
7712      YouTubeApi.iFrameReady();
7713  };
7714  
7715  _media.typeChecks.push(function (url) {
7716      return (/\/\/(www\.youtube|youtu\.?be)/i.test(url) ? 'video/x-youtube' : null
7717      );
7718  });
7719  
7720  _renderer.renderer.add(YouTubeIframeRenderer);
7721  
7722  },{"10":10,"2":2,"28":28,"29":29,"3":3,"30":30,"9":9}],27:[function(_dereq_,module,exports){
7723  'use strict';
7724  
7725  Object.defineProperty(exports, "__esModule", {
7726      value: true
7727  });
7728  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;
7729  
7730  var _window = _dereq_(3);
7731  
7732  var _window2 = _interopRequireDefault(_window);
7733  
7734  var _document = _dereq_(2);
7735  
7736  var _document2 = _interopRequireDefault(_document);
7737  
7738  var _mejs = _dereq_(9);
7739  
7740  var _mejs2 = _interopRequireDefault(_mejs);
7741  
7742  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7743  
7744  var NAV = exports.NAV = _window2.default.navigator;
7745  var UA = exports.UA = NAV.userAgent.toLowerCase();
7746  var IS_IPAD = exports.IS_IPAD = /ipad/i.test(UA) && !_window2.default.MSStream;
7747  var IS_IPHONE = exports.IS_IPHONE = /iphone/i.test(UA) && !_window2.default.MSStream;
7748  var IS_IPOD = exports.IS_IPOD = /ipod/i.test(UA) && !_window2.default.MSStream;
7749  var IS_IOS = exports.IS_IOS = /ipad|iphone|ipod/i.test(UA) && !_window2.default.MSStream;
7750  var IS_ANDROID = exports.IS_ANDROID = /android/i.test(UA);
7751  var IS_IE = exports.IS_IE = /(trident|microsoft)/i.test(NAV.appName);
7752  var IS_EDGE = exports.IS_EDGE = 'msLaunchUri' in NAV && !('documentMode' in _document2.default);
7753  var IS_CHROME = exports.IS_CHROME = /chrome/i.test(UA);
7754  var IS_FIREFOX = exports.IS_FIREFOX = /firefox/i.test(UA);
7755  var IS_SAFARI = exports.IS_SAFARI = /safari/i.test(UA) && !IS_CHROME;
7756  var IS_STOCK_ANDROID = exports.IS_STOCK_ANDROID = /^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(UA);
7757  var HAS_MSE = exports.HAS_MSE = 'MediaSource' in _window2.default;
7758  var SUPPORT_POINTER_EVENTS = exports.SUPPORT_POINTER_EVENTS = function () {
7759      var element = _document2.default.createElement('x'),
7760          documentElement = _document2.default.documentElement,
7761          getComputedStyle = _window2.default.getComputedStyle;
7762  
7763      if (!('pointerEvents' in element.style)) {
7764          return false;
7765      }
7766  
7767      element.style.pointerEvents = 'auto';
7768      element.style.pointerEvents = 'x';
7769      documentElement.appendChild(element);
7770      var supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto';
7771      element.remove();
7772      return !!supports;
7773  }();
7774  
7775  var SUPPORT_PASSIVE_EVENT = exports.SUPPORT_PASSIVE_EVENT = function () {
7776      var supportsPassive = false;
7777      try {
7778          var opts = Object.defineProperty({}, 'passive', {
7779              get: function get() {
7780                  supportsPassive = true;
7781              }
7782          });
7783          _window2.default.addEventListener('test', null, opts);
7784      } catch (e) {}
7785  
7786      return supportsPassive;
7787  }();
7788  
7789  var html5Elements = ['source', 'track', 'audio', 'video'];
7790  var video = void 0;
7791  
7792  for (var i = 0, total = html5Elements.length; i < total; i++) {
7793      video = _document2.default.createElement(html5Elements[i]);
7794  }
7795  
7796  var SUPPORTS_NATIVE_HLS = exports.SUPPORTS_NATIVE_HLS = IS_SAFARI || IS_ANDROID && (IS_CHROME || IS_STOCK_ANDROID) || IS_IE && /edge/i.test(UA);
7797  
7798  var hasiOSFullScreen = video.webkitEnterFullscreen !== undefined;
7799  
7800  var hasNativeFullscreen = video.requestFullscreen !== undefined;
7801  
7802  if (hasiOSFullScreen && /mac os x 10_5/i.test(UA)) {
7803      hasNativeFullscreen = false;
7804      hasiOSFullScreen = false;
7805  }
7806  
7807  var hasWebkitNativeFullScreen = video.webkitRequestFullScreen !== undefined;
7808  var hasMozNativeFullScreen = video.mozRequestFullScreen !== undefined;
7809  var hasMsNativeFullScreen = video.msRequestFullscreen !== undefined;
7810  var hasTrueNativeFullScreen = hasWebkitNativeFullScreen || hasMozNativeFullScreen || hasMsNativeFullScreen;
7811  var nativeFullScreenEnabled = hasTrueNativeFullScreen;
7812  var fullScreenEventName = '';
7813  var isFullScreen = void 0,
7814      requestFullScreen = void 0,
7815      cancelFullScreen = void 0;
7816  
7817  if (hasMozNativeFullScreen) {
7818      nativeFullScreenEnabled = _document2.default.mozFullScreenEnabled;
7819  } else if (hasMsNativeFullScreen) {
7820      nativeFullScreenEnabled = _document2.default.msFullscreenEnabled;
7821  }
7822  
7823  if (IS_CHROME) {
7824      hasiOSFullScreen = false;
7825  }
7826  
7827  if (hasTrueNativeFullScreen) {
7828      if (hasWebkitNativeFullScreen) {
7829          fullScreenEventName = 'webkitfullscreenchange';
7830      } else if (hasMozNativeFullScreen) {
7831          fullScreenEventName = 'mozfullscreenchange';
7832      } else if (hasMsNativeFullScreen) {
7833          fullScreenEventName = 'MSFullscreenChange';
7834      }
7835  
7836      exports.isFullScreen = isFullScreen = function isFullScreen() {
7837          if (hasMozNativeFullScreen) {
7838              return _document2.default.mozFullScreen;
7839          } else if (hasWebkitNativeFullScreen) {
7840              return _document2.default.webkitIsFullScreen;
7841          } else if (hasMsNativeFullScreen) {
7842              return _document2.default.msFullscreenElement !== null;
7843          }
7844      };
7845  
7846      exports.requestFullScreen = requestFullScreen = function requestFullScreen(el) {
7847          if (hasWebkitNativeFullScreen) {
7848              el.webkitRequestFullScreen();
7849          } else if (hasMozNativeFullScreen) {
7850              el.mozRequestFullScreen();
7851          } else if (hasMsNativeFullScreen) {
7852              el.msRequestFullscreen();
7853          }
7854      };
7855  
7856      exports.cancelFullScreen = cancelFullScreen = function cancelFullScreen() {
7857          if (hasWebkitNativeFullScreen) {
7858              _document2.default.webkitCancelFullScreen();
7859          } else if (hasMozNativeFullScreen) {
7860              _document2.default.mozCancelFullScreen();
7861          } else if (hasMsNativeFullScreen) {
7862              _document2.default.msExitFullscreen();
7863          }
7864      };
7865  }
7866  
7867  var HAS_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = hasNativeFullscreen;
7868  var HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = hasWebkitNativeFullScreen;
7869  var HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = hasMozNativeFullScreen;
7870  var HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = hasMsNativeFullScreen;
7871  var HAS_IOS_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = hasiOSFullScreen;
7872  var HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_TRUE_NATIVE_FULLSCREEN = hasTrueNativeFullScreen;
7873  var HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_NATIVE_FULLSCREEN_ENABLED = nativeFullScreenEnabled;
7874  var FULLSCREEN_EVENT_NAME = exports.FULLSCREEN_EVENT_NAME = fullScreenEventName;
7875  exports.isFullScreen = isFullScreen;
7876  exports.requestFullScreen = requestFullScreen;
7877  exports.cancelFullScreen = cancelFullScreen;
7878  
7879  
7880  _mejs2.default.Features = _mejs2.default.Features || {};
7881  _mejs2.default.Features.isiPad = IS_IPAD;
7882  _mejs2.default.Features.isiPod = IS_IPOD;
7883  _mejs2.default.Features.isiPhone = IS_IPHONE;
7884  _mejs2.default.Features.isiOS = _mejs2.default.Features.isiPhone || _mejs2.default.Features.isiPad;
7885  _mejs2.default.Features.isAndroid = IS_ANDROID;
7886  _mejs2.default.Features.isIE = IS_IE;
7887  _mejs2.default.Features.isEdge = IS_EDGE;
7888  _mejs2.default.Features.isChrome = IS_CHROME;
7889  _mejs2.default.Features.isFirefox = IS_FIREFOX;
7890  _mejs2.default.Features.isSafari = IS_SAFARI;
7891  _mejs2.default.Features.isStockAndroid = IS_STOCK_ANDROID;
7892  _mejs2.default.Features.hasMSE = HAS_MSE;
7893  _mejs2.default.Features.supportsNativeHLS = SUPPORTS_NATIVE_HLS;
7894  _mejs2.default.Features.supportsPointerEvents = SUPPORT_POINTER_EVENTS;
7895  _mejs2.default.Features.supportsPassiveEvent = SUPPORT_PASSIVE_EVENT;
7896  _mejs2.default.Features.hasiOSFullScreen = HAS_IOS_FULLSCREEN;
7897  _mejs2.default.Features.hasNativeFullscreen = HAS_NATIVE_FULLSCREEN;
7898  _mejs2.default.Features.hasWebkitNativeFullScreen = HAS_WEBKIT_NATIVE_FULLSCREEN;
7899  _mejs2.default.Features.hasMozNativeFullScreen = HAS_MOZ_NATIVE_FULLSCREEN;
7900  _mejs2.default.Features.hasMsNativeFullScreen = HAS_MS_NATIVE_FULLSCREEN;
7901  _mejs2.default.Features.hasTrueNativeFullScreen = HAS_TRUE_NATIVE_FULLSCREEN;
7902  _mejs2.default.Features.nativeFullScreenEnabled = HAS_NATIVE_FULLSCREEN_ENABLED;
7903  _mejs2.default.Features.fullScreenEventName = FULLSCREEN_EVENT_NAME;
7904  _mejs2.default.Features.isFullScreen = isFullScreen;
7905  _mejs2.default.Features.requestFullScreen = requestFullScreen;
7906  _mejs2.default.Features.cancelFullScreen = cancelFullScreen;
7907  
7908  },{"2":2,"3":3,"9":9}],28:[function(_dereq_,module,exports){
7909  'use strict';
7910  
7911  Object.defineProperty(exports, "__esModule", {
7912      value: true
7913  });
7914  exports.removeClass = exports.addClass = exports.hasClass = undefined;
7915  exports.loadScript = loadScript;
7916  exports.offset = offset;
7917  exports.toggleClass = toggleClass;
7918  exports.fadeOut = fadeOut;
7919  exports.fadeIn = fadeIn;
7920  exports.siblings = siblings;
7921  exports.visible = visible;
7922  exports.ajax = ajax;
7923  
7924  var _window = _dereq_(3);
7925  
7926  var _window2 = _interopRequireDefault(_window);
7927  
7928  var _document = _dereq_(2);
7929  
7930  var _document2 = _interopRequireDefault(_document);
7931  
7932  var _mejs = _dereq_(9);
7933  
7934  var _mejs2 = _interopRequireDefault(_mejs);
7935  
7936  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7937  
7938  function loadScript(url) {
7939      return new Promise(function (resolve, reject) {
7940          var script = _document2.default.createElement('script');
7941          script.src = url;
7942          script.async = true;
7943          script.onload = function () {
7944              script.remove();
7945              resolve();
7946          };
7947          script.onerror = function () {
7948              script.remove();
7949              reject();
7950          };
7951          _document2.default.head.appendChild(script);
7952      });
7953  }
7954  
7955  function offset(el) {
7956      var rect = el.getBoundingClientRect(),
7957          scrollLeft = _window2.default.pageXOffset || _document2.default.documentElement.scrollLeft,
7958          scrollTop = _window2.default.pageYOffset || _document2.default.documentElement.scrollTop;
7959      return { top: rect.top + scrollTop, left: rect.left + scrollLeft };
7960  }
7961  
7962  var hasClassMethod = void 0,
7963      addClassMethod = void 0,
7964      removeClassMethod = void 0;
7965  
7966  if ('classList' in _document2.default.documentElement) {
7967      hasClassMethod = function hasClassMethod(el, className) {
7968          return el.classList !== undefined && el.classList.contains(className);
7969      };
7970      addClassMethod = function addClassMethod(el, className) {
7971          return el.classList.add(className);
7972      };
7973      removeClassMethod = function removeClassMethod(el, className) {
7974          return el.classList.remove(className);
7975      };
7976  } else {
7977      hasClassMethod = function hasClassMethod(el, className) {
7978          return new RegExp('\\b' + className + '\\b').test(el.className);
7979      };
7980      addClassMethod = function addClassMethod(el, className) {
7981          if (!hasClass(el, className)) {
7982              el.className += ' ' + className;
7983          }
7984      };
7985      removeClassMethod = function removeClassMethod(el, className) {
7986          el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), '');
7987      };
7988  }
7989  
7990  var hasClass = exports.hasClass = hasClassMethod;
7991  var addClass = exports.addClass = addClassMethod;
7992  var removeClass = exports.removeClass = removeClassMethod;
7993  
7994  function toggleClass(el, className) {
7995      hasClass(el, className) ? removeClass(el, className) : addClass(el, className);
7996  }
7997  
7998  function fadeOut(el) {
7999      var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
8000      var callback = arguments[2];
8001  
8002      if (!el.style.opacity) {
8003          el.style.opacity = 1;
8004      }
8005  
8006      var start = null;
8007      _window2.default.requestAnimationFrame(function animate(timestamp) {
8008          start = start || timestamp;
8009          var progress = timestamp - start;
8010          var opacity = parseFloat(1 - progress / duration, 2);
8011          el.style.opacity = opacity < 0 ? 0 : opacity;
8012          if (progress > duration) {
8013              if (callback && typeof callback === 'function') {
8014                  callback();
8015              }
8016          } else {
8017              _window2.default.requestAnimationFrame(animate);
8018          }
8019      });
8020  }
8021  
8022  function fadeIn(el) {
8023      var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
8024      var callback = arguments[2];
8025  
8026      if (!el.style.opacity) {
8027          el.style.opacity = 0;
8028      }
8029  
8030      var start = null;
8031      _window2.default.requestAnimationFrame(function animate(timestamp) {
8032          start = start || timestamp;
8033          var progress = timestamp - start;
8034          var opacity = parseFloat(progress / duration, 2);
8035          el.style.opacity = opacity > 1 ? 1 : opacity;
8036          if (progress > duration) {
8037              if (callback && typeof callback === 'function') {
8038                  callback();
8039              }
8040          } else {
8041              _window2.default.requestAnimationFrame(animate);
8042          }
8043      });
8044  }
8045  
8046  function siblings(el, filter) {
8047      var siblings = [];
8048      el = el.parentNode.firstChild;
8049      do {
8050          if (!filter || filter(el)) {
8051              siblings.push(el);
8052          }
8053      } while (el = el.nextSibling);
8054      return siblings;
8055  }
8056  
8057  function visible(elem) {
8058      if (elem.getClientRects !== undefined && elem.getClientRects === 'function') {
8059          return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
8060      }
8061      return !!(elem.offsetWidth || elem.offsetHeight);
8062  }
8063  
8064  function ajax(url, dataType, success, error) {
8065      var xhr = _window2.default.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
8066  
8067      var type = 'application/x-www-form-urlencoded; charset=UTF-8',
8068          completed = false,
8069          accept = '*/'.concat('*');
8070  
8071      switch (dataType) {
8072          case 'text':
8073              type = 'text/plain';
8074              break;
8075          case 'json':
8076              type = 'application/json, text/javascript';
8077              break;
8078          case 'html':
8079              type = 'text/html';
8080              break;
8081          case 'xml':
8082              type = 'application/xml, text/xml';
8083              break;
8084      }
8085  
8086      if (type !== 'application/x-www-form-urlencoded') {
8087          accept = type + ', */*; q=0.01';
8088      }
8089  
8090      if (xhr) {
8091          xhr.open('GET', url, true);
8092          xhr.setRequestHeader('Accept', accept);
8093          xhr.onreadystatechange = function () {
8094              if (completed) {
8095                  return;
8096              }
8097  
8098              if (xhr.readyState === 4) {
8099                  if (xhr.status === 200) {
8100                      completed = true;
8101                      var data = void 0;
8102                      switch (dataType) {
8103                          case 'json':
8104                              data = JSON.parse(xhr.responseText);
8105                              break;
8106                          case 'xml':
8107                              data = xhr.responseXML;
8108                              break;
8109                          default:
8110                              data = xhr.responseText;
8111                              break;
8112                      }
8113                      success(data);
8114                  } else if (typeof error === 'function') {
8115                      error(xhr.status);
8116                  }
8117              }
8118          };
8119  
8120          xhr.send();
8121      }
8122  }
8123  
8124  _mejs2.default.Utils = _mejs2.default.Utils || {};
8125  _mejs2.default.Utils.offset = offset;
8126  _mejs2.default.Utils.hasClass = hasClass;
8127  _mejs2.default.Utils.addClass = addClass;
8128  _mejs2.default.Utils.removeClass = removeClass;
8129  _mejs2.default.Utils.toggleClass = toggleClass;
8130  _mejs2.default.Utils.fadeIn = fadeIn;
8131  _mejs2.default.Utils.fadeOut = fadeOut;
8132  _mejs2.default.Utils.siblings = siblings;
8133  _mejs2.default.Utils.visible = visible;
8134  _mejs2.default.Utils.ajax = ajax;
8135  _mejs2.default.Utils.loadScript = loadScript;
8136  
8137  },{"2":2,"3":3,"9":9}],29:[function(_dereq_,module,exports){
8138  'use strict';
8139  
8140  Object.defineProperty(exports, "__esModule", {
8141      value: true
8142  });
8143  exports.escapeHTML = escapeHTML;
8144  exports.debounce = debounce;
8145  exports.isObjectEmpty = isObjectEmpty;
8146  exports.splitEvents = splitEvents;
8147  exports.createEvent = createEvent;
8148  exports.isNodeAfter = isNodeAfter;
8149  exports.isString = isString;
8150  
8151  var _mejs = _dereq_(9);
8152  
8153  var _mejs2 = _interopRequireDefault(_mejs);
8154  
8155  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8156  
8157  function escapeHTML(input) {
8158  
8159      if (typeof input !== 'string') {
8160          throw new Error('Argument passed must be a string');
8161      }
8162  
8163      var map = {
8164          '&': '&amp;',
8165          '<': '&lt;',
8166          '>': '&gt;',
8167          '"': '&quot;'
8168      };
8169  
8170      return input.replace(/[&<>"]/g, function (c) {
8171          return map[c];
8172      });
8173  }
8174  
8175  function debounce(func, wait) {
8176      var _this = this,
8177          _arguments = arguments;
8178  
8179      var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8180  
8181  
8182      if (typeof func !== 'function') {
8183          throw new Error('First argument must be a function');
8184      }
8185  
8186      if (typeof wait !== 'number') {
8187          throw new Error('Second argument must be a numeric value');
8188      }
8189  
8190      var timeout = void 0;
8191      return function () {
8192          var context = _this,
8193              args = _arguments;
8194          var later = function later() {
8195              timeout = null;
8196              if (!immediate) {
8197                  func.apply(context, args);
8198              }
8199          };
8200          var callNow = immediate && !timeout;
8201          clearTimeout(timeout);
8202          timeout = setTimeout(later, wait);
8203  
8204          if (callNow) {
8205              func.apply(context, args);
8206          }
8207      };
8208  }
8209  
8210  function isObjectEmpty(instance) {
8211      return Object.getOwnPropertyNames(instance).length <= 0;
8212  }
8213  
8214  function splitEvents(events, id) {
8215      var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;
8216  
8217      var ret = { d: [], w: [] };
8218      (events || '').split(' ').forEach(function (v) {
8219          var eventName = '' + v + (id ? '.' + id : '');
8220  
8221          if (eventName.startsWith('.')) {
8222              ret.d.push(eventName);
8223              ret.w.push(eventName);
8224          } else {
8225              ret[rwindow.test(v) ? 'w' : 'd'].push(eventName);
8226          }
8227      });
8228  
8229      ret.d = ret.d.join(' ');
8230      ret.w = ret.w.join(' ');
8231      return ret;
8232  }
8233  
8234  function createEvent(eventName, target) {
8235  
8236      if (typeof eventName !== 'string') {
8237          throw new Error('Event name must be a string');
8238      }
8239  
8240      var eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i),
8241          detail = {
8242          target: target
8243      };
8244  
8245      if (eventFrags !== null) {
8246          eventName = eventFrags[1];
8247          detail.namespace = eventFrags[2];
8248      }
8249  
8250      return new window.CustomEvent(eventName, {
8251          detail: detail
8252      });
8253  }
8254  
8255  function isNodeAfter(sourceNode, targetNode) {
8256  
8257      return !!(sourceNode && targetNode && sourceNode.compareDocumentPosition(targetNode) & 2);
8258  }
8259  
8260  function isString(value) {
8261      return typeof value === 'string';
8262  }
8263  
8264  _mejs2.default.Utils = _mejs2.default.Utils || {};
8265  _mejs2.default.Utils.escapeHTML = escapeHTML;
8266  _mejs2.default.Utils.debounce = debounce;
8267  _mejs2.default.Utils.isObjectEmpty = isObjectEmpty;
8268  _mejs2.default.Utils.splitEvents = splitEvents;
8269  _mejs2.default.Utils.createEvent = createEvent;
8270  _mejs2.default.Utils.isNodeAfter = isNodeAfter;
8271  _mejs2.default.Utils.isString = isString;
8272  
8273  },{"9":9}],30:[function(_dereq_,module,exports){
8274  'use strict';
8275  
8276  Object.defineProperty(exports, "__esModule", {
8277      value: true
8278  });
8279  exports.typeChecks = undefined;
8280  exports.absolutizeUrl = absolutizeUrl;
8281  exports.formatType = formatType;
8282  exports.getMimeFromType = getMimeFromType;
8283  exports.getTypeFromFile = getTypeFromFile;
8284  exports.getExtension = getExtension;
8285  exports.normalizeExtension = normalizeExtension;
8286  
8287  var _mejs = _dereq_(9);
8288  
8289  var _mejs2 = _interopRequireDefault(_mejs);
8290  
8291  var _general = _dereq_(29);
8292  
8293  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8294  
8295  var typeChecks = exports.typeChecks = [];
8296  
8297  function absolutizeUrl(url) {
8298  
8299      if (typeof url !== 'string') {
8300          throw new Error('`url` argument must be a string');
8301      }
8302  
8303      var el = document.createElement('div');
8304      el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>';
8305      return el.firstChild.href;
8306  }
8307  
8308  function formatType(url) {
8309      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
8310  
8311      return url && !type ? getTypeFromFile(url) : type;
8312  }
8313  
8314  function getMimeFromType(type) {
8315  
8316      if (typeof type !== 'string') {
8317          throw new Error('`type` argument must be a string');
8318      }
8319  
8320      return type && type.indexOf(';') > -1 ? type.substr(0, type.indexOf(';')) : type;
8321  }
8322  
8323  function getTypeFromFile(url) {
8324  
8325      if (typeof url !== 'string') {
8326          throw new Error('`url` argument must be a string');
8327      }
8328  
8329      for (var i = 0, total = typeChecks.length; i < total; i++) {
8330          var type = typeChecks[i](url);
8331  
8332          if (type) {
8333              return type;
8334          }
8335      }
8336  
8337      var ext = getExtension(url),
8338          normalizedExt = normalizeExtension(ext);
8339  
8340      var mime = 'video/mp4';
8341  
8342      if (normalizedExt) {
8343          if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) {
8344              mime = 'video/' + normalizedExt;
8345          } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) {
8346              mime = 'audio/' + normalizedExt;
8347          }
8348      }
8349  
8350      return mime;
8351  }
8352  
8353  function getExtension(url) {
8354  
8355      if (typeof url !== 'string') {
8356          throw new Error('`url` argument must be a string');
8357      }
8358  
8359      var baseUrl = url.split('?')[0],
8360          baseName = baseUrl.split('\\').pop().split('/').pop();
8361      return ~baseName.indexOf('.') ? baseName.substring(baseName.lastIndexOf('.') + 1) : '';
8362  }
8363  
8364  function normalizeExtension(extension) {
8365  
8366      if (typeof extension !== 'string') {
8367          throw new Error('`extension` argument must be a string');
8368      }
8369  
8370      switch (extension) {
8371          case 'mp4':
8372          case 'm4v':
8373              return 'mp4';
8374          case 'webm':
8375          case 'webma':
8376          case 'webmv':
8377              return 'webm';
8378          case 'ogg':
8379          case 'oga':
8380          case 'ogv':
8381              return 'ogg';
8382          default:
8383              return extension;
8384      }
8385  }
8386  
8387  _mejs2.default.Utils = _mejs2.default.Utils || {};
8388  _mejs2.default.Utils.typeChecks = typeChecks;
8389  _mejs2.default.Utils.absolutizeUrl = absolutizeUrl;
8390  _mejs2.default.Utils.formatType = formatType;
8391  _mejs2.default.Utils.getMimeFromType = getMimeFromType;
8392  _mejs2.default.Utils.getTypeFromFile = getTypeFromFile;
8393  _mejs2.default.Utils.getExtension = getExtension;
8394  _mejs2.default.Utils.normalizeExtension = normalizeExtension;
8395  
8396  },{"29":29,"9":9}],31:[function(_dereq_,module,exports){
8397  'use strict';
8398  
8399  var _document = _dereq_(2);
8400  
8401  var _document2 = _interopRequireDefault(_document);
8402  
8403  var _promisePolyfill = _dereq_(5);
8404  
8405  var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill);
8406  
8407  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8408  
8409  (function (arr) {
8410      arr.forEach(function (item) {
8411          if (item.hasOwnProperty('remove')) {
8412              return;
8413          }
8414          Object.defineProperty(item, 'remove', {
8415              configurable: true,
8416              enumerable: true,
8417              writable: true,
8418              value: function remove() {
8419                  this.parentNode.removeChild(this);
8420              }
8421          });
8422      });
8423  })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
8424  
8425  (function () {
8426  
8427      if (typeof window.CustomEvent === 'function') {
8428          return false;
8429      }
8430  
8431      function CustomEvent(event, params) {
8432          params = params || { bubbles: false, cancelable: false, detail: undefined };
8433          var evt = _document2.default.createEvent('CustomEvent');
8434          evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
8435          return evt;
8436      }
8437  
8438      CustomEvent.prototype = window.Event.prototype;
8439      window.CustomEvent = CustomEvent;
8440  })();
8441  
8442  if (typeof Object.assign !== 'function') {
8443      Object.assign = function (target) {
8444  
8445          if (target === null || target === undefined) {
8446              throw new TypeError('Cannot convert undefined or null to object');
8447          }
8448  
8449          var to = Object(target);
8450  
8451          for (var index = 1, total = arguments.length; index < total; index++) {
8452              var nextSource = arguments[index];
8453  
8454              if (nextSource !== null) {
8455                  for (var nextKey in nextSource) {
8456                      if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
8457                          to[nextKey] = nextSource[nextKey];
8458                      }
8459                  }
8460              }
8461          }
8462          return to;
8463      };
8464  }
8465  
8466  if (!String.prototype.startsWith) {
8467      String.prototype.startsWith = function (searchString, position) {
8468          position = position || 0;
8469          return this.substr(position, searchString.length) === searchString;
8470      };
8471  }
8472  
8473  if (!Element.prototype.matches) {
8474      Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) {
8475          var matches = (this.document || this.ownerDocument).querySelectorAll(s),
8476              i = matches.length - 1;
8477          while (--i >= 0 && matches.item(i) !== this) {}
8478          return i > -1;
8479      };
8480  }
8481  
8482  if (window.Element && !Element.prototype.closest) {
8483      Element.prototype.closest = function (s) {
8484          var matches = (this.document || this.ownerDocument).querySelectorAll(s),
8485              i = void 0,
8486              el = this;
8487          do {
8488              i = matches.length;
8489              while (--i >= 0 && matches.item(i) !== el) {}
8490          } while (i < 0 && (el = el.parentElement));
8491          return el;
8492      };
8493  }
8494  
8495  (function () {
8496      var lastTime = 0;
8497      var vendors = ['ms', 'moz', 'webkit', 'o'];
8498      for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
8499          window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
8500          window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
8501      }
8502  
8503      if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback) {
8504          var currTime = new Date().getTime();
8505          var timeToCall = Math.max(0, 16 - (currTime - lastTime));
8506          var id = window.setTimeout(function () {
8507              callback(currTime + timeToCall);
8508          }, timeToCall);
8509          lastTime = currTime + timeToCall;
8510          return id;
8511      };
8512  
8513      if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {
8514          clearTimeout(id);
8515      };
8516  })();
8517  
8518  if (/firefox/i.test(navigator.userAgent)) {
8519      var getComputedStyle = window.getComputedStyle;
8520      window.getComputedStyle = function (el, pseudoEl) {
8521          var t = getComputedStyle(el, pseudoEl);
8522          return t === null ? { getPropertyValue: function getPropertyValue() {} } : t;
8523      };
8524  }
8525  
8526  if (!window.Promise) {
8527      window.Promise = _promisePolyfill2.default;
8528  }
8529  
8530  (function (constructor) {
8531      if (constructor && constructor.prototype && constructor.prototype.children === null) {
8532          Object.defineProperty(constructor.prototype, 'children', {
8533              get: function get() {
8534                  var i = 0,
8535                      node = void 0,
8536                      nodes = this.childNodes,
8537                      children = [];
8538                  while (node = nodes[i++]) {
8539                      if (node.nodeType === 1) {
8540                          children.push(node);
8541                      }
8542                  }
8543                  return children;
8544              }
8545          });
8546      }
8547  })(window.Node || window.Element);
8548  
8549  },{"2":2,"5":5}],32:[function(_dereq_,module,exports){
8550  'use strict';
8551  
8552  Object.defineProperty(exports, "__esModule", {
8553      value: true
8554  });
8555  exports.isDropFrame = isDropFrame;
8556  exports.secondsToTimeCode = secondsToTimeCode;
8557  exports.timeCodeToSeconds = timeCodeToSeconds;
8558  exports.calculateTimeFormat = calculateTimeFormat;
8559  exports.convertSMPTEtoSeconds = convertSMPTEtoSeconds;
8560  
8561  var _mejs = _dereq_(9);
8562  
8563  var _mejs2 = _interopRequireDefault(_mejs);
8564  
8565  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8566  
8567  function isDropFrame() {
8568      var fps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 25;
8569  
8570      return !(fps % 1 === 0);
8571  }
8572  function secondsToTimeCode(time) {
8573      var forceHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
8574      var showFrameCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8575      var fps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 25;
8576      var secondsDecimalLength = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
8577      var timeFormat = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'hh:mm:ss';
8578  
8579  
8580      time = !time || typeof time !== 'number' || time < 0 ? 0 : time;
8581  
8582      var dropFrames = Math.round(fps * 0.066666),
8583          timeBase = Math.round(fps),
8584          framesPer24Hours = Math.round(fps * 3600) * 24,
8585          framesPer10Minutes = Math.round(fps * 600),
8586          frameSep = isDropFrame(fps) ? ';' : ':',
8587          hours = void 0,
8588          minutes = void 0,
8589          seconds = void 0,
8590          frames = void 0,
8591          f = Math.round(time * fps);
8592  
8593      if (isDropFrame(fps)) {
8594  
8595          if (f < 0) {
8596              f = framesPer24Hours + f;
8597          }
8598  
8599          f = f % framesPer24Hours;
8600  
8601          var d = Math.floor(f / framesPer10Minutes);
8602          var m = f % framesPer10Minutes;
8603          f = f + dropFrames * 9 * d;
8604          if (m > dropFrames) {
8605              f = f + dropFrames * Math.floor((m - dropFrames) / Math.round(timeBase * 60 - dropFrames));
8606          }
8607  
8608          var timeBaseDivision = Math.floor(f / timeBase);
8609  
8610          hours = Math.floor(Math.floor(timeBaseDivision / 60) / 60);
8611          minutes = Math.floor(timeBaseDivision / 60) % 60;
8612  
8613          if (showFrameCount) {
8614              seconds = timeBaseDivision % 60;
8615          } else {
8616              seconds = Math.floor(f / timeBase % 60).toFixed(secondsDecimalLength);
8617          }
8618      } else {
8619          hours = Math.floor(time / 3600) % 24;
8620          minutes = Math.floor(time / 60) % 60;
8621          if (showFrameCount) {
8622              seconds = Math.floor(time % 60);
8623          } else {
8624              seconds = Math.floor(time % 60).toFixed(secondsDecimalLength);
8625          }
8626      }
8627      hours = hours <= 0 ? 0 : hours;
8628      minutes = minutes <= 0 ? 0 : minutes;
8629      seconds = seconds <= 0 ? 0 : seconds;
8630  
8631      seconds = seconds === 60 ? 0 : seconds;
8632      minutes = minutes === 60 ? 0 : minutes;
8633  
8634      var timeFormatFrags = timeFormat.split(':');
8635      var timeFormatSettings = {};
8636      for (var i = 0, total = timeFormatFrags.length; i < total; ++i) {
8637          var unique = '';
8638          for (var j = 0, t = timeFormatFrags[i].length; j < t; j++) {
8639              if (unique.indexOf(timeFormatFrags[i][j]) < 0) {
8640                  unique += timeFormatFrags[i][j];
8641              }
8642          }
8643          if (~['f', 's', 'm', 'h'].indexOf(unique)) {
8644              timeFormatSettings[unique] = timeFormatFrags[i].length;
8645          }
8646      }
8647  
8648      var result = forceHours || hours > 0 ? (hours < 10 && timeFormatSettings.h > 1 ? '0' + hours : hours) + ':' : '';
8649      result += (minutes < 10 && timeFormatSettings.m > 1 ? '0' + minutes : minutes) + ':';
8650      result += '' + (seconds < 10 && timeFormatSettings.s > 1 ? '0' + seconds : seconds);
8651  
8652      if (showFrameCount) {
8653          frames = (f % timeBase).toFixed(0);
8654          frames = frames <= 0 ? 0 : frames;
8655          result += frames < 10 && timeFormatSettings.f ? frameSep + '0' + frames : '' + frameSep + frames;
8656      }
8657  
8658      return result;
8659  }
8660  
8661  function timeCodeToSeconds(time) {
8662      var fps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
8663  
8664  
8665      if (typeof time !== 'string') {
8666          throw new TypeError('Time must be a string');
8667      }
8668  
8669      if (time.indexOf(';') > 0) {
8670          time = time.replace(';', ':');
8671      }
8672  
8673      if (!/\d{2}(\:\d{2}){0,3}/i.test(time)) {
8674          throw new TypeError('Time code must have the format `00:00:00`');
8675      }
8676  
8677      var parts = time.split(':');
8678  
8679      var output = void 0,
8680          hours = 0,
8681          minutes = 0,
8682          seconds = 0,
8683          frames = 0,
8684          totalMinutes = 0,
8685          dropFrames = Math.round(fps * 0.066666),
8686          timeBase = Math.round(fps),
8687          hFrames = timeBase * 3600,
8688          mFrames = timeBase * 60;
8689  
8690      switch (parts.length) {
8691          default:
8692          case 1:
8693              seconds = parseInt(parts[0], 10);
8694              break;
8695          case 2:
8696              minutes = parseInt(parts[0], 10);
8697              seconds = parseInt(parts[1], 10);
8698              break;
8699          case 3:
8700              hours = parseInt(parts[0], 10);
8701              minutes = parseInt(parts[1], 10);
8702              seconds = parseInt(parts[2], 10);
8703              break;
8704          case 4:
8705              hours = parseInt(parts[0], 10);
8706              minutes = parseInt(parts[1], 10);
8707              seconds = parseInt(parts[2], 10);
8708              frames = parseInt(parts[3], 10);
8709              break;
8710      }
8711  
8712      if (isDropFrame(fps)) {
8713          totalMinutes = 60 * hours + minutes;
8714          output = hFrames * hours + mFrames * minutes + timeBase * seconds + frames - dropFrames * (totalMinutes - Math.floor(totalMinutes / 10));
8715      } else {
8716          output = (hFrames * hours + mFrames * minutes + fps * seconds + frames) / fps;
8717      }
8718  
8719      return parseFloat(output.toFixed(3));
8720  }
8721  
8722  function calculateTimeFormat(time, options) {
8723      var fps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 25;
8724  
8725  
8726      time = !time || typeof time !== 'number' || time < 0 ? 0 : time;
8727  
8728      var hours = Math.floor(time / 3600) % 24,
8729          minutes = Math.floor(time / 60) % 60,
8730          seconds = Math.floor(time % 60),
8731          frames = Math.floor((time % 1 * fps).toFixed(3)),
8732          lis = [[frames, 'f'], [seconds, 's'], [minutes, 'm'], [hours, 'h']];
8733  
8734      var format = options.timeFormat,
8735          firstTwoPlaces = format[1] === format[0],
8736          separatorIndex = firstTwoPlaces ? 2 : 1,
8737          separator = format.length < separatorIndex ? format[separatorIndex] : ':',
8738          firstChar = format[0],
8739          required = false;
8740  
8741      for (var i = 0, len = lis.length; i < len; i++) {
8742          if (~format.indexOf(lis[i][1])) {
8743              required = true;
8744          } else if (required) {
8745              var hasNextValue = false;
8746              for (var j = i; j < len; j++) {
8747                  if (lis[j][0] > 0) {
8748                      hasNextValue = true;
8749                      break;
8750                  }
8751              }
8752  
8753              if (!hasNextValue) {
8754                  break;
8755              }
8756  
8757              if (!firstTwoPlaces) {
8758                  format = firstChar + format;
8759              }
8760              format = lis[i][1] + separator + format;
8761              if (firstTwoPlaces) {
8762                  format = lis[i][1] + format;
8763              }
8764              firstChar = lis[i][1];
8765          }
8766      }
8767  
8768      options.timeFormat = format;
8769  }
8770  
8771  function convertSMPTEtoSeconds(SMPTE) {
8772  
8773      if (typeof SMPTE !== 'string') {
8774          throw new TypeError('Argument must be a string value');
8775      }
8776  
8777      SMPTE = SMPTE.replace(',', '.');
8778  
8779      var decimalLen = ~SMPTE.indexOf('.') ? SMPTE.split('.')[1].length : 0;
8780  
8781      var secs = 0,
8782          multiplier = 1;
8783  
8784      SMPTE = SMPTE.split(':').reverse();
8785  
8786      for (var i = 0, total = SMPTE.length; i < total; i++) {
8787          multiplier = 1;
8788          if (i > 0) {
8789              multiplier = Math.pow(60, i);
8790          }
8791          secs += Number(SMPTE[i]) * multiplier;
8792      }
8793      return Number(secs.toFixed(decimalLen));
8794  }
8795  
8796  _mejs2.default.Utils = _mejs2.default.Utils || {};
8797  _mejs2.default.Utils.secondsToTimeCode = secondsToTimeCode;
8798  _mejs2.default.Utils.timeCodeToSeconds = timeCodeToSeconds;
8799  _mejs2.default.Utils.calculateTimeFormat = calculateTimeFormat;
8800  _mejs2.default.Utils.convertSMPTEtoSeconds = convertSMPTEtoSeconds;
8801  
8802  },{"9":9}]},{},[31,8,7,17,25,22,21,23,24,26,18,20,19,11,12,13,14,15,16]);


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