[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  /*!
   2   * MediaElement.js
   3   * http://www.mediaelementjs.com/
   4   *
   5   * Wrapper that mimics native HTML5 MediaElement (audio and video)
   6   * using a variety of technologies (pure JavaScript, Flash, iframe)
   7   *
   8   * Copyright 2010-2017, John Dyer (http://j.hn/)
   9   * License: MIT
  10   *
  11   */(function 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_(9);
 300  
 301  var _general = _dereq_(18);
 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}((\-|_)[a-z]{2})?)|([a-z]{3}))$/i.test(args[0])) {
 319              throw new TypeError('Language code must have format `xx`, `xxx`, `xx_XX` or `xx-xx`');
 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  },{"18":18,"7":7,"9":9}],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_(18);
 575  
 576  var _media2 = _dereq_(19);
 577  
 578  var _renderer = _dereq_(8);
 579  
 580  var _constants = _dereq_(16);
 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  },{"16":16,"18":18,"19":19,"2":2,"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  Object.defineProperty(exports, "__esModule", {
1146      value: true
1147  });
1148  var EN = exports.EN = {
1149      'mejs.plural-form': 1,
1150  
1151      'mejs.download-file': 'Download File',
1152  
1153      '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/',
1154  
1155      'mejs.fullscreen': 'Fullscreen',
1156  
1157      'mejs.play': 'Play',
1158      'mejs.pause': 'Pause',
1159  
1160      'mejs.time-slider': 'Time Slider',
1161      'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.',
1162      'mejs.live-broadcast': 'Live Broadcast',
1163  
1164      'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.',
1165      'mejs.unmute': 'Unmute',
1166      'mejs.mute': 'Mute',
1167      'mejs.volume-slider': 'Volume Slider',
1168  
1169      'mejs.video-player': 'Video Player',
1170      'mejs.audio-player': 'Audio Player',
1171  
1172      'mejs.captions-subtitles': 'Captions/Subtitles',
1173      'mejs.captions-chapters': 'Chapters',
1174      'mejs.none': 'None',
1175      'mejs.afrikaans': 'Afrikaans',
1176      'mejs.albanian': 'Albanian',
1177      'mejs.arabic': 'Arabic',
1178      'mejs.belarusian': 'Belarusian',
1179      'mejs.bulgarian': 'Bulgarian',
1180      'mejs.catalan': 'Catalan',
1181      'mejs.chinese': 'Chinese',
1182      'mejs.chinese-simplified': 'Chinese (Simplified)',
1183      'mejs.chinese-traditional': 'Chinese (Traditional)',
1184      'mejs.croatian': 'Croatian',
1185      'mejs.czech': 'Czech',
1186      'mejs.danish': 'Danish',
1187      'mejs.dutch': 'Dutch',
1188      'mejs.english': 'English',
1189      'mejs.estonian': 'Estonian',
1190      'mejs.filipino': 'Filipino',
1191      'mejs.finnish': 'Finnish',
1192      'mejs.french': 'French',
1193      'mejs.galician': 'Galician',
1194      'mejs.german': 'German',
1195      'mejs.greek': 'Greek',
1196      'mejs.haitian-creole': 'Haitian Creole',
1197      'mejs.hebrew': 'Hebrew',
1198      'mejs.hindi': 'Hindi',
1199      'mejs.hungarian': 'Hungarian',
1200      'mejs.icelandic': 'Icelandic',
1201      'mejs.indonesian': 'Indonesian',
1202      'mejs.irish': 'Irish',
1203      'mejs.italian': 'Italian',
1204      'mejs.japanese': 'Japanese',
1205      'mejs.korean': 'Korean',
1206      'mejs.latvian': 'Latvian',
1207      'mejs.lithuanian': 'Lithuanian',
1208      'mejs.macedonian': 'Macedonian',
1209      'mejs.malay': 'Malay',
1210      'mejs.maltese': 'Maltese',
1211      'mejs.norwegian': 'Norwegian',
1212      'mejs.persian': 'Persian',
1213      'mejs.polish': 'Polish',
1214      'mejs.portuguese': 'Portuguese',
1215      'mejs.romanian': 'Romanian',
1216      'mejs.russian': 'Russian',
1217      'mejs.serbian': 'Serbian',
1218      'mejs.slovak': 'Slovak',
1219      'mejs.slovenian': 'Slovenian',
1220      'mejs.spanish': 'Spanish',
1221      'mejs.swahili': 'Swahili',
1222      'mejs.swedish': 'Swedish',
1223      'mejs.tagalog': 'Tagalog',
1224      'mejs.thai': 'Thai',
1225      'mejs.turkish': 'Turkish',
1226      'mejs.ukrainian': 'Ukrainian',
1227      'mejs.vietnamese': 'Vietnamese',
1228      'mejs.welsh': 'Welsh',
1229      'mejs.yiddish': 'Yiddish'
1230  };
1231  
1232  },{}],10:[function(_dereq_,module,exports){
1233  'use strict';
1234  
1235  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; };
1236  
1237  var _window = _dereq_(3);
1238  
1239  var _window2 = _interopRequireDefault(_window);
1240  
1241  var _mejs = _dereq_(7);
1242  
1243  var _mejs2 = _interopRequireDefault(_mejs);
1244  
1245  var _renderer = _dereq_(8);
1246  
1247  var _general = _dereq_(18);
1248  
1249  var _media = _dereq_(19);
1250  
1251  var _constants = _dereq_(16);
1252  
1253  var _dom = _dereq_(17);
1254  
1255  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1256  
1257  var NativeDash = {
1258  
1259      promise: null,
1260  
1261      load: function load(settings) {
1262          if (typeof dashjs !== 'undefined') {
1263              NativeDash.promise = new Promise(function (resolve) {
1264                  resolve();
1265              }).then(function () {
1266                  NativeDash._createPlayer(settings);
1267              });
1268          } else {
1269              settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js';
1270  
1271              NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path);
1272              NativeDash.promise.then(function () {
1273                  NativeDash._createPlayer(settings);
1274              });
1275          }
1276  
1277          return NativeDash.promise;
1278      },
1279  
1280      _createPlayer: function _createPlayer(settings) {
1281          var player = dashjs.MediaPlayer().create();
1282          _window2.default['__ready__' + settings.id](player);
1283          return player;
1284      }
1285  };
1286  
1287  var DashNativeRenderer = {
1288      name: 'native_dash',
1289      options: {
1290          prefix: 'native_dash',
1291          dash: {
1292              path: 'https://cdn.dashjs.org/latest/dash.all.min.js',
1293              debug: false,
1294              drm: {},
1295  
1296              robustnessLevel: ''
1297          }
1298      },
1299  
1300      canPlayType: function canPlayType(type) {
1301          return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1;
1302      },
1303  
1304      create: function create(mediaElement, options, mediaFiles) {
1305  
1306          var originalNode = mediaElement.originalNode,
1307              id = mediaElement.id + '_' + options.prefix,
1308              autoplay = originalNode.autoplay,
1309              children = originalNode.children;
1310  
1311          var node = null,
1312              dashPlayer = null;
1313  
1314          originalNode.removeAttribute('type');
1315          for (var i = 0, total = children.length; i < total; i++) {
1316              children[i].removeAttribute('type');
1317          }
1318  
1319          node = originalNode.cloneNode(true);
1320          options = Object.assign(options, mediaElement.options);
1321  
1322          var props = _mejs2.default.html5media.properties,
1323              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']),
1324              attachNativeEvents = function attachNativeEvents(e) {
1325              if (e.type !== 'error') {
1326                  var _event = (0, _general.createEvent)(e.type, mediaElement);
1327                  mediaElement.dispatchEvent(_event);
1328              }
1329          },
1330              assignGettersSetters = function assignGettersSetters(propName) {
1331              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
1332  
1333              node['get' + capName] = function () {
1334                  return dashPlayer !== null ? node[propName] : null;
1335              };
1336  
1337              node['set' + capName] = function (value) {
1338                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
1339                      if (propName === 'src') {
1340                          var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
1341                          node[propName] = source;
1342                          if (dashPlayer !== null) {
1343                              dashPlayer.reset();
1344                              for (var _i = 0, _total = events.length; _i < _total; _i++) {
1345                                  node.removeEventListener(events[_i], attachNativeEvents);
1346                              }
1347                              dashPlayer = NativeDash._createPlayer({
1348                                  options: options.dash,
1349                                  id: id
1350                              });
1351  
1352                              if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') {
1353                                  dashPlayer.setProtectionData(value.drm);
1354                                  if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
1355                                      dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
1356                                  }
1357                              }
1358                              dashPlayer.attachSource(source);
1359                              if (autoplay) {
1360                                  dashPlayer.play();
1361                              }
1362                          }
1363                      } else {
1364                          node[propName] = value;
1365                      }
1366                  }
1367              };
1368          };
1369  
1370          for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) {
1371              assignGettersSetters(props[_i2]);
1372          }
1373  
1374          _window2.default['__ready__' + id] = function (_dashPlayer) {
1375              mediaElement.dashPlayer = dashPlayer = _dashPlayer;
1376  
1377              var dashEvents = dashjs.MediaPlayer.events,
1378                  assignEvents = function assignEvents(eventName) {
1379                  if (eventName === 'loadedmetadata') {
1380                      dashPlayer.getDebug().setLogToBrowserConsole(options.dash.debug);
1381                      dashPlayer.initialize();
1382                      dashPlayer.setScheduleWhilePaused(false);
1383                      dashPlayer.setFastSwitchEnabled(true);
1384                      dashPlayer.attachView(node);
1385                      dashPlayer.setAutoPlay(false);
1386  
1387                      if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) {
1388                          dashPlayer.setProtectionData(options.dash.drm);
1389                          if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
1390                              dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
1391                          }
1392                      }
1393                      dashPlayer.attachSource(node.getSrc());
1394                  }
1395  
1396                  node.addEventListener(eventName, attachNativeEvents);
1397              };
1398  
1399              for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
1400                  assignEvents(events[_i3]);
1401              }
1402  
1403              var assignMdashEvents = function assignMdashEvents(name, data) {
1404                  if (name.toLowerCase() === 'error') {
1405                      mediaElement.generateError(data.message, node.src);
1406                      console.error(data);
1407                  } else {
1408                      var _event2 = (0, _general.createEvent)(name, mediaElement);
1409                      _event2.data = data;
1410                      mediaElement.dispatchEvent(_event2);
1411                  }
1412              };
1413  
1414              for (var eventType in dashEvents) {
1415                  if (dashEvents.hasOwnProperty(eventType)) {
1416                      dashPlayer.on(dashEvents[eventType], function (e) {
1417                          for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1418                              args[_key - 1] = arguments[_key];
1419                          }
1420  
1421                          return assignMdashEvents(e.type, args);
1422                      });
1423                  }
1424              }
1425          };
1426  
1427          if (mediaFiles && mediaFiles.length > 0) {
1428              for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
1429                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
1430                      node.setAttribute('src', mediaFiles[_i4].src);
1431                      if (typeof mediaFiles[_i4].drm !== 'undefined') {
1432                          options.dash.drm = mediaFiles[_i4].drm;
1433                      }
1434                      break;
1435                  }
1436              }
1437          }
1438  
1439          node.setAttribute('id', id);
1440  
1441          originalNode.parentNode.insertBefore(node, originalNode);
1442          originalNode.autoplay = false;
1443          originalNode.style.display = 'none';
1444  
1445          node.setSize = function (width, height) {
1446              node.style.width = width + 'px';
1447              node.style.height = height + 'px';
1448              return node;
1449          };
1450  
1451          node.hide = function () {
1452              node.pause();
1453              node.style.display = 'none';
1454              return node;
1455          };
1456  
1457          node.show = function () {
1458              node.style.display = '';
1459              return node;
1460          };
1461  
1462          node.destroy = function () {
1463              if (dashPlayer !== null) {
1464                  dashPlayer.reset();
1465              }
1466          };
1467  
1468          var event = (0, _general.createEvent)('rendererready', node);
1469          mediaElement.dispatchEvent(event);
1470  
1471          mediaElement.promises.push(NativeDash.load({
1472              options: options.dash,
1473              id: id
1474          }));
1475  
1476          return node;
1477      }
1478  };
1479  
1480  _media.typeChecks.push(function (url) {
1481      return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null;
1482  });
1483  
1484  _renderer.renderer.add(DashNativeRenderer);
1485  
1486  },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],11:[function(_dereq_,module,exports){
1487  'use strict';
1488  
1489  Object.defineProperty(exports, "__esModule", {
1490      value: true
1491  });
1492  exports.PluginDetector = undefined;
1493  
1494  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; };
1495  
1496  var _window = _dereq_(3);
1497  
1498  var _window2 = _interopRequireDefault(_window);
1499  
1500  var _document = _dereq_(2);
1501  
1502  var _document2 = _interopRequireDefault(_document);
1503  
1504  var _mejs = _dereq_(7);
1505  
1506  var _mejs2 = _interopRequireDefault(_mejs);
1507  
1508  var _i18n = _dereq_(5);
1509  
1510  var _i18n2 = _interopRequireDefault(_i18n);
1511  
1512  var _renderer = _dereq_(8);
1513  
1514  var _general = _dereq_(18);
1515  
1516  var _constants = _dereq_(16);
1517  
1518  var _media = _dereq_(19);
1519  
1520  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1521  
1522  var PluginDetector = exports.PluginDetector = {
1523      plugins: [],
1524  
1525      hasPluginVersion: function hasPluginVersion(plugin, v) {
1526          var pv = PluginDetector.plugins[plugin];
1527          v[1] = v[1] || 0;
1528          v[2] = v[2] || 0;
1529          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];
1530      },
1531  
1532      addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) {
1533          PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect);
1534      },
1535  
1536      detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) {
1537  
1538          var version = [0, 0, 0],
1539              description = void 0,
1540              ax = void 0;
1541  
1542          if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') {
1543              description = _constants.NAV.plugins[pluginName].description;
1544              if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) {
1545                  version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.');
1546                  for (var i = 0, total = version.length; i < total; i++) {
1547                      version[i] = parseInt(version[i].match(/\d+/), 10);
1548                  }
1549              }
1550          } else if (_window2.default.ActiveXObject !== undefined) {
1551              try {
1552                  ax = new ActiveXObject(activeX);
1553                  if (ax) {
1554                      version = axDetect(ax);
1555                  }
1556              } catch (e) {
1557                  
1558              }
1559          }
1560          return version;
1561      }
1562  };
1563  
1564  PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) {
1565      var version = [],
1566          d = ax.GetVariable("$version");
1567  
1568      if (d) {
1569          d = d.split(" ")[1].split(",");
1570          version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
1571      }
1572      return version;
1573  });
1574  
1575  var FlashMediaElementRenderer = {
1576      create: function create(mediaElement, options, mediaFiles) {
1577  
1578          var flash = {};
1579          var isActive = false;
1580  
1581          flash.options = options;
1582          flash.id = mediaElement.id + '_' + flash.options.prefix;
1583          flash.mediaElement = mediaElement;
1584          flash.flashState = {};
1585          flash.flashApi = null;
1586          flash.flashApiStack = [];
1587  
1588          var props = _mejs2.default.html5media.properties,
1589              assignGettersSetters = function assignGettersSetters(propName) {
1590              flash.flashState[propName] = null;
1591  
1592              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
1593  
1594              flash['get' + capName] = function () {
1595                  if (flash.flashApi !== null) {
1596                      if (typeof flash.flashApi['get_' + propName] === 'function') {
1597                          var value = flash.flashApi['get_' + propName]();
1598  
1599                          if (propName === 'buffered') {
1600                              return {
1601                                  start: function start() {
1602                                      return 0;
1603                                  },
1604                                  end: function end() {
1605                                      return value;
1606                                  },
1607                                  length: 1
1608                              };
1609                          }
1610                          return value;
1611                      } else {
1612                          return null;
1613                      }
1614                  } else {
1615                      return null;
1616                  }
1617              };
1618  
1619              flash['set' + capName] = function (value) {
1620                  if (propName === 'src') {
1621                      value = (0, _media.absolutizeUrl)(value);
1622                  }
1623  
1624                  if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) {
1625                      try {
1626                          flash.flashApi['set_' + propName](value);
1627                      } catch (e) {
1628                          
1629                      }
1630                  } else {
1631                      flash.flashApiStack.push({
1632                          type: 'set',
1633                          propName: propName,
1634                          value: value
1635                      });
1636                  }
1637              };
1638          };
1639  
1640          for (var i = 0, total = props.length; i < total; i++) {
1641              assignGettersSetters(props[i]);
1642          }
1643  
1644          var methods = _mejs2.default.html5media.methods,
1645              assignMethods = function assignMethods(methodName) {
1646              flash[methodName] = function () {
1647                  if (isActive) {
1648                      if (flash.flashApi !== null) {
1649                          if (flash.flashApi['fire_' + methodName]) {
1650                              try {
1651                                  flash.flashApi['fire_' + methodName]();
1652                              } catch (e) {
1653                                  
1654                              }
1655                          } else {
1656                              
1657                          }
1658                      } else {
1659                          flash.flashApiStack.push({
1660                              type: 'call',
1661                              methodName: methodName
1662                          });
1663                      }
1664                  }
1665              };
1666          };
1667          methods.push('stop');
1668          for (var _i = 0, _total = methods.length; _i < _total; _i++) {
1669              assignMethods(methods[_i]);
1670          }
1671  
1672          var initEvents = ['rendererready'];
1673  
1674          for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) {
1675              var event = (0, _general.createEvent)(initEvents[_i2], flash);
1676              mediaElement.dispatchEvent(event);
1677          }
1678  
1679          _window2.default['__ready__' + flash.id] = function () {
1680  
1681              flash.flashReady = true;
1682              flash.flashApi = _document2.default.getElementById('__' + flash.id);
1683  
1684              if (flash.flashApiStack.length) {
1685                  for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) {
1686                      var stackItem = flash.flashApiStack[_i3];
1687  
1688                      if (stackItem.type === 'set') {
1689                          var propName = stackItem.propName,
1690                              capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
1691  
1692                          flash['set' + capName](stackItem.value);
1693                      } else if (stackItem.type === 'call') {
1694                          flash[stackItem.methodName]();
1695                      }
1696                  }
1697              }
1698          };
1699  
1700          _window2.default['__event__' + flash.id] = function (eventName, message) {
1701              var event = (0, _general.createEvent)(eventName, flash);
1702              if (message) {
1703                  try {
1704                      event.data = JSON.parse(message);
1705                      event.details.data = JSON.parse(message);
1706                  } catch (e) {
1707                      event.message = message;
1708                  }
1709              }
1710  
1711              flash.mediaElement.dispatchEvent(event);
1712          };
1713  
1714          flash.flashWrapper = _document2.default.createElement('div');
1715  
1716          if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) {
1717              flash.options.shimScriptAccess = 'sameDomain';
1718          }
1719  
1720          var autoplay = mediaElement.originalNode.autoplay,
1721              flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')],
1722              isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video',
1723              flashHeight = isVideo ? mediaElement.originalNode.height : 1,
1724              flashWidth = isVideo ? mediaElement.originalNode.width : 1;
1725  
1726          if (mediaElement.originalNode.getAttribute('src')) {
1727              flashVars.push('src=' + mediaElement.originalNode.getAttribute('src'));
1728          }
1729  
1730          if (flash.options.enablePseudoStreaming === true) {
1731              flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam);
1732              flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType);
1733          }
1734  
1735          if (flash.options.streamDelimiter) {
1736              flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter));
1737          }
1738  
1739          if (flash.options.proxyType) {
1740              flashVars.push('proxytype=' + flash.options.proxyType);
1741          }
1742  
1743          mediaElement.appendChild(flash.flashWrapper);
1744          mediaElement.originalNode.style.display = 'none';
1745  
1746          var settings = [];
1747  
1748          if (_constants.IS_IE || _constants.IS_EDGE) {
1749              var specialIEContainer = _document2.default.createElement('div');
1750              flash.flashWrapper.appendChild(specialIEContainer);
1751  
1752              if (_constants.IS_EDGE) {
1753                  settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"'];
1754              } else {
1755                  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 + '"'];
1756              }
1757  
1758              if (!isVideo) {
1759                  settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
1760              }
1761  
1762              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>';
1763          } else {
1764  
1765              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('&') + '"'];
1766  
1767              if (isVideo) {
1768                  settings.push('width="' + flashWidth + '"');
1769                  settings.push('height="' + flashHeight + '"');
1770              } else {
1771                  settings.push('style="position: fixed; left: -9999em; top: -9999em;"');
1772              }
1773  
1774              flash.flashWrapper.innerHTML = '<embed ' + settings.join(' ') + '>';
1775          }
1776  
1777          flash.flashNode = flash.flashWrapper.lastChild;
1778  
1779          flash.hide = function () {
1780              isActive = false;
1781              if (isVideo) {
1782                  flash.flashNode.style.display = 'none';
1783              }
1784          };
1785          flash.show = function () {
1786              isActive = true;
1787              if (isVideo) {
1788                  flash.flashNode.style.display = '';
1789              }
1790          };
1791          flash.setSize = function (width, height) {
1792              flash.flashNode.style.width = width + 'px';
1793              flash.flashNode.style.height = height + 'px';
1794  
1795              if (flash.flashApi !== null && typeof flash.flashApi.fire_setSize === 'function') {
1796                  flash.flashApi.fire_setSize(width, height);
1797              }
1798          };
1799  
1800          flash.destroy = function () {
1801              flash.flashNode.remove();
1802          };
1803  
1804          if (mediaFiles && mediaFiles.length > 0) {
1805              for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
1806                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
1807                      flash.setSrc(mediaFiles[_i4].src);
1808                      break;
1809                  }
1810              }
1811          }
1812  
1813          return flash;
1814      }
1815  };
1816  
1817  var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]);
1818  
1819  if (hasFlash) {
1820      _media.typeChecks.push(function (url) {
1821          url = url.toLowerCase();
1822  
1823          if (url.startsWith('rtmp')) {
1824              if (~url.indexOf('.mp3')) {
1825                  return 'audio/rtmp';
1826              } else {
1827                  return 'video/rtmp';
1828              }
1829          } else if (/\.og(a|g)/i.test(url)) {
1830              return 'audio/ogg';
1831          } else if (~url.indexOf('.m3u8')) {
1832              return 'application/x-mpegURL';
1833          } else if (~url.indexOf('.mpd')) {
1834              return 'application/dash+xml';
1835          } else if (~url.indexOf('.flv')) {
1836              return 'video/flv';
1837          } else {
1838              return null;
1839          }
1840      });
1841  
1842      var FlashMediaElementVideoRenderer = {
1843          name: 'flash_video',
1844          options: {
1845              prefix: 'flash_video',
1846              filename: 'mediaelement-flash-video.swf',
1847              enablePseudoStreaming: false,
1848  
1849              pseudoStreamingStartQueryParam: 'start',
1850  
1851              pseudoStreamingType: 'byte',
1852  
1853              proxyType: '',
1854  
1855              streamDelimiter: ''
1856          },
1857  
1858          canPlayType: function canPlayType(type) {
1859              return ~['video/mp4', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4', 'video/flv', 'video/x-flv'].indexOf(type.toLowerCase());
1860          },
1861  
1862          create: FlashMediaElementRenderer.create
1863  
1864      };
1865      _renderer.renderer.add(FlashMediaElementVideoRenderer);
1866  
1867      var FlashMediaElementHlsVideoRenderer = {
1868          name: 'flash_hls',
1869          options: {
1870              prefix: 'flash_hls',
1871              filename: 'mediaelement-flash-video-hls.swf'
1872          },
1873  
1874          canPlayType: function canPlayType(type) {
1875              return ~['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase());
1876          },
1877  
1878          create: FlashMediaElementRenderer.create
1879      };
1880      _renderer.renderer.add(FlashMediaElementHlsVideoRenderer);
1881  
1882      var FlashMediaElementMdashVideoRenderer = {
1883          name: 'flash_dash',
1884          options: {
1885              prefix: 'flash_dash',
1886              filename: 'mediaelement-flash-video-mdash.swf'
1887          },
1888  
1889          canPlayType: function canPlayType(type) {
1890              return ~['application/dash+xml'].indexOf(type.toLowerCase());
1891          },
1892  
1893          create: FlashMediaElementRenderer.create
1894      };
1895      _renderer.renderer.add(FlashMediaElementMdashVideoRenderer);
1896  
1897      var FlashMediaElementAudioRenderer = {
1898          name: 'flash_audio',
1899          options: {
1900              prefix: 'flash_audio',
1901              filename: 'mediaelement-flash-audio.swf'
1902          },
1903  
1904          canPlayType: function canPlayType(type) {
1905              return ~['audio/mp3'].indexOf(type.toLowerCase());
1906          },
1907  
1908          create: FlashMediaElementRenderer.create
1909      };
1910      _renderer.renderer.add(FlashMediaElementAudioRenderer);
1911  
1912      var FlashMediaElementAudioOggRenderer = {
1913          name: 'flash_audio_ogg',
1914          options: {
1915              prefix: 'flash_audio_ogg',
1916              filename: 'mediaelement-flash-audio-ogg.swf'
1917          },
1918  
1919          canPlayType: function canPlayType(type) {
1920              return ~['audio/ogg', 'audio/oga', 'audio/ogv'].indexOf(type.toLowerCase());
1921          },
1922  
1923          create: FlashMediaElementRenderer.create
1924      };
1925      _renderer.renderer.add(FlashMediaElementAudioOggRenderer);
1926  }
1927  
1928  },{"16":16,"18":18,"19":19,"2":2,"3":3,"5":5,"7":7,"8":8}],12:[function(_dereq_,module,exports){
1929  'use strict';
1930  
1931  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; };
1932  
1933  var _window = _dereq_(3);
1934  
1935  var _window2 = _interopRequireDefault(_window);
1936  
1937  var _mejs = _dereq_(7);
1938  
1939  var _mejs2 = _interopRequireDefault(_mejs);
1940  
1941  var _renderer = _dereq_(8);
1942  
1943  var _general = _dereq_(18);
1944  
1945  var _constants = _dereq_(16);
1946  
1947  var _media = _dereq_(19);
1948  
1949  var _dom = _dereq_(17);
1950  
1951  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1952  
1953  var NativeFlv = {
1954  
1955      promise: null,
1956  
1957      load: function load(settings) {
1958          if (typeof flvjs !== 'undefined') {
1959              NativeFlv.promise = new Promise(function (resolve) {
1960                  resolve();
1961              }).then(function () {
1962                  NativeFlv._createPlayer(settings);
1963              });
1964          } else {
1965              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';
1966  
1967              NativeFlv.promise = NativeFlv.promise || (0, _dom.loadScript)(settings.options.path);
1968              NativeFlv.promise.then(function () {
1969                  NativeFlv._createPlayer(settings);
1970              });
1971          }
1972  
1973          return NativeFlv.promise;
1974      },
1975  
1976      _createPlayer: function _createPlayer(settings) {
1977          flvjs.LoggingControl.enableDebug = settings.options.debug;
1978          flvjs.LoggingControl.enableVerbose = settings.options.debug;
1979          var player = flvjs.createPlayer(settings.options, settings.configs);
1980          _window2.default['__ready__' + settings.id](player);
1981          return player;
1982      }
1983  };
1984  
1985  var FlvNativeRenderer = {
1986      name: 'native_flv',
1987      options: {
1988          prefix: 'native_flv',
1989          flv: {
1990              path: 'https://cdnjs.cloudflare.com/ajax/libs/flv.js/1.3.3/flv.min.js',
1991  
1992              cors: true,
1993              debug: false
1994          }
1995      },
1996  
1997      canPlayType: function canPlayType(type) {
1998          return _constants.HAS_MSE && ['video/x-flv', 'video/flv'].indexOf(type.toLowerCase()) > -1;
1999      },
2000  
2001      create: function create(mediaElement, options, mediaFiles) {
2002  
2003          var originalNode = mediaElement.originalNode,
2004              id = mediaElement.id + '_' + options.prefix;
2005  
2006          var node = null,
2007              flvPlayer = null;
2008  
2009          node = originalNode.cloneNode(true);
2010          options = Object.assign(options, mediaElement.options);
2011  
2012          var props = _mejs2.default.html5media.properties,
2013              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']),
2014              attachNativeEvents = function attachNativeEvents(e) {
2015              if (e.type !== 'error') {
2016                  var _event = (0, _general.createEvent)(e.type, mediaElement);
2017                  mediaElement.dispatchEvent(_event);
2018              }
2019          },
2020              assignGettersSetters = function assignGettersSetters(propName) {
2021              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2022  
2023              node['get' + capName] = function () {
2024                  return flvPlayer !== null ? node[propName] : null;
2025              };
2026  
2027              node['set' + capName] = function (value) {
2028                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
2029                      if (propName === 'src') {
2030                          node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
2031                          if (flvPlayer !== null) {
2032                              var _flvOptions = {};
2033                              _flvOptions.type = 'flv';
2034                              _flvOptions.url = value;
2035                              _flvOptions.cors = options.flv.cors;
2036                              _flvOptions.debug = options.flv.debug;
2037                              _flvOptions.path = options.flv.path;
2038                              var _flvConfigs = options.flv.configs;
2039  
2040                              flvPlayer.destroy();
2041                              for (var i = 0, total = events.length; i < total; i++) {
2042                                  node.removeEventListener(events[i], attachNativeEvents);
2043                              }
2044                              flvPlayer = NativeFlv._createPlayer({
2045                                  options: _flvOptions,
2046                                  configs: _flvConfigs,
2047                                  id: id
2048                              });
2049                              flvPlayer.attachMediaElement(node);
2050                              flvPlayer.load();
2051                          }
2052                      } else {
2053                          node[propName] = value;
2054                      }
2055                  }
2056              };
2057          };
2058  
2059          for (var i = 0, total = props.length; i < total; i++) {
2060              assignGettersSetters(props[i]);
2061          }
2062  
2063          _window2.default['__ready__' + id] = function (_flvPlayer) {
2064              mediaElement.flvPlayer = flvPlayer = _flvPlayer;
2065  
2066              var flvEvents = flvjs.Events,
2067                  assignEvents = function assignEvents(eventName) {
2068                  if (eventName === 'loadedmetadata') {
2069                      flvPlayer.unload();
2070                      flvPlayer.detachMediaElement();
2071                      flvPlayer.attachMediaElement(node);
2072                      flvPlayer.load();
2073                  }
2074  
2075                  node.addEventListener(eventName, attachNativeEvents);
2076              };
2077  
2078              for (var _i = 0, _total = events.length; _i < _total; _i++) {
2079                  assignEvents(events[_i]);
2080              }
2081  
2082              var assignFlvEvents = function assignFlvEvents(name, data) {
2083                  if (name === 'error') {
2084                      var message = data[0] + ': ' + data[1] + ' ' + data[2].msg;
2085                      mediaElement.generateError(message, node.src);
2086                  } else {
2087                      var _event2 = (0, _general.createEvent)(name, mediaElement);
2088                      _event2.data = data;
2089                      mediaElement.dispatchEvent(_event2);
2090                  }
2091              };
2092  
2093              var _loop = function _loop(eventType) {
2094                  if (flvEvents.hasOwnProperty(eventType)) {
2095                      flvPlayer.on(flvEvents[eventType], function () {
2096                          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
2097                              args[_key] = arguments[_key];
2098                          }
2099  
2100                          return assignFlvEvents(flvEvents[eventType], args);
2101                      });
2102                  }
2103              };
2104  
2105              for (var eventType in flvEvents) {
2106                  _loop(eventType);
2107              }
2108          };
2109  
2110          if (mediaFiles && mediaFiles.length > 0) {
2111              for (var _i2 = 0, _total2 = mediaFiles.length; _i2 < _total2; _i2++) {
2112                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i2].type)) {
2113                      node.setAttribute('src', mediaFiles[_i2].src);
2114                      break;
2115                  }
2116              }
2117          }
2118  
2119          node.setAttribute('id', id);
2120  
2121          originalNode.parentNode.insertBefore(node, originalNode);
2122          originalNode.autoplay = false;
2123          originalNode.style.display = 'none';
2124  
2125          var flvOptions = {};
2126          flvOptions.type = 'flv';
2127          flvOptions.url = node.src;
2128          flvOptions.cors = options.flv.cors;
2129          flvOptions.debug = options.flv.debug;
2130          flvOptions.path = options.flv.path;
2131          var flvConfigs = options.flv.configs;
2132  
2133          node.setSize = function (width, height) {
2134              node.style.width = width + 'px';
2135              node.style.height = height + 'px';
2136              return node;
2137          };
2138  
2139          node.hide = function () {
2140              if (flvPlayer !== null) {
2141                  flvPlayer.pause();
2142              }
2143              node.style.display = 'none';
2144              return node;
2145          };
2146  
2147          node.show = function () {
2148              node.style.display = '';
2149              return node;
2150          };
2151  
2152          node.destroy = function () {
2153              if (flvPlayer !== null) {
2154                  flvPlayer.destroy();
2155              }
2156          };
2157  
2158          var event = (0, _general.createEvent)('rendererready', node);
2159          mediaElement.dispatchEvent(event);
2160  
2161          mediaElement.promises.push(NativeFlv.load({
2162              options: flvOptions,
2163              configs: flvConfigs,
2164              id: id
2165          }));
2166  
2167          return node;
2168      }
2169  };
2170  
2171  _media.typeChecks.push(function (url) {
2172      return ~url.toLowerCase().indexOf('.flv') ? 'video/flv' : null;
2173  });
2174  
2175  _renderer.renderer.add(FlvNativeRenderer);
2176  
2177  },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],13:[function(_dereq_,module,exports){
2178  'use strict';
2179  
2180  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; };
2181  
2182  var _window = _dereq_(3);
2183  
2184  var _window2 = _interopRequireDefault(_window);
2185  
2186  var _mejs = _dereq_(7);
2187  
2188  var _mejs2 = _interopRequireDefault(_mejs);
2189  
2190  var _renderer = _dereq_(8);
2191  
2192  var _general = _dereq_(18);
2193  
2194  var _constants = _dereq_(16);
2195  
2196  var _media = _dereq_(19);
2197  
2198  var _dom = _dereq_(17);
2199  
2200  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2201  
2202  var NativeHls = {
2203  
2204      promise: null,
2205  
2206      load: function load(settings) {
2207          if (typeof Hls !== 'undefined') {
2208              NativeHls.promise = new Promise(function (resolve) {
2209                  resolve();
2210              }).then(function () {
2211                  NativeHls._createPlayer(settings);
2212              });
2213          } else {
2214              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';
2215  
2216              NativeHls.promise = NativeHls.promise || (0, _dom.loadScript)(settings.options.path);
2217              NativeHls.promise.then(function () {
2218                  NativeHls._createPlayer(settings);
2219              });
2220          }
2221  
2222          return NativeHls.promise;
2223      },
2224  
2225      _createPlayer: function _createPlayer(settings) {
2226          var player = new Hls(settings.options);
2227          _window2.default['__ready__' + settings.id](player);
2228          return player;
2229      }
2230  };
2231  
2232  var HlsNativeRenderer = {
2233      name: 'native_hls',
2234      options: {
2235          prefix: 'native_hls',
2236          hls: {
2237              path: 'https://cdnjs.cloudflare.com/ajax/libs/hls.js/0.8.4/hls.min.js',
2238  
2239              autoStartLoad: false,
2240              debug: false
2241          }
2242      },
2243  
2244      canPlayType: function canPlayType(type) {
2245          return _constants.HAS_MSE && ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) > -1;
2246      },
2247  
2248      create: function create(mediaElement, options, mediaFiles) {
2249  
2250          var originalNode = mediaElement.originalNode,
2251              id = mediaElement.id + '_' + options.prefix,
2252              preload = originalNode.getAttribute('preload'),
2253              autoplay = originalNode.autoplay;
2254  
2255          var hlsPlayer = null,
2256              node = null,
2257              index = 0,
2258              total = mediaFiles.length;
2259  
2260          node = originalNode.cloneNode(true);
2261          options = Object.assign(options, mediaElement.options);
2262          options.hls.autoStartLoad = preload && preload !== 'none' || autoplay;
2263  
2264          var props = _mejs2.default.html5media.properties,
2265              events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']),
2266              attachNativeEvents = function attachNativeEvents(e) {
2267              if (e.type !== 'error') {
2268                  var _event = (0, _general.createEvent)(e.type, mediaElement);
2269                  mediaElement.dispatchEvent(_event);
2270              }
2271          },
2272              assignGettersSetters = function assignGettersSetters(propName) {
2273              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2274  
2275              node['get' + capName] = function () {
2276                  return hlsPlayer !== null ? node[propName] : null;
2277              };
2278  
2279              node['set' + capName] = function (value) {
2280                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
2281                      if (propName === 'src') {
2282                          node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
2283                          if (hlsPlayer !== null) {
2284                              hlsPlayer.destroy();
2285                              for (var i = 0, _total = events.length; i < _total; i++) {
2286                                  node.removeEventListener(events[i], attachNativeEvents);
2287                              }
2288                              hlsPlayer = NativeHls._createPlayer({
2289                                  options: options.hls,
2290                                  id: id
2291                              });
2292                              hlsPlayer.loadSource(value);
2293                              hlsPlayer.attachMedia(node);
2294                          }
2295                      } else {
2296                          node[propName] = value;
2297                      }
2298                  }
2299              };
2300          };
2301  
2302          for (var i = 0, _total2 = props.length; i < _total2; i++) {
2303              assignGettersSetters(props[i]);
2304          }
2305  
2306          _window2.default['__ready__' + id] = function (_hlsPlayer) {
2307              mediaElement.hlsPlayer = hlsPlayer = _hlsPlayer;
2308              var hlsEvents = Hls.Events,
2309                  assignEvents = function assignEvents(eventName) {
2310                  if (eventName === 'loadedmetadata') {
2311                      var url = mediaElement.originalNode.src;
2312                      hlsPlayer.detachMedia();
2313                      hlsPlayer.loadSource(url);
2314                      hlsPlayer.attachMedia(node);
2315                  }
2316  
2317                  node.addEventListener(eventName, attachNativeEvents);
2318              };
2319  
2320              for (var _i = 0, _total3 = events.length; _i < _total3; _i++) {
2321                  assignEvents(events[_i]);
2322              }
2323  
2324              var recoverDecodingErrorDate = void 0,
2325                  recoverSwapAudioCodecDate = void 0;
2326              var assignHlsEvents = function assignHlsEvents(name, data) {
2327                  if (name === 'hlsError') {
2328                      console.warn(data);
2329                      data = data[1];
2330  
2331                      if (data.fatal) {
2332                          switch (data.type) {
2333                              case 'mediaError':
2334                                  var now = new Date().getTime();
2335                                  if (!recoverDecodingErrorDate || now - recoverDecodingErrorDate > 3000) {
2336                                      recoverDecodingErrorDate = new Date().getTime();
2337                                      hlsPlayer.recoverMediaError();
2338                                  } else if (!recoverSwapAudioCodecDate || now - recoverSwapAudioCodecDate > 3000) {
2339                                      recoverSwapAudioCodecDate = new Date().getTime();
2340                                      console.warn('Attempting to swap Audio Codec and recover from media error');
2341                                      hlsPlayer.swapAudioCodec();
2342                                      hlsPlayer.recoverMediaError();
2343                                  } else {
2344                                      var message = 'Cannot recover, last media error recovery failed';
2345                                      mediaElement.generateError(message, node.src);
2346                                      console.error(message);
2347                                  }
2348                                  break;
2349                              case 'networkError':
2350                                  if (data.details === 'manifestLoadError') {
2351                                      if (index < total && mediaFiles[index + 1] !== undefined) {
2352                                          node.setSrc(mediaFiles[index++].src);
2353                                          node.load();
2354                                          node.play();
2355                                      } else {
2356                                          var _message = 'Network error';
2357                                          mediaElement.generateError(_message, mediaFiles);
2358                                          console.error(_message);
2359                                      }
2360                                  } else {
2361                                      var _message2 = 'Network error';
2362                                      mediaElement.generateError(_message2, mediaFiles);
2363                                      console.error(_message2);
2364                                  }
2365                                  break;
2366                              default:
2367                                  hlsPlayer.destroy();
2368                                  break;
2369                          }
2370                      }
2371                  } else {
2372                      var _event2 = (0, _general.createEvent)(name, mediaElement);
2373                      _event2.data = data;
2374                      mediaElement.dispatchEvent(_event2);
2375                  }
2376              };
2377  
2378              var _loop = function _loop(eventType) {
2379                  if (hlsEvents.hasOwnProperty(eventType)) {
2380                      hlsPlayer.on(hlsEvents[eventType], function () {
2381                          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
2382                              args[_key] = arguments[_key];
2383                          }
2384  
2385                          return assignHlsEvents(hlsEvents[eventType], args);
2386                      });
2387                  }
2388              };
2389  
2390              for (var eventType in hlsEvents) {
2391                  _loop(eventType);
2392              }
2393          };
2394  
2395          if (total > 0) {
2396              for (; index < total; index++) {
2397                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
2398                      node.setAttribute('src', mediaFiles[index].src);
2399                      break;
2400                  }
2401              }
2402          }
2403  
2404          if (preload !== 'auto' && !autoplay) {
2405              node.addEventListener('play', function () {
2406                  if (hlsPlayer !== null) {
2407                      hlsPlayer.startLoad();
2408                  }
2409              });
2410  
2411              node.addEventListener('pause', function () {
2412                  if (hlsPlayer !== null) {
2413                      hlsPlayer.stopLoad();
2414                  }
2415              });
2416          }
2417  
2418          node.setAttribute('id', id);
2419  
2420          originalNode.parentNode.insertBefore(node, originalNode);
2421          originalNode.autoplay = false;
2422          originalNode.style.display = 'none';
2423  
2424          node.setSize = function (width, height) {
2425              node.style.width = width + 'px';
2426              node.style.height = height + 'px';
2427              return node;
2428          };
2429  
2430          node.hide = function () {
2431              node.pause();
2432              node.style.display = 'none';
2433              return node;
2434          };
2435  
2436          node.show = function () {
2437              node.style.display = '';
2438              return node;
2439          };
2440  
2441          node.destroy = function () {
2442              if (hlsPlayer !== null) {
2443                  hlsPlayer.stopLoad();
2444                  hlsPlayer.destroy();
2445              }
2446          };
2447  
2448          var event = (0, _general.createEvent)('rendererready', node);
2449          mediaElement.dispatchEvent(event);
2450  
2451          mediaElement.promises.push(NativeHls.load({
2452              options: options.hls,
2453              id: id
2454          }));
2455  
2456          return node;
2457      }
2458  };
2459  
2460  _media.typeChecks.push(function (url) {
2461      return ~url.toLowerCase().indexOf('.m3u8') ? 'application/x-mpegURL' : null;
2462  });
2463  
2464  _renderer.renderer.add(HlsNativeRenderer);
2465  
2466  },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],14:[function(_dereq_,module,exports){
2467  'use strict';
2468  
2469  var _window = _dereq_(3);
2470  
2471  var _window2 = _interopRequireDefault(_window);
2472  
2473  var _document = _dereq_(2);
2474  
2475  var _document2 = _interopRequireDefault(_document);
2476  
2477  var _mejs = _dereq_(7);
2478  
2479  var _mejs2 = _interopRequireDefault(_mejs);
2480  
2481  var _renderer = _dereq_(8);
2482  
2483  var _general = _dereq_(18);
2484  
2485  var _constants = _dereq_(16);
2486  
2487  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2488  
2489  var HtmlMediaElement = {
2490      name: 'html5',
2491      options: {
2492          prefix: 'html5'
2493      },
2494  
2495      canPlayType: function canPlayType(type) {
2496  
2497          var mediaElement = _document2.default.createElement('video');
2498  
2499          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) {
2500              return 'yes';
2501          } else if (mediaElement.canPlayType) {
2502              return mediaElement.canPlayType(type.toLowerCase()).replace(/no/, '');
2503          } else {
2504              return '';
2505          }
2506      },
2507  
2508      create: function create(mediaElement, options, mediaFiles) {
2509  
2510          var id = mediaElement.id + '_' + options.prefix;
2511          var isActive = false;
2512  
2513          var node = null;
2514  
2515          if (mediaElement.originalNode === undefined || mediaElement.originalNode === null) {
2516              node = _document2.default.createElement('audio');
2517              mediaElement.appendChild(node);
2518          } else {
2519              node = mediaElement.originalNode;
2520          }
2521  
2522          node.setAttribute('id', id);
2523  
2524          var props = _mejs2.default.html5media.properties,
2525              assignGettersSetters = function assignGettersSetters(propName) {
2526              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2527  
2528              node['get' + capName] = function () {
2529                  return node[propName];
2530              };
2531  
2532              node['set' + capName] = function (value) {
2533                  if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
2534                      node[propName] = value;
2535                  }
2536              };
2537          };
2538  
2539          for (var i = 0, _total = props.length; i < _total; i++) {
2540              assignGettersSetters(props[i]);
2541          }
2542  
2543          var events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']),
2544              assignEvents = function assignEvents(eventName) {
2545              node.addEventListener(eventName, function (e) {
2546                  if (isActive) {
2547                      var _event = (0, _general.createEvent)(e.type, e.target);
2548                      mediaElement.dispatchEvent(_event);
2549                  }
2550              });
2551          };
2552  
2553          for (var _i = 0, _total2 = events.length; _i < _total2; _i++) {
2554              assignEvents(events[_i]);
2555          }
2556  
2557          node.setSize = function (width, height) {
2558              node.style.width = width + 'px';
2559              node.style.height = height + 'px';
2560              return node;
2561          };
2562  
2563          node.hide = function () {
2564              isActive = false;
2565              node.style.display = 'none';
2566  
2567              return node;
2568          };
2569  
2570          node.show = function () {
2571              isActive = true;
2572              node.style.display = '';
2573  
2574              return node;
2575          };
2576  
2577          var index = 0,
2578              total = mediaFiles.length;
2579          if (total > 0) {
2580              for (; index < total; index++) {
2581                  if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
2582                      node.setAttribute('src', mediaFiles[index].src);
2583                      break;
2584                  }
2585              }
2586          }
2587  
2588          node.addEventListener('error', function (e) {
2589              if (e.target.error.code === 4 && isActive) {
2590                  if (index < total && mediaFiles[index + 1] !== undefined) {
2591                      node.src = mediaFiles[index++].src;
2592                      node.load();
2593                      node.play();
2594                  } else {
2595                      mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles);
2596                  }
2597              }
2598          });
2599  
2600          var event = (0, _general.createEvent)('rendererready', node);
2601          mediaElement.dispatchEvent(event);
2602  
2603          return node;
2604      }
2605  };
2606  
2607  _window2.default.HtmlMediaElement = _mejs2.default.HtmlMediaElement = HtmlMediaElement;
2608  
2609  _renderer.renderer.add(HtmlMediaElement);
2610  
2611  },{"16":16,"18":18,"2":2,"3":3,"7":7,"8":8}],15:[function(_dereq_,module,exports){
2612  'use strict';
2613  
2614  var _window = _dereq_(3);
2615  
2616  var _window2 = _interopRequireDefault(_window);
2617  
2618  var _document = _dereq_(2);
2619  
2620  var _document2 = _interopRequireDefault(_document);
2621  
2622  var _mejs = _dereq_(7);
2623  
2624  var _mejs2 = _interopRequireDefault(_mejs);
2625  
2626  var _renderer = _dereq_(8);
2627  
2628  var _general = _dereq_(18);
2629  
2630  var _media = _dereq_(19);
2631  
2632  var _dom = _dereq_(17);
2633  
2634  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2635  
2636  var YouTubeApi = {
2637      isIframeStarted: false,
2638  
2639      isIframeLoaded: false,
2640  
2641      iframeQueue: [],
2642  
2643      enqueueIframe: function enqueueIframe(settings) {
2644          YouTubeApi.isLoaded = typeof YT !== 'undefined' && YT.loaded;
2645  
2646          if (YouTubeApi.isLoaded) {
2647              YouTubeApi.createIframe(settings);
2648          } else {
2649              YouTubeApi.loadIframeApi();
2650              YouTubeApi.iframeQueue.push(settings);
2651          }
2652      },
2653  
2654      loadIframeApi: function loadIframeApi() {
2655          if (!YouTubeApi.isIframeStarted) {
2656              (0, _dom.loadScript)('https://www.youtube.com/player_api');
2657              YouTubeApi.isIframeStarted = true;
2658          }
2659      },
2660  
2661      iFrameReady: function iFrameReady() {
2662  
2663          YouTubeApi.isLoaded = true;
2664          YouTubeApi.isIframeLoaded = true;
2665  
2666          while (YouTubeApi.iframeQueue.length > 0) {
2667              var settings = YouTubeApi.iframeQueue.pop();
2668              YouTubeApi.createIframe(settings);
2669          }
2670      },
2671  
2672      createIframe: function createIframe(settings) {
2673          return new YT.Player(settings.containerId, settings);
2674      },
2675  
2676      getYouTubeId: function getYouTubeId(url) {
2677  
2678          var youTubeId = '';
2679  
2680          if (url.indexOf('?') > 0) {
2681              youTubeId = YouTubeApi.getYouTubeIdFromParam(url);
2682  
2683              if (youTubeId === '') {
2684                  youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
2685              }
2686          } else {
2687              youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
2688          }
2689  
2690          var id = youTubeId.substring(youTubeId.lastIndexOf('/') + 1);
2691          youTubeId = id.split('?');
2692          return youTubeId[0];
2693      },
2694  
2695      getYouTubeIdFromParam: function getYouTubeIdFromParam(url) {
2696  
2697          if (url === undefined || url === null || !url.trim().length) {
2698              return null;
2699          }
2700  
2701          var parts = url.split('?'),
2702              parameters = parts[1].split('&');
2703  
2704          var youTubeId = '';
2705  
2706          for (var i = 0, total = parameters.length; i < total; i++) {
2707              var paramParts = parameters[i].split('=');
2708              if (paramParts[0] === 'v') {
2709                  youTubeId = paramParts[1];
2710                  break;
2711              }
2712          }
2713  
2714          return youTubeId;
2715      },
2716  
2717      getYouTubeIdFromUrl: function getYouTubeIdFromUrl(url) {
2718  
2719          if (url === undefined || url === null || !url.trim().length) {
2720              return null;
2721          }
2722  
2723          var parts = url.split('?');
2724          url = parts[0];
2725          return url.substring(url.lastIndexOf('/') + 1);
2726      },
2727  
2728      getYouTubeNoCookieUrl: function getYouTubeNoCookieUrl(url) {
2729          if (url === undefined || url === null || !url.trim().length || url.indexOf('//www.youtube') === -1) {
2730              return url;
2731          }
2732  
2733          var parts = url.split('/');
2734          parts[2] = parts[2].replace('.com', '-nocookie.com');
2735          return parts.join('/');
2736      }
2737  };
2738  
2739  var YouTubeIframeRenderer = {
2740      name: 'youtube_iframe',
2741  
2742      options: {
2743          prefix: 'youtube_iframe',
2744  
2745          youtube: {
2746              autoplay: 0,
2747              controls: 0,
2748              disablekb: 1,
2749              end: 0,
2750              loop: 0,
2751              modestbranding: 0,
2752              playsinline: 0,
2753              rel: 0,
2754              showinfo: 0,
2755              start: 0,
2756              iv_load_policy: 3,
2757  
2758              nocookie: false,
2759  
2760              imageQuality: null
2761          }
2762      },
2763  
2764      canPlayType: function canPlayType(type) {
2765          return ~['video/youtube', 'video/x-youtube'].indexOf(type.toLowerCase());
2766      },
2767  
2768      create: function create(mediaElement, options, mediaFiles) {
2769  
2770          var youtube = {},
2771              apiStack = [],
2772              readyState = 4;
2773  
2774          var youTubeApi = null,
2775              paused = true,
2776              ended = false,
2777              youTubeIframe = null,
2778              volume = 1;
2779  
2780          youtube.options = options;
2781          youtube.id = mediaElement.id + '_' + options.prefix;
2782          youtube.mediaElement = mediaElement;
2783  
2784          var props = _mejs2.default.html5media.properties,
2785              assignGettersSetters = function assignGettersSetters(propName) {
2786  
2787              var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2788  
2789              youtube['get' + capName] = function () {
2790                  if (youTubeApi !== null) {
2791                      var value = null;
2792  
2793                      switch (propName) {
2794                          case 'currentTime':
2795                              return youTubeApi.getCurrentTime();
2796                          case 'duration':
2797                              return youTubeApi.getDuration();
2798                          case 'volume':
2799                              volume = youTubeApi.getVolume() / 100;
2800                              return volume;
2801                          case 'paused':
2802                              return paused;
2803                          case 'ended':
2804                              return ended;
2805                          case 'muted':
2806                              return youTubeApi.isMuted();
2807                          case 'buffered':
2808                              var percentLoaded = youTubeApi.getVideoLoadedFraction(),
2809                                  duration = youTubeApi.getDuration();
2810                              return {
2811                                  start: function start() {
2812                                      return 0;
2813                                  },
2814                                  end: function end() {
2815                                      return percentLoaded * duration;
2816                                  },
2817                                  length: 1
2818                              };
2819                          case 'src':
2820                              return youTubeApi.getVideoUrl();
2821                          case 'readyState':
2822                              return readyState;
2823                      }
2824  
2825                      return value;
2826                  } else {
2827                      return null;
2828                  }
2829              };
2830  
2831              youtube['set' + capName] = function (value) {
2832                  if (youTubeApi !== null) {
2833                      switch (propName) {
2834                          case 'src':
2835                              var url = typeof value === 'string' ? value : value[0].src,
2836                                  _videoId = YouTubeApi.getYouTubeId(url);
2837  
2838                              if (mediaElement.originalNode.autoplay) {
2839                                  youTubeApi.loadVideoById(_videoId);
2840                              } else {
2841                                  youTubeApi.cueVideoById(_videoId);
2842                              }
2843                              break;
2844                          case 'currentTime':
2845                              youTubeApi.seekTo(value);
2846                              break;
2847                          case 'muted':
2848                              if (value) {
2849                                  youTubeApi.mute();
2850                              } else {
2851                                  youTubeApi.unMute();
2852                              }
2853                              setTimeout(function () {
2854                                  var event = (0, _general.createEvent)('volumechange', youtube);
2855                                  mediaElement.dispatchEvent(event);
2856                              }, 50);
2857                              break;
2858                          case 'volume':
2859                              volume = value;
2860                              youTubeApi.setVolume(value * 100);
2861                              setTimeout(function () {
2862                                  var event = (0, _general.createEvent)('volumechange', youtube);
2863                                  mediaElement.dispatchEvent(event);
2864                              }, 50);
2865                              break;
2866                          case 'readyState':
2867                              var event = (0, _general.createEvent)('canplay', youtube);
2868                              mediaElement.dispatchEvent(event);
2869                              break;
2870                          default:
2871                              
2872                              break;
2873                      }
2874                  } else {
2875                      apiStack.push({ type: 'set', propName: propName, value: value });
2876                  }
2877              };
2878          };
2879  
2880          for (var i = 0, total = props.length; i < total; i++) {
2881              assignGettersSetters(props[i]);
2882          }
2883  
2884          var methods = _mejs2.default.html5media.methods,
2885              assignMethods = function assignMethods(methodName) {
2886              youtube[methodName] = function () {
2887                  if (youTubeApi !== null) {
2888                      switch (methodName) {
2889                          case 'play':
2890                              paused = false;
2891                              return youTubeApi.playVideo();
2892                          case 'pause':
2893                              paused = true;
2894                              return youTubeApi.pauseVideo();
2895                          case 'load':
2896                              return null;
2897                      }
2898                  } else {
2899                      apiStack.push({ type: 'call', methodName: methodName });
2900                  }
2901              };
2902          };
2903  
2904          for (var _i = 0, _total = methods.length; _i < _total; _i++) {
2905              assignMethods(methods[_i]);
2906          }
2907  
2908          var youtubeContainer = _document2.default.createElement('div');
2909          youtubeContainer.id = youtube.id;
2910  
2911          if (youtube.options.youtube.nocookie) {
2912              mediaElement.originalNode.src = YouTubeApi.getYouTubeNoCookieUrl(mediaFiles[0].src);
2913          }
2914  
2915          mediaElement.originalNode.parentNode.insertBefore(youtubeContainer, mediaElement.originalNode);
2916          mediaElement.originalNode.style.display = 'none';
2917  
2918          var isAudio = mediaElement.originalNode.tagName.toLowerCase() === 'audio',
2919              height = isAudio ? '1' : mediaElement.originalNode.height,
2920              width = isAudio ? '1' : mediaElement.originalNode.width,
2921              videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src),
2922              youtubeSettings = {
2923              id: youtube.id,
2924              containerId: youtubeContainer.id,
2925              videoId: videoId,
2926              height: height,
2927              width: width,
2928              playerVars: Object.assign({
2929                  controls: 0,
2930                  rel: 0,
2931                  disablekb: 1,
2932                  showinfo: 0,
2933                  modestbranding: 0,
2934                  html5: 1,
2935                  iv_load_policy: 3
2936              }, youtube.options.youtube),
2937              origin: _window2.default.location.host,
2938              events: {
2939                  onReady: function onReady(e) {
2940                      mediaElement.youTubeApi = youTubeApi = e.target;
2941                      mediaElement.youTubeState = {
2942                          paused: true,
2943                          ended: false
2944                      };
2945  
2946                      if (apiStack.length) {
2947                          for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
2948  
2949                              var stackItem = apiStack[_i2];
2950  
2951                              if (stackItem.type === 'set') {
2952                                  var propName = stackItem.propName,
2953                                      capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
2954  
2955                                  youtube['set' + capName](stackItem.value);
2956                              } else if (stackItem.type === 'call') {
2957                                  youtube[stackItem.methodName]();
2958                              }
2959                          }
2960                      }
2961  
2962                      youTubeIframe = youTubeApi.getIframe();
2963  
2964                      if (mediaElement.originalNode.muted) {
2965                          youTubeApi.mute();
2966                      }
2967  
2968                      var events = ['mouseover', 'mouseout'],
2969                          assignEvents = function assignEvents(e) {
2970                          var newEvent = (0, _general.createEvent)(e.type, youtube);
2971                          mediaElement.dispatchEvent(newEvent);
2972                      };
2973  
2974                      for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
2975                          youTubeIframe.addEventListener(events[_i3], assignEvents, false);
2976                      }
2977  
2978                      var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
2979  
2980                      for (var _i4 = 0, _total4 = initEvents.length; _i4 < _total4; _i4++) {
2981                          var event = (0, _general.createEvent)(initEvents[_i4], youtube);
2982                          mediaElement.dispatchEvent(event);
2983                      }
2984                  },
2985                  onStateChange: function onStateChange(e) {
2986                      var events = [];
2987  
2988                      switch (e.data) {
2989                          case -1:
2990                              events = ['loadedmetadata'];
2991                              paused = true;
2992                              ended = false;
2993                              break;
2994                          case 0:
2995                              events = ['ended'];
2996                              paused = false;
2997                              ended = !youtube.options.youtube.loop;
2998                              if (!youtube.options.youtube.loop) {
2999                                  youtube.stopInterval();
3000                              }
3001                              break;
3002                          case 1:
3003                              events = ['play', 'playing'];
3004                              paused = false;
3005                              ended = false;
3006                              youtube.startInterval();
3007                              break;
3008                          case 2:
3009                              events = ['pause'];
3010                              paused = true;
3011                              ended = false;
3012                              youtube.stopInterval();
3013                              break;
3014                          case 3:
3015                              events = ['progress'];
3016                              ended = false;
3017                              break;
3018                          case 5:
3019                              events = ['loadeddata', 'loadedmetadata', 'canplay'];
3020                              paused = true;
3021                              ended = false;
3022                              break;
3023                      }
3024  
3025                      for (var _i5 = 0, _total5 = events.length; _i5 < _total5; _i5++) {
3026                          var event = (0, _general.createEvent)(events[_i5], youtube);
3027                          mediaElement.dispatchEvent(event);
3028                      }
3029                  },
3030                  onError: function onError(e) {
3031                      var event = (0, _general.createEvent)('error', youtube);
3032                      event.data = e.data;
3033                      mediaElement.dispatchEvent(event);
3034                  }
3035              }
3036          };
3037  
3038          if (isAudio || mediaElement.originalNode.hasAttribute('playsinline')) {
3039              youtubeSettings.playerVars.playsinline = 1;
3040          }
3041  
3042          if (mediaElement.originalNode.controls) {
3043              youtubeSettings.playerVars.controls = 1;
3044          }
3045          if (mediaElement.originalNode.autoplay) {
3046              youtubeSettings.playerVars.autoplay = 1;
3047          }
3048          if (mediaElement.originalNode.loop) {
3049              youtubeSettings.playerVars.loop = 1;
3050          }
3051  
3052          YouTubeApi.enqueueIframe(youtubeSettings);
3053  
3054          youtube.onEvent = function (eventName, player, _youTubeState) {
3055              if (_youTubeState !== null && _youTubeState !== undefined) {
3056                  mediaElement.youTubeState = _youTubeState;
3057              }
3058          };
3059  
3060          youtube.setSize = function (width, height) {
3061              if (youTubeApi !== null) {
3062                  youTubeApi.setSize(width, height);
3063              }
3064          };
3065          youtube.hide = function () {
3066              youtube.stopInterval();
3067              youtube.pause();
3068              if (youTubeIframe) {
3069                  youTubeIframe.style.display = 'none';
3070              }
3071          };
3072          youtube.show = function () {
3073              if (youTubeIframe) {
3074                  youTubeIframe.style.display = '';
3075              }
3076          };
3077          youtube.destroy = function () {
3078              youTubeApi.destroy();
3079          };
3080          youtube.interval = null;
3081  
3082          youtube.startInterval = function () {
3083              youtube.interval = setInterval(function () {
3084                  var event = (0, _general.createEvent)('timeupdate', youtube);
3085                  mediaElement.dispatchEvent(event);
3086              }, 250);
3087          };
3088          youtube.stopInterval = function () {
3089              if (youtube.interval) {
3090                  clearInterval(youtube.interval);
3091              }
3092          };
3093          youtube.getPosterUrl = function () {
3094              var quality = options.youtube.imageQuality,
3095                  resolutions = ['default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault'],
3096                  id = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
3097              return quality && resolutions.indexOf(quality) > -1 && id ? 'https://img.youtube.com/vi/' + id + '/' + quality + '.jpg' : '';
3098          };
3099  
3100          return youtube;
3101      }
3102  };
3103  
3104  _window2.default.onYouTubePlayerAPIReady = function () {
3105      YouTubeApi.iFrameReady();
3106  };
3107  
3108  _media.typeChecks.push(function (url) {
3109      return (/\/\/(www\.youtube|youtu\.?be)/i.test(url) ? 'video/x-youtube' : null
3110      );
3111  });
3112  
3113  _renderer.renderer.add(YouTubeIframeRenderer);
3114  
3115  },{"17":17,"18":18,"19":19,"2":2,"3":3,"7":7,"8":8}],16:[function(_dereq_,module,exports){
3116  'use strict';
3117  
3118  Object.defineProperty(exports, "__esModule", {
3119      value: true
3120  });
3121  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;
3122  
3123  var _window = _dereq_(3);
3124  
3125  var _window2 = _interopRequireDefault(_window);
3126  
3127  var _document = _dereq_(2);
3128  
3129  var _document2 = _interopRequireDefault(_document);
3130  
3131  var _mejs = _dereq_(7);
3132  
3133  var _mejs2 = _interopRequireDefault(_mejs);
3134  
3135  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3136  
3137  var NAV = exports.NAV = _window2.default.navigator;
3138  var UA = exports.UA = NAV.userAgent.toLowerCase();
3139  var IS_IPAD = exports.IS_IPAD = /ipad/i.test(UA) && !_window2.default.MSStream;
3140  var IS_IPHONE = exports.IS_IPHONE = /iphone/i.test(UA) && !_window2.default.MSStream;
3141  var IS_IPOD = exports.IS_IPOD = /ipod/i.test(UA) && !_window2.default.MSStream;
3142  var IS_IOS = exports.IS_IOS = /ipad|iphone|ipod/i.test(UA) && !_window2.default.MSStream;
3143  var IS_ANDROID = exports.IS_ANDROID = /android/i.test(UA);
3144  var IS_IE = exports.IS_IE = /(trident|microsoft)/i.test(NAV.appName);
3145  var IS_EDGE = exports.IS_EDGE = 'msLaunchUri' in NAV && !('documentMode' in _document2.default);
3146  var IS_CHROME = exports.IS_CHROME = /chrome/i.test(UA);
3147  var IS_FIREFOX = exports.IS_FIREFOX = /firefox/i.test(UA);
3148  var IS_SAFARI = exports.IS_SAFARI = /safari/i.test(UA) && !IS_CHROME;
3149  var IS_STOCK_ANDROID = exports.IS_STOCK_ANDROID = /^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(UA);
3150  var HAS_MSE = exports.HAS_MSE = 'MediaSource' in _window2.default;
3151  var SUPPORT_POINTER_EVENTS = exports.SUPPORT_POINTER_EVENTS = function () {
3152      var element = _document2.default.createElement('x'),
3153          documentElement = _document2.default.documentElement,
3154          getComputedStyle = _window2.default.getComputedStyle;
3155  
3156      if (!('pointerEvents' in element.style)) {
3157          return false;
3158      }
3159  
3160      element.style.pointerEvents = 'auto';
3161      element.style.pointerEvents = 'x';
3162      documentElement.appendChild(element);
3163      var supports = getComputedStyle && getComputedStyle(element, '').pointerEvents === 'auto';
3164      element.remove();
3165      return !!supports;
3166  }();
3167  
3168  var SUPPORT_PASSIVE_EVENT = exports.SUPPORT_PASSIVE_EVENT = function () {
3169      var supportsPassive = false;
3170      try {
3171          var opts = Object.defineProperty({}, 'passive', {
3172              get: function get() {
3173                  supportsPassive = true;
3174              }
3175          });
3176          _window2.default.addEventListener('test', null, opts);
3177      } catch (e) {}
3178  
3179      return supportsPassive;
3180  }();
3181  
3182  var html5Elements = ['source', 'track', 'audio', 'video'];
3183  var video = void 0;
3184  
3185  for (var i = 0, total = html5Elements.length; i < total; i++) {
3186      video = _document2.default.createElement(html5Elements[i]);
3187  }
3188  
3189  var SUPPORTS_NATIVE_HLS = exports.SUPPORTS_NATIVE_HLS = IS_SAFARI || IS_ANDROID && (IS_CHROME || IS_STOCK_ANDROID) || IS_IE && /edge/i.test(UA);
3190  
3191  var hasiOSFullScreen = video.webkitEnterFullscreen !== undefined;
3192  
3193  var hasNativeFullscreen = video.requestFullscreen !== undefined;
3194  
3195  if (hasiOSFullScreen && /mac os x 10_5/i.test(UA)) {
3196      hasNativeFullscreen = false;
3197      hasiOSFullScreen = false;
3198  }
3199  
3200  var hasWebkitNativeFullScreen = video.webkitRequestFullScreen !== undefined;
3201  var hasMozNativeFullScreen = video.mozRequestFullScreen !== undefined;
3202  var hasMsNativeFullScreen = video.msRequestFullscreen !== undefined;
3203  var hasTrueNativeFullScreen = hasWebkitNativeFullScreen || hasMozNativeFullScreen || hasMsNativeFullScreen;
3204  var nativeFullScreenEnabled = hasTrueNativeFullScreen;
3205  var fullScreenEventName = '';
3206  var isFullScreen = void 0,
3207      requestFullScreen = void 0,
3208      cancelFullScreen = void 0;
3209  
3210  if (hasMozNativeFullScreen) {
3211      nativeFullScreenEnabled = _document2.default.mozFullScreenEnabled;
3212  } else if (hasMsNativeFullScreen) {
3213      nativeFullScreenEnabled = _document2.default.msFullscreenEnabled;
3214  }
3215  
3216  if (IS_CHROME) {
3217      hasiOSFullScreen = false;
3218  }
3219  
3220  if (hasTrueNativeFullScreen) {
3221      if (hasWebkitNativeFullScreen) {
3222          fullScreenEventName = 'webkitfullscreenchange';
3223      } else if (hasMozNativeFullScreen) {
3224          fullScreenEventName = 'mozfullscreenchange';
3225      } else if (hasMsNativeFullScreen) {
3226          fullScreenEventName = 'MSFullscreenChange';
3227      }
3228  
3229      exports.isFullScreen = isFullScreen = function isFullScreen() {
3230          if (hasMozNativeFullScreen) {
3231              return _document2.default.mozFullScreen;
3232          } else if (hasWebkitNativeFullScreen) {
3233              return _document2.default.webkitIsFullScreen;
3234          } else if (hasMsNativeFullScreen) {
3235              return _document2.default.msFullscreenElement !== null;
3236          }
3237      };
3238  
3239      exports.requestFullScreen = requestFullScreen = function requestFullScreen(el) {
3240          if (hasWebkitNativeFullScreen) {
3241              el.webkitRequestFullScreen();
3242          } else if (hasMozNativeFullScreen) {
3243              el.mozRequestFullScreen();
3244          } else if (hasMsNativeFullScreen) {
3245              el.msRequestFullscreen();
3246          }
3247      };
3248  
3249      exports.cancelFullScreen = cancelFullScreen = function cancelFullScreen() {
3250          if (hasWebkitNativeFullScreen) {
3251              _document2.default.webkitCancelFullScreen();
3252          } else if (hasMozNativeFullScreen) {
3253              _document2.default.mozCancelFullScreen();
3254          } else if (hasMsNativeFullScreen) {
3255              _document2.default.msExitFullscreen();
3256          }
3257      };
3258  }
3259  
3260  var HAS_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = hasNativeFullscreen;
3261  var HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = hasWebkitNativeFullScreen;
3262  var HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = hasMozNativeFullScreen;
3263  var HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = hasMsNativeFullScreen;
3264  var HAS_IOS_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = hasiOSFullScreen;
3265  var HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_TRUE_NATIVE_FULLSCREEN = hasTrueNativeFullScreen;
3266  var HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_NATIVE_FULLSCREEN_ENABLED = nativeFullScreenEnabled;
3267  var FULLSCREEN_EVENT_NAME = exports.FULLSCREEN_EVENT_NAME = fullScreenEventName;
3268  exports.isFullScreen = isFullScreen;
3269  exports.requestFullScreen = requestFullScreen;
3270  exports.cancelFullScreen = cancelFullScreen;
3271  
3272  
3273  _mejs2.default.Features = _mejs2.default.Features || {};
3274  _mejs2.default.Features.isiPad = IS_IPAD;
3275  _mejs2.default.Features.isiPod = IS_IPOD;
3276  _mejs2.default.Features.isiPhone = IS_IPHONE;
3277  _mejs2.default.Features.isiOS = _mejs2.default.Features.isiPhone || _mejs2.default.Features.isiPad;
3278  _mejs2.default.Features.isAndroid = IS_ANDROID;
3279  _mejs2.default.Features.isIE = IS_IE;
3280  _mejs2.default.Features.isEdge = IS_EDGE;
3281  _mejs2.default.Features.isChrome = IS_CHROME;
3282  _mejs2.default.Features.isFirefox = IS_FIREFOX;
3283  _mejs2.default.Features.isSafari = IS_SAFARI;
3284  _mejs2.default.Features.isStockAndroid = IS_STOCK_ANDROID;
3285  _mejs2.default.Features.hasMSE = HAS_MSE;
3286  _mejs2.default.Features.supportsNativeHLS = SUPPORTS_NATIVE_HLS;
3287  _mejs2.default.Features.supportsPointerEvents = SUPPORT_POINTER_EVENTS;
3288  _mejs2.default.Features.supportsPassiveEvent = SUPPORT_PASSIVE_EVENT;
3289  _mejs2.default.Features.hasiOSFullScreen = HAS_IOS_FULLSCREEN;
3290  _mejs2.default.Features.hasNativeFullscreen = HAS_NATIVE_FULLSCREEN;
3291  _mejs2.default.Features.hasWebkitNativeFullScreen = HAS_WEBKIT_NATIVE_FULLSCREEN;
3292  _mejs2.default.Features.hasMozNativeFullScreen = HAS_MOZ_NATIVE_FULLSCREEN;
3293  _mejs2.default.Features.hasMsNativeFullScreen = HAS_MS_NATIVE_FULLSCREEN;
3294  _mejs2.default.Features.hasTrueNativeFullScreen = HAS_TRUE_NATIVE_FULLSCREEN;
3295  _mejs2.default.Features.nativeFullScreenEnabled = HAS_NATIVE_FULLSCREEN_ENABLED;
3296  _mejs2.default.Features.fullScreenEventName = FULLSCREEN_EVENT_NAME;
3297  _mejs2.default.Features.isFullScreen = isFullScreen;
3298  _mejs2.default.Features.requestFullScreen = requestFullScreen;
3299  _mejs2.default.Features.cancelFullScreen = cancelFullScreen;
3300  
3301  },{"2":2,"3":3,"7":7}],17:[function(_dereq_,module,exports){
3302  'use strict';
3303  
3304  Object.defineProperty(exports, "__esModule", {
3305      value: true
3306  });
3307  exports.removeClass = exports.addClass = exports.hasClass = undefined;
3308  exports.loadScript = loadScript;
3309  exports.offset = offset;
3310  exports.toggleClass = toggleClass;
3311  exports.fadeOut = fadeOut;
3312  exports.fadeIn = fadeIn;
3313  exports.siblings = siblings;
3314  exports.visible = visible;
3315  exports.ajax = ajax;
3316  
3317  var _window = _dereq_(3);
3318  
3319  var _window2 = _interopRequireDefault(_window);
3320  
3321  var _document = _dereq_(2);
3322  
3323  var _document2 = _interopRequireDefault(_document);
3324  
3325  var _mejs = _dereq_(7);
3326  
3327  var _mejs2 = _interopRequireDefault(_mejs);
3328  
3329  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3330  
3331  function loadScript(url) {
3332      return new Promise(function (resolve, reject) {
3333          var script = _document2.default.createElement('script');
3334          script.src = url;
3335          script.async = true;
3336          script.onload = function () {
3337              script.remove();
3338              resolve();
3339          };
3340          script.onerror = function () {
3341              script.remove();
3342              reject();
3343          };
3344          _document2.default.head.appendChild(script);
3345      });
3346  }
3347  
3348  function offset(el) {
3349      var rect = el.getBoundingClientRect(),
3350          scrollLeft = _window2.default.pageXOffset || _document2.default.documentElement.scrollLeft,
3351          scrollTop = _window2.default.pageYOffset || _document2.default.documentElement.scrollTop;
3352      return { top: rect.top + scrollTop, left: rect.left + scrollLeft };
3353  }
3354  
3355  var hasClassMethod = void 0,
3356      addClassMethod = void 0,
3357      removeClassMethod = void 0;
3358  
3359  if ('classList' in _document2.default.documentElement) {
3360      hasClassMethod = function hasClassMethod(el, className) {
3361          return el.classList !== undefined && el.classList.contains(className);
3362      };
3363      addClassMethod = function addClassMethod(el, className) {
3364          return el.classList.add(className);
3365      };
3366      removeClassMethod = function removeClassMethod(el, className) {
3367          return el.classList.remove(className);
3368      };
3369  } else {
3370      hasClassMethod = function hasClassMethod(el, className) {
3371          return new RegExp('\\b' + className + '\\b').test(el.className);
3372      };
3373      addClassMethod = function addClassMethod(el, className) {
3374          if (!hasClass(el, className)) {
3375              el.className += ' ' + className;
3376          }
3377      };
3378      removeClassMethod = function removeClassMethod(el, className) {
3379          el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), '');
3380      };
3381  }
3382  
3383  var hasClass = exports.hasClass = hasClassMethod;
3384  var addClass = exports.addClass = addClassMethod;
3385  var removeClass = exports.removeClass = removeClassMethod;
3386  
3387  function toggleClass(el, className) {
3388      hasClass(el, className) ? removeClass(el, className) : addClass(el, className);
3389  }
3390  
3391  function fadeOut(el) {
3392      var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
3393      var callback = arguments[2];
3394  
3395      if (!el.style.opacity) {
3396          el.style.opacity = 1;
3397      }
3398  
3399      var start = null;
3400      _window2.default.requestAnimationFrame(function animate(timestamp) {
3401          start = start || timestamp;
3402          var progress = timestamp - start;
3403          var opacity = parseFloat(1 - progress / duration, 2);
3404          el.style.opacity = opacity < 0 ? 0 : opacity;
3405          if (progress > duration) {
3406              if (callback && typeof callback === 'function') {
3407                  callback();
3408              }
3409          } else {
3410              _window2.default.requestAnimationFrame(animate);
3411          }
3412      });
3413  }
3414  
3415  function fadeIn(el) {
3416      var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
3417      var callback = arguments[2];
3418  
3419      if (!el.style.opacity) {
3420          el.style.opacity = 0;
3421      }
3422  
3423      var start = null;
3424      _window2.default.requestAnimationFrame(function animate(timestamp) {
3425          start = start || timestamp;
3426          var progress = timestamp - start;
3427          var opacity = parseFloat(progress / duration, 2);
3428          el.style.opacity = opacity > 1 ? 1 : opacity;
3429          if (progress > duration) {
3430              if (callback && typeof callback === 'function') {
3431                  callback();
3432              }
3433          } else {
3434              _window2.default.requestAnimationFrame(animate);
3435          }
3436      });
3437  }
3438  
3439  function siblings(el, filter) {
3440      var siblings = [];
3441      el = el.parentNode.firstChild;
3442      do {
3443          if (!filter || filter(el)) {
3444              siblings.push(el);
3445          }
3446      } while (el = el.nextSibling);
3447      return siblings;
3448  }
3449  
3450  function visible(elem) {
3451      if (elem.getClientRects !== undefined && elem.getClientRects === 'function') {
3452          return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
3453      }
3454      return !!(elem.offsetWidth || elem.offsetHeight);
3455  }
3456  
3457  function ajax(url, dataType, success, error) {
3458      var xhr = _window2.default.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
3459  
3460      var type = 'application/x-www-form-urlencoded; charset=UTF-8',
3461          completed = false,
3462          accept = '*/'.concat('*');
3463  
3464      switch (dataType) {
3465          case 'text':
3466              type = 'text/plain';
3467              break;
3468          case 'json':
3469              type = 'application/json, text/javascript';
3470              break;
3471          case 'html':
3472              type = 'text/html';
3473              break;
3474          case 'xml':
3475              type = 'application/xml, text/xml';
3476              break;
3477      }
3478  
3479      if (type !== 'application/x-www-form-urlencoded') {
3480          accept = type + ', */*; q=0.01';
3481      }
3482  
3483      if (xhr) {
3484          xhr.open('GET', url, true);
3485          xhr.setRequestHeader('Accept', accept);
3486          xhr.onreadystatechange = function () {
3487              if (completed) {
3488                  return;
3489              }
3490  
3491              if (xhr.readyState === 4) {
3492                  if (xhr.status === 200) {
3493                      completed = true;
3494                      var data = void 0;
3495                      switch (dataType) {
3496                          case 'json':
3497                              data = JSON.parse(xhr.responseText);
3498                              break;
3499                          case 'xml':
3500                              data = xhr.responseXML;
3501                              break;
3502                          default:
3503                              data = xhr.responseText;
3504                              break;
3505                      }
3506                      success(data);
3507                  } else if (typeof error === 'function') {
3508                      error(xhr.status);
3509                  }
3510              }
3511          };
3512  
3513          xhr.send();
3514      }
3515  }
3516  
3517  _mejs2.default.Utils = _mejs2.default.Utils || {};
3518  _mejs2.default.Utils.offset = offset;
3519  _mejs2.default.Utils.hasClass = hasClass;
3520  _mejs2.default.Utils.addClass = addClass;
3521  _mejs2.default.Utils.removeClass = removeClass;
3522  _mejs2.default.Utils.toggleClass = toggleClass;
3523  _mejs2.default.Utils.fadeIn = fadeIn;
3524  _mejs2.default.Utils.fadeOut = fadeOut;
3525  _mejs2.default.Utils.siblings = siblings;
3526  _mejs2.default.Utils.visible = visible;
3527  _mejs2.default.Utils.ajax = ajax;
3528  _mejs2.default.Utils.loadScript = loadScript;
3529  
3530  },{"2":2,"3":3,"7":7}],18:[function(_dereq_,module,exports){
3531  'use strict';
3532  
3533  Object.defineProperty(exports, "__esModule", {
3534      value: true
3535  });
3536  exports.escapeHTML = escapeHTML;
3537  exports.debounce = debounce;
3538  exports.isObjectEmpty = isObjectEmpty;
3539  exports.splitEvents = splitEvents;
3540  exports.createEvent = createEvent;
3541  exports.isNodeAfter = isNodeAfter;
3542  exports.isString = isString;
3543  
3544  var _mejs = _dereq_(7);
3545  
3546  var _mejs2 = _interopRequireDefault(_mejs);
3547  
3548  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3549  
3550  function escapeHTML(input) {
3551  
3552      if (typeof input !== 'string') {
3553          throw new Error('Argument passed must be a string');
3554      }
3555  
3556      var map = {
3557          '&': '&amp;',
3558          '<': '&lt;',
3559          '>': '&gt;',
3560          '"': '&quot;'
3561      };
3562  
3563      return input.replace(/[&<>"]/g, function (c) {
3564          return map[c];
3565      });
3566  }
3567  
3568  function debounce(func, wait) {
3569      var _this = this,
3570          _arguments = arguments;
3571  
3572      var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3573  
3574  
3575      if (typeof func !== 'function') {
3576          throw new Error('First argument must be a function');
3577      }
3578  
3579      if (typeof wait !== 'number') {
3580          throw new Error('Second argument must be a numeric value');
3581      }
3582  
3583      var timeout = void 0;
3584      return function () {
3585          var context = _this,
3586              args = _arguments;
3587          var later = function later() {
3588              timeout = null;
3589              if (!immediate) {
3590                  func.apply(context, args);
3591              }
3592          };
3593          var callNow = immediate && !timeout;
3594          clearTimeout(timeout);
3595          timeout = setTimeout(later, wait);
3596  
3597          if (callNow) {
3598              func.apply(context, args);
3599          }
3600      };
3601  }
3602  
3603  function isObjectEmpty(instance) {
3604      return Object.getOwnPropertyNames(instance).length <= 0;
3605  }
3606  
3607  function splitEvents(events, id) {
3608      var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;
3609  
3610      var ret = { d: [], w: [] };
3611      (events || '').split(' ').forEach(function (v) {
3612          var eventName = '' + v + (id ? '.' + id : '');
3613  
3614          if (eventName.startsWith('.')) {
3615              ret.d.push(eventName);
3616              ret.w.push(eventName);
3617          } else {
3618              ret[rwindow.test(v) ? 'w' : 'd'].push(eventName);
3619          }
3620      });
3621  
3622      ret.d = ret.d.join(' ');
3623      ret.w = ret.w.join(' ');
3624      return ret;
3625  }
3626  
3627  function createEvent(eventName, target) {
3628  
3629      if (typeof eventName !== 'string') {
3630          throw new Error('Event name must be a string');
3631      }
3632  
3633      var eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i),
3634          detail = {
3635          target: target
3636      };
3637  
3638      if (eventFrags !== null) {
3639          eventName = eventFrags[1];
3640          detail.namespace = eventFrags[2];
3641      }
3642  
3643      return new window.CustomEvent(eventName, {
3644          detail: detail
3645      });
3646  }
3647  
3648  function isNodeAfter(sourceNode, targetNode) {
3649  
3650      return !!(sourceNode && targetNode && sourceNode.compareDocumentPosition(targetNode) & 2);
3651  }
3652  
3653  function isString(value) {
3654      return typeof value === 'string';
3655  }
3656  
3657  _mejs2.default.Utils = _mejs2.default.Utils || {};
3658  _mejs2.default.Utils.escapeHTML = escapeHTML;
3659  _mejs2.default.Utils.debounce = debounce;
3660  _mejs2.default.Utils.isObjectEmpty = isObjectEmpty;
3661  _mejs2.default.Utils.splitEvents = splitEvents;
3662  _mejs2.default.Utils.createEvent = createEvent;
3663  _mejs2.default.Utils.isNodeAfter = isNodeAfter;
3664  _mejs2.default.Utils.isString = isString;
3665  
3666  },{"7":7}],19:[function(_dereq_,module,exports){
3667  'use strict';
3668  
3669  Object.defineProperty(exports, "__esModule", {
3670      value: true
3671  });
3672  exports.typeChecks = undefined;
3673  exports.absolutizeUrl = absolutizeUrl;
3674  exports.formatType = formatType;
3675  exports.getMimeFromType = getMimeFromType;
3676  exports.getTypeFromFile = getTypeFromFile;
3677  exports.getExtension = getExtension;
3678  exports.normalizeExtension = normalizeExtension;
3679  
3680  var _mejs = _dereq_(7);
3681  
3682  var _mejs2 = _interopRequireDefault(_mejs);
3683  
3684  var _general = _dereq_(18);
3685  
3686  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3687  
3688  var typeChecks = exports.typeChecks = [];
3689  
3690  function absolutizeUrl(url) {
3691  
3692      if (typeof url !== 'string') {
3693          throw new Error('`url` argument must be a string');
3694      }
3695  
3696      var el = document.createElement('div');
3697      el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>';
3698      return el.firstChild.href;
3699  }
3700  
3701  function formatType(url) {
3702      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
3703  
3704      return url && !type ? getTypeFromFile(url) : type;
3705  }
3706  
3707  function getMimeFromType(type) {
3708  
3709      if (typeof type !== 'string') {
3710          throw new Error('`type` argument must be a string');
3711      }
3712  
3713      return type && type.indexOf(';') > -1 ? type.substr(0, type.indexOf(';')) : type;
3714  }
3715  
3716  function getTypeFromFile(url) {
3717  
3718      if (typeof url !== 'string') {
3719          throw new Error('`url` argument must be a string');
3720      }
3721  
3722      for (var i = 0, total = typeChecks.length; i < total; i++) {
3723          var type = typeChecks[i](url);
3724  
3725          if (type) {
3726              return type;
3727          }
3728      }
3729  
3730      var ext = getExtension(url),
3731          normalizedExt = normalizeExtension(ext);
3732  
3733      var mime = 'video/mp4';
3734  
3735      if (normalizedExt) {
3736          if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) {
3737              mime = 'video/' + normalizedExt;
3738          } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) {
3739              mime = 'audio/' + normalizedExt;
3740          }
3741      }
3742  
3743      return mime;
3744  }
3745  
3746  function getExtension(url) {
3747  
3748      if (typeof url !== 'string') {
3749          throw new Error('`url` argument must be a string');
3750      }
3751  
3752      var baseUrl = url.split('?')[0],
3753          baseName = baseUrl.split('\\').pop().split('/').pop();
3754      return ~baseName.indexOf('.') ? baseName.substring(baseName.lastIndexOf('.') + 1) : '';
3755  }
3756  
3757  function normalizeExtension(extension) {
3758  
3759      if (typeof extension !== 'string') {
3760          throw new Error('`extension` argument must be a string');
3761      }
3762  
3763      switch (extension) {
3764          case 'mp4':
3765          case 'm4v':
3766              return 'mp4';
3767          case 'webm':
3768          case 'webma':
3769          case 'webmv':
3770              return 'webm';
3771          case 'ogg':
3772          case 'oga':
3773          case 'ogv':
3774              return 'ogg';
3775          default:
3776              return extension;
3777      }
3778  }
3779  
3780  _mejs2.default.Utils = _mejs2.default.Utils || {};
3781  _mejs2.default.Utils.typeChecks = typeChecks;
3782  _mejs2.default.Utils.absolutizeUrl = absolutizeUrl;
3783  _mejs2.default.Utils.formatType = formatType;
3784  _mejs2.default.Utils.getMimeFromType = getMimeFromType;
3785  _mejs2.default.Utils.getTypeFromFile = getTypeFromFile;
3786  _mejs2.default.Utils.getExtension = getExtension;
3787  _mejs2.default.Utils.normalizeExtension = normalizeExtension;
3788  
3789  },{"18":18,"7":7}],20:[function(_dereq_,module,exports){
3790  'use strict';
3791  
3792  var _document = _dereq_(2);
3793  
3794  var _document2 = _interopRequireDefault(_document);
3795  
3796  var _promisePolyfill = _dereq_(4);
3797  
3798  var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill);
3799  
3800  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3801  
3802  (function (arr) {
3803      arr.forEach(function (item) {
3804          if (item.hasOwnProperty('remove')) {
3805              return;
3806          }
3807          Object.defineProperty(item, 'remove', {
3808              configurable: true,
3809              enumerable: true,
3810              writable: true,
3811              value: function remove() {
3812                  this.parentNode.removeChild(this);
3813              }
3814          });
3815      });
3816  })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
3817  
3818  (function () {
3819  
3820      if (typeof window.CustomEvent === 'function') {
3821          return false;
3822      }
3823  
3824      function CustomEvent(event, params) {
3825          params = params || { bubbles: false, cancelable: false, detail: undefined };
3826          var evt = _document2.default.createEvent('CustomEvent');
3827          evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
3828          return evt;
3829      }
3830  
3831      CustomEvent.prototype = window.Event.prototype;
3832      window.CustomEvent = CustomEvent;
3833  })();
3834  
3835  if (typeof Object.assign !== 'function') {
3836      Object.assign = function (target) {
3837  
3838          if (target === null || target === undefined) {
3839              throw new TypeError('Cannot convert undefined or null to object');
3840          }
3841  
3842          var to = Object(target);
3843  
3844          for (var index = 1, total = arguments.length; index < total; index++) {
3845              var nextSource = arguments[index];
3846  
3847              if (nextSource !== null) {
3848                  for (var nextKey in nextSource) {
3849                      if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
3850                          to[nextKey] = nextSource[nextKey];
3851                      }
3852                  }
3853              }
3854          }
3855          return to;
3856      };
3857  }
3858  
3859  if (!String.prototype.startsWith) {
3860      String.prototype.startsWith = function (searchString, position) {
3861          position = position || 0;
3862          return this.substr(position, searchString.length) === searchString;
3863      };
3864  }
3865  
3866  if (!Element.prototype.matches) {
3867      Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) {
3868          var matches = (this.document || this.ownerDocument).querySelectorAll(s),
3869              i = matches.length - 1;
3870          while (--i >= 0 && matches.item(i) !== this) {}
3871          return i > -1;
3872      };
3873  }
3874  
3875  if (window.Element && !Element.prototype.closest) {
3876      Element.prototype.closest = function (s) {
3877          var matches = (this.document || this.ownerDocument).querySelectorAll(s),
3878              i = void 0,
3879              el = this;
3880          do {
3881              i = matches.length;
3882              while (--i >= 0 && matches.item(i) !== el) {}
3883          } while (i < 0 && (el = el.parentElement));
3884          return el;
3885      };
3886  }
3887  
3888  (function () {
3889      var lastTime = 0;
3890      var vendors = ['ms', 'moz', 'webkit', 'o'];
3891      for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
3892          window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
3893          window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
3894      }
3895  
3896      if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback) {
3897          var currTime = new Date().getTime();
3898          var timeToCall = Math.max(0, 16 - (currTime - lastTime));
3899          var id = window.setTimeout(function () {
3900              callback(currTime + timeToCall);
3901          }, timeToCall);
3902          lastTime = currTime + timeToCall;
3903          return id;
3904      };
3905  
3906      if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {
3907          clearTimeout(id);
3908      };
3909  })();
3910  
3911  if (/firefox/i.test(navigator.userAgent)) {
3912      var getComputedStyle = window.getComputedStyle;
3913      window.getComputedStyle = function (el, pseudoEl) {
3914          var t = getComputedStyle(el, pseudoEl);
3915          return t === null ? { getPropertyValue: function getPropertyValue() {} } : t;
3916      };
3917  }
3918  
3919  if (!window.Promise) {
3920      window.Promise = _promisePolyfill2.default;
3921  }
3922  
3923  (function (constructor) {
3924      if (constructor && constructor.prototype && constructor.prototype.children === null) {
3925          Object.defineProperty(constructor.prototype, 'children', {
3926              get: function get() {
3927                  var i = 0,
3928                      node = void 0,
3929                      nodes = this.childNodes,
3930                      children = [];
3931                  while (node = nodes[i++]) {
3932                      if (node.nodeType === 1) {
3933                          children.push(node);
3934                      }
3935                  }
3936                  return children;
3937              }
3938          });
3939      }
3940  })(window.Node || window.Element);
3941  
3942  },{"2":2,"4":4}]},{},[20,6,5,9,14,11,10,12,13,15]);


Generated: Tue Sep 17 01:00:03 2019 Cross-referenced by PHPXref 0.7.1