[ Index ]

PHP Cross Reference of WordPress

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