@clappr/player 0.11.9 → 0.11.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/clappr.js CHANGED
@@ -2208,9 +2208,7 @@
2208
2208
  // Skip over if undefined or null
2209
2209
  for (var nextKey in nextSource) {
2210
2210
  // Avoid bugs when hasOwnProperty is shadowed
2211
- if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
2212
- to[nextKey] = nextSource[nextKey];
2213
- }
2211
+ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) to[nextKey] = nextSource[nextKey];
2214
2212
  }
2215
2213
  }
2216
2214
  }
@@ -2226,18 +2224,14 @@
2226
2224
  Object.defineProperty(Array.prototype, 'findIndex', {
2227
2225
  value: function value(predicate) {
2228
2226
  // 1. Let O be ? ToObject(this value).
2229
- if (this == null) {
2230
- throw new TypeError('"this" is null or not defined');
2231
- }
2227
+ if (this == null) throw new TypeError('"this" is null or not defined');
2232
2228
  var o = Object(this);
2233
2229
 
2234
2230
  // 2. Let len be ? ToLength(? Get(O, "length")).
2235
2231
  var len = o.length >>> 0;
2236
2232
 
2237
2233
  // 3. If IsCallable(predicate) is false, throw a TypeError exception.
2238
- if (typeof predicate !== 'function') {
2239
- throw new TypeError('predicate must be a function');
2240
- }
2234
+ if (typeof predicate !== 'function') throw new TypeError('predicate must be a function');
2241
2235
 
2242
2236
  // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
2243
2237
  var thisArg = arguments[1];
@@ -2252,9 +2246,8 @@
2252
2246
  // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
2253
2247
  // d. If testResult is true, return k.
2254
2248
  var kValue = o[k];
2255
- if (predicate.call(thisArg, kValue, k, o)) {
2256
- return k;
2257
- }
2249
+ if (predicate.call(thisArg, kValue, k, o)) return k;
2250
+
2258
2251
  // e. Increase k by 1.
2259
2252
  k++;
2260
2253
  }
@@ -2532,8 +2525,8 @@
2532
2525
  }
2533
2526
  };
2534
2527
  var getBrowserInfo = function getBrowserInfo(ua) {
2535
- var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [],
2536
- extra;
2528
+ var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
2529
+ var extra;
2537
2530
  if (/trident/i.test(parts[1])) {
2538
2531
  extra = /\brv[ :]+(\d+)/g.exec(ua) || [];
2539
2532
  return {
@@ -2583,7 +2576,9 @@
2583
2576
  if (browser.versionIdentifier) {
2584
2577
  var versionRegExp = new RegExp(browser.versionIdentifier.toLowerCase());
2585
2578
  var versionRegExpResult = versionRegExp.exec(userAgent);
2586
- if (versionRegExpResult != null && versionRegExpResult[1]) setBrowserVersion(versionRegExpResult[1], browserObject);
2579
+ if (versionRegExpResult != null && versionRegExpResult[1]) {
2580
+ setBrowserVersion(versionRegExpResult[1], browserObject);
2581
+ }
2587
2582
  } else {
2588
2583
  setBrowserVersion(browserRegExpResult[1], browserObject);
2589
2584
  }
@@ -2639,7 +2634,9 @@
2639
2634
  } else if (os.versionIdentifier) {
2640
2635
  var versionRegExp = new RegExp(os.versionIdentifier.toLowerCase());
2641
2636
  var versionRegExpResult = versionRegExp.exec(userAgent);
2642
- if (versionRegExpResult != null && versionRegExpResult[1]) setOsVersion(versionRegExpResult[1], os.versionSeparator ? os.versionSeparator : '.', osObject);
2637
+ if (versionRegExpResult != null && versionRegExpResult[1]) {
2638
+ setOsVersion(versionRegExpResult[1], os.versionSeparator ? os.versionSeparator : '.', osObject);
2639
+ }
2643
2640
  }
2644
2641
  break;
2645
2642
  }
@@ -2654,16 +2651,20 @@
2654
2651
 
2655
2652
  // Set OS version
2656
2653
  var setOsVersion = function setOsVersion(version, separator, osObject) {
2657
- var finalSeparator = separator.substr(0, 1) == '[' ? new RegExp(separator, 'g') : separator;
2654
+ var finalSeparator = separator.substr(0, 1) === '[' ? new RegExp(separator, 'g') : separator;
2658
2655
  var splitVersion = version.split(finalSeparator, 2);
2659
- if (separator != '.') version = version.replace(new RegExp(separator, 'g'), '.');
2656
+ if (separator !== '.') version = version.replace(new RegExp(separator, 'g'), '.');
2660
2657
  osObject.fullVersion = version;
2661
2658
 
2662
2659
  // Major version
2663
- if (splitVersion && splitVersion[0]) osObject.majorVersion = parseInt(splitVersion[0]);
2660
+ if (splitVersion && splitVersion[0]) {
2661
+ osObject.majorVersion = parseInt(splitVersion[0]);
2662
+ }
2664
2663
 
2665
2664
  // Minor version
2666
- if (splitVersion && splitVersion[1]) osObject.minorVersion = parseInt(splitVersion[1]);
2665
+ if (splitVersion && splitVersion[1]) {
2666
+ osObject.minorVersion = parseInt(splitVersion[1]);
2667
+ }
2667
2668
  };
2668
2669
 
2669
2670
  // Set viewport size
@@ -2712,17 +2713,17 @@
2712
2713
  Browser.hasFlash = hasFlash();
2713
2714
 
2714
2715
  /**
2715
- * @deprecated
2716
- * This parameter currently exists for retrocompatibility reasons.
2717
- * Use Browser.data.name instead.
2718
- */
2716
+ * @deprecated
2717
+ * This parameter currently exists for retrocompatibility reasons.
2718
+ * Use Browser.data.name instead.
2719
+ */
2719
2720
  Browser.name = browserInfo.name;
2720
2721
 
2721
2722
  /**
2722
- * @deprecated
2723
- * This parameter currently exists for retrocompatibility reasons.
2724
- * Use Browser.data.fullVersion instead.
2725
- */
2723
+ * @deprecated
2724
+ * This parameter currently exists for retrocompatibility reasons.
2725
+ * Use Browser.data.fullVersion instead.
2726
+ */
2726
2727
  Browser.version = browserInfo.version;
2727
2728
  Browser.userAgent = navigator.userAgent;
2728
2729
  Browser.data = getBrowserData();
@@ -2757,7 +2758,9 @@
2757
2758
  args[_key] = arguments[_key];
2758
2759
  }
2759
2760
  _this = _callSuper$2(this, Surrogate, [].concat(args));
2760
- if (properties.initialize) properties.initialize.apply(_this, args);
2761
+ if (properties.initialize) {
2762
+ properties.initialize.apply(_this, args);
2763
+ }
2761
2764
  return _this;
2762
2765
  }
2763
2766
  _inherits$2(Surrogate, _parent);
@@ -2815,7 +2818,17 @@
2815
2818
  },
2816
2819
  cancelFullscreen: function cancelFullscreen() {
2817
2820
  var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
2818
- if (el.exitFullscreen) el.exitFullscreen();else if (el.webkitCancelFullScreen) el.webkitCancelFullScreen();else if (el.webkitExitFullscreen) el.webkitExitFullscreen();else if (el.mozCancelFullScreen) el.mozCancelFullScreen();else if (el.msExitFullscreen) el.msExitFullscreen();
2821
+ if (el.exitFullscreen) {
2822
+ el.exitFullscreen();
2823
+ } else if (el.webkitCancelFullScreen) {
2824
+ el.webkitCancelFullScreen();
2825
+ } else if (el.webkitExitFullscreen) {
2826
+ el.webkitExitFullscreen();
2827
+ } else if (el.mozCancelFullScreen) {
2828
+ el.mozCancelFullScreen();
2829
+ } else if (el.msExitFullscreen) {
2830
+ el.msExitFullscreen();
2831
+ }
2819
2832
  },
2820
2833
  fullscreenEnabled: function fullscreenEnabled() {
2821
2834
  return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
@@ -2852,7 +2865,9 @@
2852
2865
  }, {
2853
2866
  key: "restore",
2854
2867
  value: function restore(key) {
2855
- if (Browser.hasLocalstorage && localStorage[this._createKeyspace(key)]) return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
2868
+ if (Browser.hasLocalstorage && localStorage[this._createKeyspace(key)]) {
2869
+ return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
2870
+ }
2856
2871
  return this._defaultValueFor(key);
2857
2872
  }
2858
2873
  }, {
@@ -2897,13 +2912,12 @@
2897
2912
  key: "parse",
2898
2913
  value: function parse(paramsString) {
2899
2914
  var match;
2900
- var pl = /\+/g,
2901
- // Regex for replacing addition symbol with a space
2902
- search = /([^&=]+)=?([^&]*)/g,
2903
- decode = function decode(s) {
2904
- return decodeURIComponent(s.replace(pl, ' '));
2905
- },
2906
- params = {};
2915
+ var pl = /\+/g; // Regex for replacing addition symbol with a space
2916
+ var search = /([^&=]+)=?([^&]*)/g;
2917
+ var decode = function decode(s) {
2918
+ return decodeURIComponent(s.replace(pl, ' '));
2919
+ };
2920
+ var params = {};
2907
2921
  while (match = search.exec(paramsString)) {
2908
2922
  // eslint-disable-line no-cond-assign
2909
2923
  params[decode(match[1]).toLowerCase()] = decode(match[2]);
@@ -2951,14 +2965,18 @@
2951
2965
  return window.navigator && window.navigator.language;
2952
2966
  }
2953
2967
  function now$2() {
2954
- if (window.performance && window.performance.now) return performance.now();
2968
+ if (window.performance && window.performance.now) {
2969
+ return performance.now();
2970
+ }
2955
2971
  return Date.now();
2956
2972
  }
2957
2973
 
2958
2974
  // remove the item from the array if it exists in the array
2959
2975
  function removeArrayItem$1(arr, item) {
2960
2976
  var i = arr.indexOf(item);
2961
- if (i >= 0) arr.splice(i, 1);
2977
+ if (i >= 0) {
2978
+ arr.splice(i, 1);
2979
+ }
2962
2980
  }
2963
2981
 
2964
2982
  // find an item regardless of its letter case
@@ -2981,8 +2999,12 @@
2981
2999
  }, options);
2982
3000
  var element = options.element ? options.element : document.createElement(options.type);
2983
3001
  element.muted = options.muted;
2984
- if (options.muted === true) element.setAttribute('muted', 'muted');
2985
- if (options.inline === true) element.setAttribute('playsinline', 'playsinline');
3002
+ if (options.muted === true) {
3003
+ element.setAttribute('muted', 'muted');
3004
+ }
3005
+ if (options.inline === true) {
3006
+ element.setAttribute('playsinline', 'playsinline');
3007
+ }
2986
3008
  element.src = options.source;
2987
3009
  var promise = element.play();
2988
3010
  var timeoutId = setTimeout(function () {
@@ -3017,7 +3039,9 @@
3017
3039
  }, {
3018
3040
  key: "create",
3019
3041
  value: function create(name) {
3020
- if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) return videoStack.shift();
3042
+ if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) {
3043
+ return videoStack.shift();
3044
+ }
3021
3045
  return document.createElement(name);
3022
3046
  }
3023
3047
  }, {
@@ -3156,7 +3180,9 @@
3156
3180
  }
3157
3181
  var color = COLORS[level];
3158
3182
  var klassDescription = '';
3159
- if (klass) klassDescription = '[' + klass + ']';
3183
+ if (klass) {
3184
+ klassDescription = '[' + klass + ']';
3185
+ }
3160
3186
  window.console && window.console.log && window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));
3161
3187
  }
3162
3188
  }]);
@@ -3166,7 +3192,9 @@
3166
3192
  Log.LEVEL_WARN = LEVEL_WARN;
3167
3193
  Log.LEVEL_ERROR = LEVEL_ERROR;
3168
3194
  Log.getInstance = function () {
3169
- if (this._instance === undefined) this._instance = new this();
3195
+ if (this._instance === undefined) {
3196
+ this._instance = new this();
3197
+ }
3170
3198
  return this._instance;
3171
3199
  };
3172
3200
  Log.setLevel = function (level) {
@@ -3191,25 +3219,29 @@
3191
3219
 
3192
3220
  // Handle event maps.
3193
3221
  if (_typeof$1(name) === 'object') {
3194
- for (var key in name) obj[action].apply(obj, [key, name[key]].concat(rest));
3222
+ for (var key in name) {
3223
+ obj[action].apply(obj, [key, name[key]].concat(rest));
3224
+ }
3195
3225
  return false;
3196
3226
  }
3197
3227
 
3198
3228
  // Handle space separated event names.
3199
3229
  if (eventSplitter.test(name)) {
3200
3230
  var names = name.split(eventSplitter);
3201
- for (var i = 0, l = names.length; i < l; i++) obj[action].apply(obj, [names[i]].concat(rest));
3231
+ for (var i = 0, l = names.length; i < l; i++) {
3232
+ obj[action].apply(obj, [names[i]].concat(rest));
3233
+ }
3202
3234
  return false;
3203
3235
  }
3204
3236
  return true;
3205
3237
  };
3206
3238
  var triggerEvents = function triggerEvents(events, args, klass, name) {
3207
- var ev,
3208
- i = -1;
3209
- var l = events.length,
3210
- a1 = args[0],
3211
- a2 = args[1],
3212
- a3 = args[2];
3239
+ var ev;
3240
+ var i = -1;
3241
+ var l = events.length;
3242
+ var a1 = args[0];
3243
+ var a2 = args[1];
3244
+ var a3 = args[2];
3213
3245
  run();
3214
3246
  function run() {
3215
3247
  try {
@@ -3217,32 +3249,37 @@
3217
3249
  /* eslint-disable curly */
3218
3250
  case 0:
3219
3251
  while (++i < l) {
3220
- (ev = events[i]).callback.call(ev.ctx);
3252
+ ev = events[i];
3253
+ ev.callback.call(ev.ctx);
3221
3254
  }
3222
3255
  return;
3223
3256
  case 1:
3224
3257
  while (++i < l) {
3225
- (ev = events[i]).callback.call(ev.ctx, a1);
3258
+ ev = events[i];
3259
+ ev.callback.call(ev.ctx, a1);
3226
3260
  }
3227
3261
  return;
3228
3262
  case 2:
3229
3263
  while (++i < l) {
3230
- (ev = events[i]).callback.call(ev.ctx, a1, a2);
3264
+ ev = events[i];
3265
+ ev.callback.call(ev.ctx, a1, a2);
3231
3266
  }
3232
3267
  return;
3233
3268
  case 3:
3234
3269
  while (++i < l) {
3235
- (ev = events[i]).callback.call(ev.ctx, a1, a2, a3);
3270
+ ev = events[i];
3271
+ ev.callback.call(ev.ctx, a1, a2, a3);
3236
3272
  }
3237
3273
  return;
3238
3274
  default:
3239
3275
  while (++i < l) {
3240
- (ev = events[i]).callback.apply(ev.ctx, args);
3276
+ ev = events[i];
3277
+ ev.callback.apply(ev.ctx, args);
3241
3278
  }
3242
3279
  return;
3243
3280
  }
3244
3281
  } catch (exception) {
3245
- Log.error.apply(Log, [klass, 'error on event', name, 'trigger', '-', exception]);
3282
+ Log.error.apply(Log, [klass, 'error on event', name, 'trigger', '-', exception]); // eslint-disable-line
3246
3283
  run();
3247
3284
  }
3248
3285
  }
@@ -3290,12 +3327,11 @@
3290
3327
  key: "once",
3291
3328
  value: function _once(name, callback, context) {
3292
3329
  var _this = this;
3293
- var _once;
3294
3330
  if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
3295
3331
  var off = function off() {
3296
3332
  return _this.off(name, _once);
3297
3333
  };
3298
- _once = function once() {
3334
+ var _once = function once() {
3299
3335
  off();
3300
3336
  callback.apply(this, arguments);
3301
3337
  };
@@ -3313,13 +3349,13 @@
3313
3349
  }, {
3314
3350
  key: "off",
3315
3351
  value: function off(name, callback, context) {
3316
- var retain, ev, events, names, i, l, j, k;
3352
+ var retain, ev, events, i, l, j, k;
3317
3353
  if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
3318
3354
  if (!name && !callback && !context) {
3319
3355
  this._events = void 0;
3320
3356
  return this;
3321
3357
  }
3322
- names = name ? [name] : Object.keys(this._events);
3358
+ var names = name ? [name] : Object.keys(this._events);
3323
3359
  // jshint maxdepth:5
3324
3360
  for (i = 0, l = names.length; i < l; i++) {
3325
3361
  name = names[i];
@@ -3755,7 +3791,7 @@
3755
3791
  *
3756
3792
  * @event PLAYBACK_FRAGMENT_BUFFERED
3757
3793
  * @param {Object} data Data
3758
- *
3794
+ *
3759
3795
  */
3760
3796
  Events$1.PLAYBACK_FRAGMENT_BUFFERED = 'playback:fragment:buffered';
3761
3797
  // TODO doc
@@ -3813,11 +3849,11 @@
3813
3849
  Events$1.CORE_ACTIVE_CONTAINER_CHANGED = 'core:active:container:changed';
3814
3850
 
3815
3851
  /**
3816
- * Fired before options are changed in core
3817
- *
3818
- * @event CORE_OPTIONS_WILL_CHANGE
3819
- * @param {Object} current options before change
3820
- */
3852
+ * Fired before options are changed in core
3853
+ *
3854
+ * @event CORE_OPTIONS_WILL_CHANGE
3855
+ * @param {Object} current options before change
3856
+ */
3821
3857
  Events$1.CORE_OPTIONS_WILL_CHANGE = 'core:options:will:change';
3822
3858
 
3823
3859
  /**
@@ -3959,10 +3995,10 @@
3959
3995
  Events$1.CONTAINER_AUDIO_AVAILABLE = 'container:audio:available';
3960
3996
 
3961
3997
  /**
3962
- * Fired whenever the current audio track has changed
3963
- * @event CONTAINER_AUDIO_CHANGED
3964
- * @param {import('../playback/playback').AudioTrack} track - audio track active after change
3965
- */
3998
+ * Fired whenever the current audio track has changed
3999
+ * @event CONTAINER_AUDIO_CHANGED
4000
+ * @param {import('../playback/playback').AudioTrack} track - audio track active after change
4001
+ */
3966
4002
  Events$1.CONTAINER_AUDIO_CHANGED = 'container:audio:changed';
3967
4003
 
3968
4004
  /**
@@ -4481,10 +4517,14 @@
4481
4517
  if (method && method.constructor !== Function) method = this[events[key]];
4482
4518
  if (!method) continue;
4483
4519
  var match = key.match(delegateEventSplitter);
4484
- var eventName = match[1],
4485
- selector = match[2];
4520
+ var eventName = match[1];
4521
+ var selector = match[2];
4486
4522
  eventName += '.delegateEvents' + this.cid;
4487
- if (selector === '') this.$el.on(eventName, method.bind(this));else this.$el.on(eventName, selector, method.bind(this));
4523
+ if (selector === '') {
4524
+ this.$el.on(eventName, method.bind(this));
4525
+ } else {
4526
+ this.$el.on(eventName, selector, method.bind(this));
4527
+ }
4488
4528
  }
4489
4529
  return this;
4490
4530
  }
@@ -4512,7 +4552,7 @@
4512
4552
  if (!this.el) {
4513
4553
  var attrs = $.extend(true, {}, this.attributes);
4514
4554
  if (this.id) attrs.id = this.id;
4515
- if (this.className) attrs['class'] = this.className;
4555
+ if (this.className) attrs["class"] = this.className;
4516
4556
  var $el = $(DomRecycler.create(this.tagName)).attr(attrs);
4517
4557
  this.setElement($el, false);
4518
4558
  } else {
@@ -4629,7 +4669,7 @@
4629
4669
  var errorData = Object.assign({}, defaultError, error, {
4630
4670
  code: options.useCodePrefix ? prefixedCode : error.code
4631
4671
  });
4632
- if (i18n && errorData.level == PlayerError.Levels.FATAL && !errorData.UI) {
4672
+ if (i18n && errorData.level === PlayerError.Levels.FATAL && !errorData.UI) {
4633
4673
  var defaultUI = {
4634
4674
  title: i18n.t('default_error_title'),
4635
4675
  message: i18n.t('default_error_message')
@@ -5053,7 +5093,9 @@
5053
5093
  }, {
5054
5094
  key: "error",
5055
5095
  value: function error(_error) {
5056
- if (!this.isReady) this.ready();
5096
+ if (!this.isReady) {
5097
+ this.ready();
5098
+ }
5057
5099
  this.trigger(Events$1.CONTAINER_ERROR, _error, this.name);
5058
5100
  }
5059
5101
  }, {
@@ -5184,7 +5226,9 @@
5184
5226
  }, {
5185
5227
  key: "onContextMenu",
5186
5228
  value: function onContextMenu(event) {
5187
- if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(Events$1.CONTAINER_CONTEXTMENU, event, this.name);
5229
+ if (!this.options.chromeless || this.options.allowUserInteraction) {
5230
+ this.trigger(Events$1.CONTAINER_CONTEXTMENU, event, this.name);
5231
+ }
5188
5232
  }
5189
5233
  }, {
5190
5234
  key: "seek",
@@ -5281,22 +5325,30 @@
5281
5325
  }, {
5282
5326
  key: "mouseEnter",
5283
5327
  value: function mouseEnter() {
5284
- if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(Events$1.CONTAINER_MOUSE_ENTER);
5328
+ if (!this.options.chromeless || this.options.allowUserInteraction) {
5329
+ this.trigger(Events$1.CONTAINER_MOUSE_ENTER);
5330
+ }
5285
5331
  }
5286
5332
  }, {
5287
5333
  key: "mouseLeave",
5288
5334
  value: function mouseLeave() {
5289
- if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(Events$1.CONTAINER_MOUSE_LEAVE);
5335
+ if (!this.options.chromeless || this.options.allowUserInteraction) {
5336
+ this.trigger(Events$1.CONTAINER_MOUSE_LEAVE);
5337
+ }
5290
5338
  }
5291
5339
  }, {
5292
5340
  key: "mouseUp",
5293
5341
  value: function mouseUp() {
5294
- if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(Events$1.CONTAINER_MOUSE_UP);
5342
+ if (!this.options.chromeless || this.options.allowUserInteraction) {
5343
+ this.trigger(Events$1.CONTAINER_MOUSE_UP);
5344
+ }
5295
5345
  }
5296
5346
  }, {
5297
5347
  key: "mouseDown",
5298
5348
  value: function mouseDown() {
5299
- if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(Events$1.CONTAINER_MOUSE_DOWN);
5349
+ if (!this.options.chromeless || this.options.allowUserInteraction) {
5350
+ this.trigger(Events$1.CONTAINER_MOUSE_DOWN);
5351
+ }
5300
5352
  }
5301
5353
  }, {
5302
5354
  key: "enterPiP",
@@ -5343,7 +5395,11 @@
5343
5395
  }, {
5344
5396
  key: "updateStyle",
5345
5397
  value: function updateStyle() {
5346
- if (!this.options.chromeless || this.options.allowUserInteraction) this.$el.removeClass('chromeless');else this.$el.addClass('chromeless');
5398
+ if (!this.options.chromeless || this.options.allowUserInteraction) {
5399
+ this.$el.removeClass('chromeless');
5400
+ } else {
5401
+ this.$el.addClass('chromeless');
5402
+ }
5347
5403
  }
5348
5404
  }, {
5349
5405
  key: "enableResizeObserver",
@@ -5634,6 +5690,17 @@
5634
5690
  return 0;
5635
5691
  }
5636
5692
 
5693
+ /**
5694
+ * gets the frame rate of the current source
5695
+ * @method getFrameRate
5696
+ * @return {Number|null} frame rate (fps) of the current source, or null if unavailable
5697
+ */
5698
+ }, {
5699
+ key: "getFrameRate",
5700
+ value: function getFrameRate() {
5701
+ return null;
5702
+ }
5703
+
5637
5704
  /**
5638
5705
  * checks if the playback is playing.
5639
5706
  * @method isPlaying
@@ -5943,7 +6010,8 @@
5943
6010
  var playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType);
5944
6011
 
5945
6012
  // Fallback to empty playback object until we sort out unsupported sources error without NoOp playback
5946
- var playback = playbackPlugin ? new playbackPlugin(options, this._i18n, this.playerError) : new Playback();
6013
+ var playback = playbackPlugin ? new playbackPlugin(options, this._i18n, this.playerError) // eslint-disable-line
6014
+ : new Playback();
5947
6015
  options = _objectSpread2$2(_objectSpread2$2({}, options), {}, {
5948
6016
  playback: playback
5949
6017
  });
@@ -5986,7 +6054,7 @@
5986
6054
  _this.styleRendered = false;
5987
6055
  _this.plugins = [];
5988
6056
  _this.containers = [];
5989
- //FIXME fullscreen api sucks
6057
+ // FIXME fullscreen api sucks
5990
6058
  _this._boundFullscreenHandler = function () {
5991
6059
  return _this.handleFullscreenChange();
5992
6060
  };
@@ -6532,7 +6600,9 @@
6532
6600
  key: "setupExternalInterface",
6533
6601
  value: function setupExternalInterface(plugin) {
6534
6602
  var externalFunctions = plugin.getExternalInterface();
6535
- for (var key in externalFunctions) this.player[key] = externalFunctions[key].bind(plugin);
6603
+ for (var key in externalFunctions) {
6604
+ this.player[key] = externalFunctions[key].bind(plugin);
6605
+ }
6536
6606
  }
6537
6607
  }]);
6538
6608
  }(BaseObject);
@@ -6593,7 +6663,8 @@
6593
6663
  var _ref4 = _slicedToArray(_ref3, 2),
6594
6664
  key = _ref4[0],
6595
6665
  value = _ref4[1];
6596
- return obj[key] = value, obj;
6666
+ obj[key] = value;
6667
+ return obj;
6597
6668
  }, {});
6598
6669
  };
6599
6670
 
@@ -6609,7 +6680,7 @@
6609
6680
  plugins: {},
6610
6681
  playbacks: []
6611
6682
  };
6612
- var currentVersion = "0.12.0";
6683
+ var currentVersion = "0.13.0";
6613
6684
  return /*#__PURE__*/function () {
6614
6685
  /**
6615
6686
  * builds the loader
@@ -6635,7 +6706,6 @@
6635
6706
  /**
6636
6707
  * groups by type the external plugins that were passed through `options.plugins` it they're on a flat array
6637
6708
  * @method addExternalPlugins
6638
- * @private
6639
6709
  * @param {Object} an config object or an array of plugins
6640
6710
  * @return {Object} plugins the config object with the plugins separated by type
6641
6711
  */
@@ -6670,7 +6740,6 @@
6670
6740
  /**
6671
6741
  * adds all the external plugins that were passed through `options.plugins`
6672
6742
  * @method addExternalPlugins
6673
- * @private
6674
6743
  * @param {Object} plugins the config object with all plugins
6675
6744
  */
6676
6745
  }, {
@@ -6681,19 +6750,22 @@
6681
6750
  plugins = this.groupPluginsByType(plugins);
6682
6751
  if (plugins.playback) {
6683
6752
  var playbacks = plugins.playback.filter(function (playback) {
6684
- return Loader.checkVersionSupport(playback), true;
6753
+ Loader.checkVersionSupport(playback);
6754
+ return true;
6685
6755
  });
6686
6756
  this.playbackPlugins = loadExternalPlaybacksFirst ? this.removeDups(playbacks.concat(this.playbackPlugins)) : this.removeDups(this.playbackPlugins.concat(playbacks), true);
6687
6757
  }
6688
6758
  if (plugins.container) {
6689
6759
  var containerPlugins = plugins.container.filter(function (plugin) {
6690
- return Loader.checkVersionSupport(plugin), true;
6760
+ Loader.checkVersionSupport(plugin);
6761
+ return true;
6691
6762
  });
6692
6763
  this.containerPlugins = loadExternalPluginsFirst ? this.removeDups(containerPlugins.concat(this.containerPlugins)) : this.removeDups(this.containerPlugins.concat(containerPlugins), true);
6693
6764
  }
6694
6765
  if (plugins.core) {
6695
6766
  var corePlugins = plugins.core.filter(function (plugin) {
6696
- return Loader.checkVersionSupport(plugin), true;
6767
+ Loader.checkVersionSupport(plugin);
6768
+ return true;
6697
6769
  });
6698
6770
  this.corePlugins = loadExternalPluginsFirst ? this.removeDups(corePlugins.concat(this.corePlugins)) : this.removeDups(this.corePlugins.concat(corePlugins), true);
6699
6771
  }
@@ -6702,7 +6774,6 @@
6702
6774
  /**
6703
6775
  * validate if the external plugins that were passed through `options.plugins` are associated to the correct type
6704
6776
  * @method validateExternalPluginsType
6705
- * @private
6706
6777
  * @param {Object} plugins the config object with all plugins
6707
6778
  */
6708
6779
  }, {
@@ -6710,7 +6781,8 @@
6710
6781
  value: function validateExternalPluginsType(plugins) {
6711
6782
  var pluginTypes = ['playback', 'container', 'core'];
6712
6783
  pluginTypes.forEach(function (type) {
6713
- (plugins[type] || []).forEach(function (el) {
6784
+ var pluginsByType = plugins[type] || [];
6785
+ pluginsByType.forEach(function (el) {
6714
6786
  var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array';
6715
6787
  if (el.type !== type) throw new ReferenceError(errorMessage);
6716
6788
  });
@@ -6761,7 +6833,9 @@
6761
6833
  var pluginRegistry = registry.plugins;
6762
6834
  if (!pluginRegistry) return false;
6763
6835
  var previousEntry = pluginRegistry[pluginEntry.prototype.name];
6764
- if (previousEntry) Log.warn('Loader', "overriding plugin entry: ".concat(pluginEntry.prototype.name, " - ").concat(previousEntry));
6836
+ if (previousEntry) {
6837
+ Log.warn('Loader', "overriding plugin entry: ".concat(pluginEntry.prototype.name, " - ").concat(previousEntry));
6838
+ }
6765
6839
  pluginRegistry[pluginEntry.prototype.name] = pluginEntry;
6766
6840
  return true;
6767
6841
  }
@@ -7017,7 +7091,9 @@
7017
7091
  return _createClass$2(Player, [{
7018
7092
  key: "loader",
7019
7093
  get: function get() {
7020
- if (!this._loader) this._loader = new Loader(this.options.plugins || {}, this.options.playerId);
7094
+ if (!this._loader) {
7095
+ this._loader = new Loader(this.options.plugins || {}, this.options.playerId);
7096
+ }
7021
7097
  return this._loader;
7022
7098
  }
7023
7099
 
@@ -7107,7 +7183,11 @@
7107
7183
  }, {
7108
7184
  key: "_addEventListeners",
7109
7185
  value: function _addEventListeners() {
7110
- if (!this.core.isReady) this.listenToOnce(this.core, Events$1.CORE_READY, this._onReady);else this._onReady();
7186
+ if (!this.core.isReady) {
7187
+ this.listenToOnce(this.core, Events$1.CORE_READY, this._onReady);
7188
+ } else {
7189
+ this._onReady();
7190
+ }
7111
7191
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this._containerChanged);
7112
7192
  this.listenTo(this.core, Events$1.CORE_FULLSCREEN, this._onFullscreenChange);
7113
7193
  this.listenTo(this.core, Events$1.CORE_RESIZE, this._onResize);
@@ -7261,9 +7341,11 @@
7261
7341
  }, {
7262
7342
  key: "load",
7263
7343
  value: function load(sources, mimeType, autoPlay) {
7264
- if (autoPlay !== undefined) this.configure({
7265
- autoPlay: !!autoPlay
7266
- });
7344
+ if (autoPlay !== undefined) {
7345
+ this.configure({
7346
+ autoPlay: !!autoPlay
7347
+ });
7348
+ }
7267
7349
  this.core.load(sources, mimeType);
7268
7350
  return this;
7269
7351
  }
@@ -7653,22 +7735,22 @@
7653
7735
  var tracksHTML = "<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track=\"<%= i %>\" kind=\"<%= tracks[i].kind %>\" label=\"<%= tracks[i].label %>\" srclang=\"<%= tracks[i].lang %>\" src=\"<%= tracks[i].src %>\">\n<% }; %>\n";
7654
7736
  var css_248z$2$1 = "[data-html5-video] {\n position: absolute;\n height: 100%;\n width: 100%;\n display: block; }\n";
7655
7737
  var MIMETYPES = {
7656
- 'mp4': ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {
7738
+ mp4: ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {
7657
7739
  return 'video/mp4; codecs="' + codec + ', mp4a.40.2"';
7658
7740
  }),
7659
- 'ogg': ['video/ogg; codecs="theora, vorbis"', 'video/ogg; codecs="dirac"', 'video/ogg; codecs="theora, speex"'],
7741
+ ogg: ['video/ogg; codecs="theora, vorbis"', 'video/ogg; codecs="dirac"', 'video/ogg; codecs="theora, speex"'],
7660
7742
  '3gpp': ['video/3gpp; codecs="mp4v.20.8, samr"'],
7661
- 'webm': ['video/webm; codecs="vp8, vorbis"'],
7662
- 'mkv': ['video/x-matroska; codecs="theora, vorbis"'],
7663
- 'm3u8': ['application/x-mpegurl']
7743
+ webm: ['video/webm; codecs="vp8, vorbis"'],
7744
+ mkv: ['video/x-matroska; codecs="theora, vorbis"'],
7745
+ m3u8: ['application/x-mpegurl']
7664
7746
  };
7665
- MIMETYPES['ogv'] = MIMETYPES['ogg'];
7747
+ MIMETYPES.ogv = MIMETYPES.ogg;
7666
7748
  MIMETYPES['3gp'] = MIMETYPES['3gpp'];
7667
7749
  var AUDIO_MIMETYPES = {
7668
- 'wav': ['audio/wav'],
7669
- 'mp3': ['audio/mp3', 'audio/mpeg;codecs="mp3"'],
7670
- 'aac': ['audio/mp4;codecs="mp4a.40.5"'],
7671
- 'oga': ['audio/ogg']
7750
+ wav: ['audio/wav'],
7751
+ mp3: ['audio/mp3', 'audio/mpeg;codecs="mp3"'],
7752
+ aac: ['audio/mp4;codecs="mp4a.40.5"'],
7753
+ oga: ['audio/ogg']
7672
7754
  };
7673
7755
  var KNOWN_AUDIO_MIMETYPES = Object.keys(AUDIO_MIMETYPES).reduce(function (acc, k) {
7674
7756
  return [].concat(_toConsumableArray$1(acc), _toConsumableArray$1(AUDIO_MIMETYPES[k]));
@@ -7705,7 +7787,11 @@
7705
7787
  var preload = playbackConfig.preload || (Browser.isSafari ? 'auto' : _this.options.preload);
7706
7788
  var posterUrl; // FIXME: poster plugin should always convert poster to object with expected properties ?
7707
7789
  if (_this.options.poster) {
7708
- if (typeof _this.options.poster === 'string') posterUrl = _this.options.poster;else if (typeof _this.options.poster.url === 'string') posterUrl = _this.options.poster.url;
7790
+ if (typeof _this.options.poster === 'string') {
7791
+ posterUrl = _this.options.poster;
7792
+ } else if (typeof _this.options.poster.url === 'string') {
7793
+ posterUrl = _this.options.poster.url;
7794
+ }
7709
7795
  }
7710
7796
  $.extend(true, _this.el, {
7711
7797
  muted: _this.options.mute,
@@ -7716,7 +7802,9 @@
7716
7802
  crossOrigin: playbackConfig.crossOrigin,
7717
7803
  'x-webkit-playsinline': playbackConfig.playInline
7718
7804
  });
7719
- if (playbackConfig.controls || _this.options.useVideoTagDefaultControls) _this.$el.attr('controls', '');
7805
+ if (playbackConfig.controls || _this.options.useVideoTagDefaultControls) {
7806
+ _this.$el.attr('controls', '');
7807
+ }
7720
7808
  playbackConfig.playInline && _this.$el.attr({
7721
7809
  playsinline: 'playsinline'
7722
7810
  });
@@ -7744,7 +7832,7 @@
7744
7832
  key: "supportedVersion",
7745
7833
  get: function get() {
7746
7834
  return {
7747
- min: "0.12.0"
7835
+ min: "0.13.0"
7748
7836
  };
7749
7837
  }
7750
7838
  }, {
@@ -7770,23 +7858,23 @@
7770
7858
  key: "events",
7771
7859
  get: function get() {
7772
7860
  return {
7773
- 'canplay': '_onCanPlay',
7774
- 'canplaythrough': '_handleBufferingEvents',
7775
- 'durationchange': '_onDurationChange',
7776
- 'ended': '_onEnded',
7777
- 'error': '_onError',
7778
- 'loadeddata': '_onLoadedData',
7779
- 'loadedmetadata': '_onLoadedMetadata',
7780
- 'pause': '_onPause',
7781
- 'playing': '_onPlaying',
7782
- 'progress': '_onProgress',
7783
- 'seeking': '_onSeeking',
7784
- 'seeked': '_onSeeked',
7785
- 'stalled': '_handleBufferingEvents',
7786
- 'timeupdate': '_onTimeUpdate',
7787
- 'waiting': '_onWaiting',
7788
- 'enterpictureinpicture': '_onEnterPiP',
7789
- 'leavepictureinpicture': '_onExitPiP'
7861
+ canplay: '_onCanPlay',
7862
+ canplaythrough: '_handleBufferingEvents',
7863
+ durationchange: '_onDurationChange',
7864
+ ended: '_onEnded',
7865
+ error: '_onError',
7866
+ loadeddata: '_onLoadedData',
7867
+ loadedmetadata: '_onLoadedMetadata',
7868
+ pause: '_onPause',
7869
+ playing: '_onPlaying',
7870
+ progress: '_onProgress',
7871
+ seeking: '_onSeeking',
7872
+ seeked: '_onSeeked',
7873
+ stalled: '_handleBufferingEvents',
7874
+ timeupdate: '_onTimeUpdate',
7875
+ waiting: '_onWaiting',
7876
+ enterpictureinpicture: '_onEnterPiP',
7877
+ leavepictureinpicture: '_onExitPiP'
7790
7878
  };
7791
7879
  }
7792
7880
 
@@ -7883,7 +7971,9 @@
7883
7971
  };
7884
7972
 
7885
7973
  // Use current video element if recycling feature enabled with mobile devices
7886
- if (Browser.isMobile && DomRecycler.options.recycleVideo) opts.element = this.el;
7974
+ if (Browser.isMobile && DomRecycler.options.recycleVideo) {
7975
+ opts.element = this.el;
7976
+ }
7887
7977
 
7888
7978
  // Desktop browser autoplay policy may require user action
7889
7979
  // Mobile browser autoplay require user consent and video recycling feature enabled
@@ -7925,7 +8015,9 @@
7925
8015
  }, {
7926
8016
  key: "_setupSrc",
7927
8017
  value: function _setupSrc(srcUrl) {
7928
- if (this.el.src === srcUrl) return;
8018
+ if (this.el.src === srcUrl) {
8019
+ return;
8020
+ }
7929
8021
  this._ccIsSetup = false;
7930
8022
  this.el.src = srcUrl;
7931
8023
  this._src = this.el.src;
@@ -7940,7 +8032,9 @@
7940
8032
  });
7941
8033
  this._updateSettings();
7942
8034
  var autoSeekFromUrl = typeof this._options.autoSeekFromUrl === 'undefined' || this._options.autoSeekFromUrl;
7943
- if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl) this._checkInitialSeek();
8035
+ if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl) {
8036
+ this._checkInitialSeek();
8037
+ }
7944
8038
  }
7945
8039
  }, {
7946
8040
  key: "_onDurationChange",
@@ -7955,7 +8049,11 @@
7955
8049
  value: function _updateSettings() {
7956
8050
  // we can't figure out if hls resource is VoD or not until it is being loaded or duration has changed.
7957
8051
  // that's why we check it again and update media control accordingly.
7958
- if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD) this.settings.left = ['playpause', 'position', 'duration'];else this.settings.left = ['playstop'];
8052
+ if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD) {
8053
+ this.settings.left = ['playpause', 'position', 'duration'];
8054
+ } else {
8055
+ this.settings.left = ['playstop'];
8056
+ }
7959
8057
  this.settings.seekEnabled = this.isSeekEnabled();
7960
8058
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
7961
8059
  }
@@ -8006,9 +8104,11 @@
8006
8104
  this._handleBufferingEvents();
8007
8105
  var promise = this.el.play();
8008
8106
  // For more details, see https://developers.google.com/web/updates/2016/03/play-returns-promise
8009
- if (promise && promise["catch"]) promise["catch"](function (error) {
8010
- return Log.warn(_this4.name, 'HTML5 play failed', error);
8011
- });
8107
+ if (promise && promise["catch"]) {
8108
+ promise["catch"](function (error) {
8109
+ return Log.warn(_this4.name, 'HTML5 play failed', error);
8110
+ });
8111
+ }
8012
8112
  return promise;
8013
8113
  }
8014
8114
  }, {
@@ -8082,7 +8182,9 @@
8082
8182
  }, {
8083
8183
  key: "_startPlayheadMovingChecks",
8084
8184
  value: function _startPlayheadMovingChecks() {
8085
- if (this._playheadMovingTimer !== null || !this._playheadMovingCheckEnabled) return;
8185
+ if (this._playheadMovingTimer !== null || !this._playheadMovingCheckEnabled) {
8186
+ return;
8187
+ }
8086
8188
  this._playheadMovingTimeOnCheck = null;
8087
8189
  this._determineIfPlayheadMoving();
8088
8190
  this._playheadMovingTimer = setInterval(this._determineIfPlayheadMoving.bind(this), this._playheadMovingCheckInterval);
@@ -8090,7 +8192,9 @@
8090
8192
  }, {
8091
8193
  key: "_stopPlayheadMovingChecks",
8092
8194
  value: function _stopPlayheadMovingChecks() {
8093
- if (this._playheadMovingTimer === null) return;
8195
+ if (this._playheadMovingTimer === null) {
8196
+ return;
8197
+ }
8094
8198
  clearInterval(this._playheadMovingTimer);
8095
8199
  this._playheadMovingTimer = null;
8096
8200
  this._playheadMoving = false;
@@ -8220,10 +8324,16 @@
8220
8324
  var isMissingMediaDataToPlay = this.el.readyState < this.el.HAVE_FUTURE_DATA;
8221
8325
  var playheadShouldBeMoving = !this.el.ended && !this.el.paused && !this._playheadMoving;
8222
8326
  var buffering = isLoading && isMissingMediaDataToPlay;
8223
- if (this._playheadMovingCheckEnabled) buffering = buffering || isLoading && playheadShouldBeMoving;
8327
+ if (this._playheadMovingCheckEnabled) {
8328
+ buffering = buffering || isLoading && playheadShouldBeMoving;
8329
+ }
8224
8330
  if (this._isBuffering !== buffering) {
8225
8331
  this._isBuffering = buffering;
8226
- if (buffering) this.trigger(Events$1.PLAYBACK_BUFFERING, this.name);else this.trigger(Events$1.PLAYBACK_BUFFERFULL, this.name);
8332
+ if (buffering) {
8333
+ this.trigger(Events$1.PLAYBACK_BUFFERING, this.name);
8334
+ } else {
8335
+ this.trigger(Events$1.PLAYBACK_BUFFERFULL, this.name);
8336
+ }
8227
8337
  }
8228
8338
  }
8229
8339
  }, {
@@ -8239,7 +8349,11 @@
8239
8349
  raw: this.el.error,
8240
8350
  level: isUnknownError ? PlayerError.Levels.WARN : PlayerError.Levels.FATAL
8241
8351
  });
8242
- if (isUnknownError) Log.warn(this.name, 'HTML5 unknown error: ', formattedError);else this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
8352
+ if (isUnknownError) {
8353
+ Log.warn(this.name, 'HTML5 unknown error: ', formattedError);
8354
+ } else {
8355
+ this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
8356
+ }
8243
8357
  }
8244
8358
  }, {
8245
8359
  key: "destroy",
@@ -8259,7 +8373,7 @@
8259
8373
  value: function _updateDvr(status) {
8260
8374
  this.trigger(Events$1.PLAYBACK_DVR, status);
8261
8375
  this.trigger(Events$1.PLAYBACK_STATS_ADD, {
8262
- 'dvr': status
8376
+ dvr: status
8263
8377
  });
8264
8378
  }
8265
8379
  }, {
@@ -8282,7 +8396,9 @@
8282
8396
  key: "_checkInitialSeek",
8283
8397
  value: function _checkInitialSeek() {
8284
8398
  var seekTime = seekStringToSeconds();
8285
- if (seekTime !== 0) this.seek(seekTime);
8399
+ if (seekTime !== 0) {
8400
+ this.seek(seekTime);
8401
+ }
8286
8402
  }
8287
8403
  }, {
8288
8404
  key: "getCurrentTime",
@@ -8325,7 +8441,9 @@
8325
8441
  }, {
8326
8442
  key: "_onProgress",
8327
8443
  value: function _onProgress() {
8328
- if (!this.el.buffered.length) return;
8444
+ if (!this.el.buffered.length) {
8445
+ return;
8446
+ }
8329
8447
  var buffered = [];
8330
8448
  var bufferedPos = 0;
8331
8449
  for (var i = 0; i < this.el.buffered.length; i++) {
@@ -8333,7 +8451,9 @@
8333
8451
  start: this.el.buffered.start(i),
8334
8452
  end: this.el.buffered.end(i)
8335
8453
  }]);
8336
- if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) bufferedPos = i;
8454
+ if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
8455
+ bufferedPos = i;
8456
+ }
8337
8457
  }
8338
8458
  var progress = {
8339
8459
  start: buffered[bufferedPos].start,
@@ -8346,14 +8466,18 @@
8346
8466
  key: "_typeFor",
8347
8467
  value: function _typeFor(src) {
8348
8468
  var mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType);
8349
- if (mimeTypes.length === 0) mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);
8469
+ if (mimeTypes.length === 0) {
8470
+ mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);
8471
+ }
8350
8472
  var mimeType = mimeTypes[0] || '';
8351
8473
  return mimeType.split(';')[0];
8352
8474
  }
8353
8475
  }, {
8354
8476
  key: "_ready",
8355
8477
  value: function _ready() {
8356
- if (this._isReadyState) return;
8478
+ if (this._isReadyState) {
8479
+ return;
8480
+ }
8357
8481
  this._isReadyState = true;
8358
8482
  this.trigger(Events$1.PLAYBACK_READY, this.name);
8359
8483
  }
@@ -8417,7 +8541,9 @@
8417
8541
  return this._ccTrackId;
8418
8542
  },
8419
8543
  set: function set(trackId) {
8420
- if (!isNumber(trackId)) return;
8544
+ if (!isNumber(trackId)) {
8545
+ return;
8546
+ }
8421
8547
  var tracks = this.closedCaptionsTracks;
8422
8548
  var showingTrack;
8423
8549
 
@@ -8426,9 +8552,13 @@
8426
8552
  showingTrack = tracks.find(function (track) {
8427
8553
  return track.id === trackId;
8428
8554
  });
8429
- if (!showingTrack) return; // Track id not found
8555
+ if (!showingTrack) {
8556
+ return;
8557
+ } // Track id not found
8430
8558
 
8431
- if (showingTrack.track.mode === 'showing') return; // Track already showing
8559
+ if (showingTrack.track.mode === 'showing') {
8560
+ return;
8561
+ } // Track already showing
8432
8562
  }
8433
8563
 
8434
8564
  // Since it is possible to display multiple tracks,
@@ -8436,7 +8566,7 @@
8436
8566
  tracks.filter(function (track) {
8437
8567
  return track.track.mode !== 'hidden';
8438
8568
  }).forEach(function (track) {
8439
- return track.track.mode = 'hidden';
8569
+ track.track.mode = 'hidden';
8440
8570
  });
8441
8571
  showingTrack && (showingTrack.track.mode = 'showing');
8442
8572
  this._ccTrackId = trackId;
@@ -8506,7 +8636,7 @@
8506
8636
  key: "supportedVersion",
8507
8637
  get: function get() {
8508
8638
  return {
8509
- min: "0.12.0"
8639
+ min: "0.13.0"
8510
8640
  };
8511
8641
  }
8512
8642
  }, {
@@ -8561,7 +8691,7 @@
8561
8691
  key: "supportedVersion",
8562
8692
  get: function get() {
8563
8693
  return {
8564
- min: "0.12.0"
8694
+ min: "0.13.0"
8565
8695
  };
8566
8696
  }
8567
8697
  }, {
@@ -8641,7 +8771,7 @@
8641
8771
  key: "supportedVersion",
8642
8772
  get: function get() {
8643
8773
  return {
8644
- min: "0.12.0"
8774
+ min: "0.13.0"
8645
8775
  };
8646
8776
  }
8647
8777
  }, {
@@ -8669,7 +8799,9 @@
8669
8799
  }));
8670
8800
  this.trigger(Events$1.PLAYBACK_READY, this.name);
8671
8801
  var showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp);
8672
- if (this.options.autoPlay || !showForNoOp) this._animate();
8802
+ if (this.options.autoPlay || !showForNoOp) {
8803
+ this._animate();
8804
+ }
8673
8805
  return this;
8674
8806
  }
8675
8807
  }, {
@@ -8687,12 +8819,14 @@
8687
8819
  } catch (err) {
8688
8820
  buffer32 = new Uint32Array(this.context.canvas.width * this.context.canvas.height * 4);
8689
8821
  var data = idata.data;
8690
- for (var i = 0; i < data.length; i++) buffer32[i] = data[i];
8822
+ for (var i = 0; i < data.length; i++) {
8823
+ buffer32[i] = data[i];
8824
+ }
8691
8825
  }
8692
- var len = buffer32.length,
8693
- m = Math.random() * 6 + 4;
8694
- var run = 0,
8695
- color = 0;
8826
+ var len = buffer32.length;
8827
+ var m = Math.random() * 6 + 4;
8828
+ var run = 0;
8829
+ var color = 0;
8696
8830
  for (var _i = 0; _i < len;) {
8697
8831
  if (run < 0) {
8698
8832
  run = m * Math.random();
@@ -8708,7 +8842,9 @@
8708
8842
  key: "_loop",
8709
8843
  value: function _loop() {
8710
8844
  var _this2 = this;
8711
- if (this._stop) return;
8845
+ if (this._stop) {
8846
+ return;
8847
+ }
8712
8848
  this._noise();
8713
8849
  this._animationHandle = requestAnimationFrame(function () {
8714
8850
  return _this2._loop();
@@ -8767,14 +8903,14 @@
8767
8903
  key: "supportedVersion",
8768
8904
  get: function get() {
8769
8905
  return {
8770
- min: "0.12.0"
8906
+ min: "0.13.0"
8771
8907
  };
8772
8908
  }
8773
8909
  }, {
8774
8910
  key: "t",
8775
8911
  value: function t(key) {
8776
8912
  var lang = this._language();
8777
- var fallbackLang = this._messages['en'];
8913
+ var fallbackLang = this._messages.en;
8778
8914
  var i18n = lang && this._messages[lang] || fallbackLang;
8779
8915
  return i18n[key] || fallbackLang[key] || key;
8780
8916
  }
@@ -8879,17 +9015,17 @@
8879
9015
  }
8880
9016
  };
8881
9017
  this._messages = $.extend(true, defaultMessages, this.core.options.strings || {});
8882
- this._messages['de-DE'] = this._messages['de'];
8883
- this._messages['pt-BR'] = this._messages['pt'];
8884
- this._messages['en-US'] = this._messages['en'];
8885
- this._messages['bg-BG'] = this._messages['bg'];
8886
- this._messages['es-419'] = this._messages['es_am'];
8887
- this._messages['es-ES'] = this._messages['es'];
8888
- this._messages['fr-FR'] = this._messages['fr'];
8889
- this._messages['tr-TR'] = this._messages['tr'];
8890
- this._messages['et-EE'] = this._messages['et'];
8891
- this._messages['ar-IQ'] = this._messages['ar'];
8892
- this._messages['zh-CN'] = this._messages['zh'];
9018
+ this._messages['de-DE'] = this._messages.de;
9019
+ this._messages['pt-BR'] = this._messages.pt;
9020
+ this._messages['en-US'] = this._messages.en;
9021
+ this._messages['bg-BG'] = this._messages.bg;
9022
+ this._messages['es-419'] = this._messages.es_am;
9023
+ this._messages['es-ES'] = this._messages.es;
9024
+ this._messages['fr-FR'] = this._messages.fr;
9025
+ this._messages['tr-TR'] = this._messages.tr;
9026
+ this._messages['et-EE'] = this._messages.et;
9027
+ this._messages['ar-IQ'] = this._messages.ar;
9028
+ this._messages['zh-CN'] = this._messages.zh;
8893
9029
  }
8894
9030
  }]);
8895
9031
  }(CorePlugin);
@@ -8908,7 +9044,7 @@
8908
9044
  key: "supportedVersion",
8909
9045
  get: function get() {
8910
9046
  return {
8911
- min: "0.12.0"
9047
+ min: "0.13.0"
8912
9048
  };
8913
9049
  }
8914
9050
  }, {
@@ -8937,7 +9073,7 @@
8937
9073
  @type {string}
8938
9074
  @default
8939
9075
  */
8940
- var version$2 = "0.12.0";
9076
+ var version$2 = "0.13.0";
8941
9077
 
8942
9078
  // Built-in Plugins/Playbacks
8943
9079
 
@@ -9072,9 +9208,9 @@
9072
9208
  }, _typeof(o);
9073
9209
  }
9074
9210
  var ClickToPausePlugin = /*#__PURE__*/function (_ContainerPlugin) {
9075
- function ClickToPausePlugin(container) {
9211
+ function ClickToPausePlugin() {
9076
9212
  _classCallCheck$1(this, ClickToPausePlugin);
9077
- return _callSuper$1(this, ClickToPausePlugin, [container]);
9213
+ return _callSuper$1(this, ClickToPausePlugin, arguments);
9078
9214
  }
9079
9215
  _inherits$1(ClickToPausePlugin, _ContainerPlugin);
9080
9216
  return _createClass$1(ClickToPausePlugin, [{
@@ -9086,7 +9222,7 @@
9086
9222
  key: "supportedVersion",
9087
9223
  get: function get() {
9088
9224
  return {
9089
- min: "0.12.0"
9225
+ min: "0.13.0"
9090
9226
  };
9091
9227
  }
9092
9228
  }, {
@@ -9105,7 +9241,11 @@
9105
9241
  value: function click() {
9106
9242
  var onClickPayload = this.config.onClickPayload;
9107
9243
  if (this.container.getPlaybackType() !== Playback.LIVE || this.container.isDvrEnabled()) {
9108
- if (this.container.isPlaying()) this.container.pause(onClickPayload);else this.container.play(onClickPayload);
9244
+ if (this.container.isPlaying()) {
9245
+ this.container.pause(onClickPayload);
9246
+ } else {
9247
+ this.container.play(onClickPayload);
9248
+ }
9109
9249
  }
9110
9250
  }
9111
9251
  }, {
@@ -9145,7 +9285,7 @@
9145
9285
  key: "supportedVersion",
9146
9286
  get: function get() {
9147
9287
  return {
9148
- min: "0.12.0"
9288
+ min: "0.13.0"
9149
9289
  };
9150
9290
  }
9151
9291
  }, {
@@ -9255,7 +9395,9 @@
9255
9395
  key: "renderCcButton",
9256
9396
  value: function renderCcButton() {
9257
9397
  var tracks = this.container ? this.container.closedCaptionsTracks : [];
9258
- for (var i = 0; i < tracks.length; i++) tracks[i].label = this._labelCb(tracks[i]);
9398
+ for (var i = 0; i < tracks.length; i++) {
9399
+ tracks[i].label = this._labelCb(tracks[i]);
9400
+ }
9259
9401
  var style = Styler.getStyleFor(css_248z$7, {
9260
9402
  baseUrl: this.options.baseUrl
9261
9403
  });
@@ -9274,7 +9416,11 @@
9274
9416
  value: function render() {
9275
9417
  this.renderCcButton();
9276
9418
  var $fullscreen = this.core.mediaControl.$el.find('button[data-fullscreen]');
9277
- if ($fullscreen[0]) this.$el.insertAfter($fullscreen);else this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').prepend(this.$el);
9419
+ if ($fullscreen[0]) {
9420
+ this.$el.insertAfter($fullscreen);
9421
+ } else {
9422
+ this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').prepend(this.$el);
9423
+ }
9278
9424
  return this;
9279
9425
  }
9280
9426
  }]);
@@ -9304,7 +9450,7 @@
9304
9450
  key: "supportedVersion",
9305
9451
  get: function get() {
9306
9452
  return {
9307
- min: "0.12.0"
9453
+ min: "0.13.0"
9308
9454
  };
9309
9455
  }
9310
9456
  }, {
@@ -9374,8 +9520,12 @@
9374
9520
  value: function click() {
9375
9521
  var mediaControl = this.core.mediaControl;
9376
9522
  var container = mediaControl.container;
9377
- if (!container.isPlaying()) container.play();
9378
- if (mediaControl.$el.hasClass('dvr')) container.seek(container.getDuration());
9523
+ if (!container.isPlaying()) {
9524
+ container.play();
9525
+ }
9526
+ if (mediaControl.$el.hasClass('dvr')) {
9527
+ container.seek(container.getDuration());
9528
+ }
9379
9529
  }
9380
9530
  }, {
9381
9531
  key: "settingsUpdate",
@@ -9431,7 +9581,7 @@
9431
9581
  key: "supportedVersion",
9432
9582
  get: function get() {
9433
9583
  return {
9434
- min: "0.12.0"
9584
+ min: "0.13.0"
9435
9585
  };
9436
9586
  }
9437
9587
  }, {
@@ -9454,7 +9604,9 @@
9454
9604
  key: "ended",
9455
9605
  value: function ended() {
9456
9606
  var exitOnEnd = typeof this.core.options.exitFullscreenOnEnd === 'undefined' || this.core.options.exitFullscreenOnEnd;
9457
- if (exitOnEnd && this.core.isFullscreen()) this.core.toggleFullscreen();
9607
+ if (exitOnEnd && this.core.isFullscreen()) {
9608
+ this.core.toggleFullscreen();
9609
+ }
9458
9610
  }
9459
9611
  }]);
9460
9612
  }(CorePlugin);
@@ -9479,7 +9631,7 @@
9479
9631
  key: "supportedVersion",
9480
9632
  get: function get() {
9481
9633
  return {
9482
- min: "0.12.0"
9634
+ min: "0.13.0"
9483
9635
  };
9484
9636
  }
9485
9637
  }, {
@@ -9599,7 +9751,7 @@
9599
9751
  key: "supportedVersion",
9600
9752
  get: function get() {
9601
9753
  return {
9602
- min: "0.12.0"
9754
+ min: "0.13.0"
9603
9755
  };
9604
9756
  }
9605
9757
  }, {
@@ -9669,13 +9821,17 @@
9669
9821
  }, {
9670
9822
  key: "setPlayIcon",
9671
9823
  value: function setPlayIcon() {
9672
- if (!this.playIcon) this.playIcon = this.createIcon(playIcon);
9824
+ if (!this.playIcon) {
9825
+ this.playIcon = this.createIcon(playIcon);
9826
+ }
9673
9827
  this.changeIcon(this.playIcon);
9674
9828
  }
9675
9829
  }, {
9676
9830
  key: "setPauseIcon",
9677
9831
  value: function setPauseIcon() {
9678
- if (!this.pauseIcon) this.pauseIcon = this.createIcon(pauseIcon);
9832
+ if (!this.pauseIcon) {
9833
+ this.pauseIcon = this.createIcon(pauseIcon);
9834
+ }
9679
9835
  this.changeIcon(this.pauseIcon);
9680
9836
  }
9681
9837
  }, {
@@ -9718,7 +9874,7 @@
9718
9874
  key: "supportedVersion",
9719
9875
  get: function get() {
9720
9876
  return {
9721
- min: "0.12.0"
9877
+ min: "0.13.0"
9722
9878
  };
9723
9879
  }
9724
9880
  }, {
@@ -9763,7 +9919,9 @@
9763
9919
  this.listenTo(this.container, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDVR);
9764
9920
  }
9765
9921
  _gaq.push([this.trackerName + '_setAccount', this.account]);
9766
- if (this.domainName) _gaq.push([this.trackerName + '_setDomainName', this.domainName]);
9922
+ if (this.domainName) {
9923
+ _gaq.push([this.trackerName + '_setDomainName', this.domainName]);
9924
+ }
9767
9925
  }
9768
9926
  }, {
9769
9927
  key: "onReady",
@@ -9812,7 +9970,9 @@
9812
9970
  }, {
9813
9971
  key: "onPlaybackChanged",
9814
9972
  value: function onPlaybackChanged(playbackState) {
9815
- if (playbackState.type !== null) this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src]);
9973
+ if (playbackState.type !== null) {
9974
+ this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src]);
9975
+ }
9816
9976
  }
9817
9977
  }, {
9818
9978
  key: "onDVR",
@@ -10183,12 +10343,16 @@
10183
10343
  _this.kibo = new Kibo(_this.options.focusElement);
10184
10344
  _this.bindKeyEvents();
10185
10345
  if (_this.container) {
10186
- if (!$.isEmptyObject(_this.container.settings)) _this.settings = $.extend({}, _this.container.settings);
10346
+ if (!$.isEmptyObject(_this.container.settings)) {
10347
+ _this.settings = $.extend({}, _this.container.settings);
10348
+ }
10187
10349
  } else {
10188
10350
  _this.settings = {};
10189
10351
  }
10190
10352
  _this.userDisabled = false;
10191
- if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) _this.disable();
10353
+ if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) {
10354
+ _this.disable();
10355
+ }
10192
10356
  _this.stopDragHandler = function (event) {
10193
10357
  return _this.stopDrag(event);
10194
10358
  };
@@ -10209,7 +10373,7 @@
10209
10373
  key: "supportedVersion",
10210
10374
  get: function get() {
10211
10375
  return {
10212
- min: "0.12.0"
10376
+ min: "0.13.0"
10213
10377
  };
10214
10378
  }
10215
10379
  }, {
@@ -10551,9 +10715,13 @@
10551
10715
  });
10552
10716
  }
10553
10717
  };
10554
- if (!this.container) this.listenToOnce(this, Events$1.MEDIACONTROL_CONTAINERCHANGED, function () {
10555
- return setWhenContainerReady();
10556
- });else setWhenContainerReady();
10718
+ if (!this.container) {
10719
+ this.listenToOnce(this, Events$1.MEDIACONTROL_CONTAINERCHANGED, function () {
10720
+ return setWhenContainerReady();
10721
+ });
10722
+ } else {
10723
+ setWhenContainerReady();
10724
+ }
10557
10725
  }
10558
10726
  }, {
10559
10727
  key: "toggleFullscreen",
@@ -10633,7 +10801,9 @@
10633
10801
 
10634
10802
  // default to 100%
10635
10803
  this.currentSeekBarPercentage = 100;
10636
- if (this.container && (this.container.getPlaybackType() !== Playback.LIVE || this.container.isDvrInUse())) this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100;
10804
+ if (this.container && (this.container.getPlaybackType() !== Playback.LIVE || this.container.isDvrInUse())) {
10805
+ this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100;
10806
+ }
10637
10807
  this.setSeekPercentage(this.currentSeekBarPercentage);
10638
10808
  var newPosition = formatTime$1(this.currentPositionValue);
10639
10809
  var newDuration = formatTime$1(this.currentDurationValue);
@@ -10733,7 +10903,11 @@
10733
10903
  }, {
10734
10904
  key: "updateCursorStyle",
10735
10905
  value: function updateCursorStyle(showing) {
10736
- if (showing) this.core.$el.removeClass('nocursor');else if (this.core.isFullscreen()) this.core.$el.addClass('nocursor');
10906
+ if (showing) {
10907
+ this.core.$el.removeClass('nocursor');
10908
+ } else if (this.core.isFullscreen()) {
10909
+ this.core.$el.addClass('nocursor');
10910
+ }
10737
10911
  }
10738
10912
  }, {
10739
10913
  key: "settingsUpdate",
@@ -10925,7 +11099,11 @@
10925
11099
  key: "configure",
10926
11100
  value: function configure(options) {
10927
11101
  // Check if chromeless mode or if configure is called with new source(s)
10928
- if (this.options.chromeless || options.source || options.sources) this.disable();else this.enable();
11102
+ if (this.options.chromeless || options.source || options.sources) {
11103
+ this.disable();
11104
+ } else {
11105
+ this.enable();
11106
+ }
10929
11107
  this.trigger(Events$1.MEDIACONTROL_OPTIONS_CHANGE);
10930
11108
  }
10931
11109
  }, {
@@ -10954,12 +11132,18 @@
10954
11132
  // Video volume cannot be changed with Safari on mobile devices
10955
11133
  // Display mute/unmute icon only if Safari version >= 10
10956
11134
  if (Browser.isSafari && Browser.isMobile) {
10957
- if (Browser.version < 10) this.$volumeContainer.css('display', 'none');else this.$volumeBarContainer.css('display', 'none');
11135
+ if (Browser.version < 10) {
11136
+ this.$volumeContainer.css('display', 'none');
11137
+ } else {
11138
+ this.$volumeBarContainer.css('display', 'none');
11139
+ }
10958
11140
  }
10959
11141
  this.$seekBarPosition.addClass('media-control-notransition');
10960
11142
  this.$seekBarScrubber.addClass('media-control-notransition');
10961
11143
  var previousSeekPercentage = 0;
10962
- if (this.displayedSeekBarPercentage) previousSeekPercentage = this.displayedSeekBarPercentage;
11144
+ if (this.displayedSeekBarPercentage) {
11145
+ previousSeekPercentage = this.displayedSeekBarPercentage;
11146
+ }
10963
11147
  this.displayedSeekBarPercentage = null;
10964
11148
  this.setSeekPercentage(previousSeekPercentage);
10965
11149
  setTimeout(function () {
@@ -11009,7 +11193,7 @@
11009
11193
  key: "supportedVersion",
11010
11194
  get: function get() {
11011
11195
  return {
11012
- min: "0.12.0"
11196
+ min: "0.13.0"
11013
11197
  };
11014
11198
  }
11015
11199
  }, {
@@ -11080,7 +11264,11 @@
11080
11264
  }, {
11081
11265
  key: "updatePlayButton",
11082
11266
  value: function updatePlayButton(show) {
11083
- if (show && (!this.options.chromeless || this.options.allowUserInteraction)) this.showPlayButton();else this.hidePlayButton();
11267
+ if (show && (!this.options.chromeless || this.options.allowUserInteraction)) {
11268
+ this.showPlayButton();
11269
+ } else {
11270
+ this.hidePlayButton();
11271
+ }
11084
11272
  }
11085
11273
  }, {
11086
11274
  key: "showPlayButton",
@@ -11118,7 +11306,9 @@
11118
11306
  }, {
11119
11307
  key: "update",
11120
11308
  value: function update() {
11121
- if (!this.shouldRender) return;
11309
+ if (!this.shouldRender) {
11310
+ return;
11311
+ }
11122
11312
  var showPlayButton = !this.playRequested && !this.hasStartedPlaying && !this.container.buffering;
11123
11313
  this.updatePlayButton(showPlayButton);
11124
11314
  this.updatePoster();
@@ -11138,12 +11328,16 @@
11138
11328
  key: "hidePoster",
11139
11329
  value: function hidePoster() {
11140
11330
  this.container.enableMediaControl();
11141
- if (this.shouldHideOnPlay()) this.$el.hide();
11331
+ if (this.shouldHideOnPlay()) {
11332
+ this.$el.hide();
11333
+ }
11142
11334
  }
11143
11335
  }, {
11144
11336
  key: "render",
11145
11337
  value: function render() {
11146
- if (!this.shouldRender) return;
11338
+ if (!this.shouldRender) {
11339
+ return;
11340
+ }
11147
11341
  var style = Styler.getStyleFor(css_248z$3, {
11148
11342
  baseUrl: this.options.baseUrl
11149
11343
  });
@@ -11169,7 +11363,9 @@
11169
11363
  this.$playButton.addClass('poster-icon');
11170
11364
  this.$playButton.attr('data-poster', '');
11171
11365
  var buttonsColor = this.options.mediacontrol && this.options.mediacontrol.buttons;
11172
- if (buttonsColor) this.$el.find('svg path').css('fill', buttonsColor);
11366
+ if (buttonsColor) {
11367
+ this.$el.find('svg path').css('fill', buttonsColor);
11368
+ }
11173
11369
  if (this.options.mediacontrol && this.options.mediacontrol.buttons) {
11174
11370
  buttonsColor = this.options.mediacontrol.buttons;
11175
11371
  this.$playButton.css('color', buttonsColor);
@@ -11198,7 +11394,11 @@
11198
11394
  _this.firstFragDateTime = null;
11199
11395
  _this.actualLiveTime = !!_this.mediaControl.options.actualLiveTime;
11200
11396
  if (_this.actualLiveTime) {
11201
- if (_this.mediaControl.options.actualLiveServerTime) _this.actualLiveServerTimeDiff = new Date().getTime() - new Date(_this.mediaControl.options.actualLiveServerTime).getTime();else _this.actualLiveServerTimeDiff = 0;
11397
+ if (_this.mediaControl.options.actualLiveServerTime) {
11398
+ _this.actualLiveServerTimeDiff = new Date().getTime() - new Date(_this.mediaControl.options.actualLiveServerTime).getTime();
11399
+ } else {
11400
+ _this.actualLiveServerTimeDiff = 0;
11401
+ }
11202
11402
  }
11203
11403
  return _this;
11204
11404
  }
@@ -11212,7 +11412,7 @@
11212
11412
  key: "supportedVersion",
11213
11413
  get: function get() {
11214
11414
  return {
11215
- min: "0.12.0"
11415
+ min: "0.13.0"
11216
11416
  };
11217
11417
  }
11218
11418
  }, {
@@ -11314,7 +11514,9 @@
11314
11514
  secondsSinceMidnight = (e - d.setHours(0, 0, 0, 0)) / 1000;
11315
11515
  }
11316
11516
  seekTime = secondsSinceMidnight - this.duration + this.hoverPosition * this.duration;
11317
- if (seekTime < 0) seekTime += 86400;
11517
+ if (seekTime < 0) {
11518
+ seekTime += 86400;
11519
+ }
11318
11520
  } else {
11319
11521
  seekTime = this.hoverPosition * this.duration;
11320
11522
  }
@@ -11414,7 +11616,7 @@
11414
11616
  key: "supportedVersion",
11415
11617
  get: function get() {
11416
11618
  return {
11417
- min: "0.12.0"
11619
+ min: "0.13.0"
11418
11620
  };
11419
11621
  }
11420
11622
  }, {
@@ -11444,9 +11646,11 @@
11444
11646
  key: "show",
11445
11647
  value: function show() {
11446
11648
  var _this2 = this;
11447
- if (this.showTimeout === null) this.showTimeout = setTimeout(function () {
11448
- return _this2.$el.show();
11449
- }, 300);
11649
+ if (this.showTimeout === null) {
11650
+ this.showTimeout = setTimeout(function () {
11651
+ return _this2.$el.show();
11652
+ }, 300);
11653
+ }
11450
11654
  }
11451
11655
  }, {
11452
11656
  key: "hide",
@@ -11467,7 +11671,9 @@
11467
11671
  this.$el.append(style[0]);
11468
11672
  this.container.$el.append(this.$el);
11469
11673
  this.$el.hide();
11470
- if (this.container.buffering) this.onBuffering();
11674
+ if (this.container.buffering) {
11675
+ this.onBuffering();
11676
+ }
11471
11677
  return this;
11472
11678
  }
11473
11679
  }]);
@@ -11492,7 +11698,7 @@
11492
11698
  key: "supportedVersion",
11493
11699
  get: function get() {
11494
11700
  return {
11495
- min: "0.12.0"
11701
+ min: "0.13.0"
11496
11702
  };
11497
11703
  }
11498
11704
  }, {
@@ -11523,7 +11729,9 @@
11523
11729
  value: function onPlay() {
11524
11730
  this.state = 'PLAYING';
11525
11731
  this.watchingTimeInit = Date.now();
11526
- if (!this.intervalId) this.intervalId = setInterval(this.report.bind(this), this.reportInterval);
11732
+ if (!this.intervalId) {
11733
+ this.intervalId = setInterval(this.report.bind(this), this.reportInterval);
11734
+ }
11527
11735
  }
11528
11736
  }, {
11529
11737
  key: "onStop",
@@ -11536,7 +11744,11 @@
11536
11744
  }, {
11537
11745
  key: "onBuffering",
11538
11746
  value: function onBuffering() {
11539
- if (this.firstPlay) this.startupTimeInit = Date.now();else this.rebufferingTimeInit = Date.now();
11747
+ if (this.firstPlay) {
11748
+ this.startupTimeInit = Date.now();
11749
+ } else {
11750
+ this.rebufferingTimeInit = Date.now();
11751
+ }
11540
11752
  this.state = 'BUFFERING';
11541
11753
  this.rebuffers++;
11542
11754
  }
@@ -11613,7 +11825,7 @@
11613
11825
  key: "supportedVersion",
11614
11826
  get: function get() {
11615
11827
  return {
11616
- min: "0.12.0"
11828
+ min: "0.13.0"
11617
11829
  };
11618
11830
  }
11619
11831
  }, {
@@ -11643,7 +11855,9 @@
11643
11855
  }, {
11644
11856
  key: "onPlay",
11645
11857
  value: function onPlay() {
11646
- if (!this.hidden) this.$el.show();
11858
+ if (!this.hidden) {
11859
+ this.$el.show();
11860
+ }
11647
11861
  }
11648
11862
  }, {
11649
11863
  key: "onStop",
@@ -11685,7 +11899,7 @@
11685
11899
  WaterMark: WaterMarkPlugin
11686
11900
  };
11687
11901
 
11688
- var version$1 = "0.11.9";
11902
+ var version$1 = "0.11.13";
11689
11903
  for (var _i = 0, _Object$values = Object.values(Plugins); _i < _Object$values.length; _i++) {
11690
11904
  var plugin = _Object$values[_i];
11691
11905
  Loader.registerPlugin(plugin);
@@ -47057,7 +47271,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47057
47271
  key: "supportedVersion",
47058
47272
  get: function get() {
47059
47273
  return {
47060
- min: "0.12.0"
47274
+ min: "0.13.0"
47061
47275
  };
47062
47276
  }
47063
47277
  }, {
@@ -47068,12 +47282,20 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47068
47282
  }, {
47069
47283
  key: "currentLevel",
47070
47284
  get: function get() {
47071
- if (this._currentLevel === null || this._currentLevel === undefined) return AUTO;else return this._currentLevel; //0 is a valid level ID
47285
+ if (this._currentLevel === null || this._currentLevel === undefined) {
47286
+ return AUTO;
47287
+ } else {
47288
+ return this._currentLevel;
47289
+ } // 0 is a valid level ID
47072
47290
  },
47073
47291
  set: function set(id) {
47074
47292
  this._currentLevel = id;
47075
47293
  this.trigger(Events$1.PLAYBACK_LEVEL_SWITCH_START);
47076
- if (this.options.playback.hlsUseNextLevel) this._hls.nextLevel = this._currentLevel;else this._hls.currentLevel = this._currentLevel;
47294
+ if (this.options.playback.hlsUseNextLevel) {
47295
+ this._hls.nextLevel = this._currentLevel;
47296
+ } else {
47297
+ this._hls.currentLevel = this._currentLevel;
47298
+ }
47077
47299
  }
47078
47300
  }, {
47079
47301
  key: "isReady",
@@ -47098,7 +47320,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47098
47320
  }, {
47099
47321
  key: "_startTime",
47100
47322
  get: function get() {
47101
- if (this._playbackType === Playback.LIVE && this._playlistType !== 'EVENT') return this._extrapolatedStartTime;
47323
+ if (this._playbackType === Playback.LIVE && this._playlistType !== 'EVENT') {
47324
+ return this._extrapolatedStartTime;
47325
+ }
47102
47326
  return this._playableRegionStartTime;
47103
47327
  }
47104
47328
  }, {
@@ -47112,7 +47336,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47112
47336
  }, {
47113
47337
  key: "_extrapolatedStartTime",
47114
47338
  get: function get() {
47115
- if (!this._localStartTimeCorrelation) return this._playableRegionStartTime;
47339
+ if (!this._localStartTimeCorrelation) {
47340
+ return this._playableRegionStartTime;
47341
+ }
47116
47342
  var corr = this._localStartTimeCorrelation;
47117
47343
  var timePassed = this._now - corr.local;
47118
47344
  var extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000;
@@ -47158,7 +47384,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47158
47384
  }, {
47159
47385
  key: "_extrapolatedWindowDuration",
47160
47386
  get: function get() {
47161
- if (this._segmentTargetDuration === null) return 0;
47387
+ if (this._segmentTargetDuration === null) {
47388
+ return 0;
47389
+ }
47162
47390
  return this._extrapolatedWindowNumSegments * this._segmentTargetDuration;
47163
47391
  }
47164
47392
  }, {
@@ -47279,7 +47507,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47279
47507
  _this2.options.hlsPlayback.preload && _this2._hls.loadSource(_this2.options.src);
47280
47508
  });
47281
47509
  this._hls.on(Hls.Events.MANIFEST_LOADING, function () {
47282
- return _this2._manifestLoading = true;
47510
+ _this2._manifestLoading = true;
47283
47511
  });
47284
47512
  this._hls.on(Hls.Events.LEVEL_LOADED, function (evt, data) {
47285
47513
  return _this2._updatePlaybackType(evt, data);
@@ -47414,6 +47642,18 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47414
47642
  value: function getDuration() {
47415
47643
  return this._duration;
47416
47644
  }
47645
+
47646
+ // the frame rate should be retrieved from the HLS.js level information
47647
+ // as it is not necessarily exposed directly by the video element
47648
+ }, {
47649
+ key: "getFrameRate",
47650
+ value: function getFrameRate() {
47651
+ if (this._hls && this._hls.levels && this._hls.currentLevel >= 0) {
47652
+ var level = this._hls.levels[this._hls.currentLevel];
47653
+ return level && level.frameRate ? level.frameRate : null;
47654
+ }
47655
+ return null;
47656
+ }
47417
47657
  }, {
47418
47658
  key: "getCurrentTime",
47419
47659
  value: function getCurrentTime() {
@@ -47455,7 +47695,13 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47455
47695
  }, {
47456
47696
  key: "_updateSettings",
47457
47697
  value: function _updateSettings() {
47458
- if (this._playbackType === Playback.VOD) this.settings.left = ['playpause', 'position', 'duration'];else if (this.dvrEnabled) this.settings.left = ['playpause'];else this.settings.left = ['playstop'];
47698
+ if (this._playbackType === Playback.VOD) {
47699
+ this.settings.left = ['playpause', 'position', 'duration'];
47700
+ } else if (this.dvrEnabled) {
47701
+ this.settings.left = ['playpause'];
47702
+ } else {
47703
+ this.settings.left = ['playstop'];
47704
+ }
47459
47705
  this.settings.seekEnabled = this.isSeekEnabled();
47460
47706
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
47461
47707
  }
@@ -47602,7 +47848,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47602
47848
  start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),
47603
47849
  end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)
47604
47850
  }]);
47605
- if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) bufferedPos = i;
47851
+ if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
47852
+ bufferedPos = i;
47853
+ }
47606
47854
  }
47607
47855
  var progress = {
47608
47856
  start: buffered[bufferedPos].start,
@@ -47652,7 +47900,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47652
47900
  this._playbackType = data.details.live ? Playback.LIVE : Playback.VOD;
47653
47901
  this._onLevelUpdated(evt, data);
47654
47902
  // Live stream subtitle tracks detection hack (may not immediately available)
47655
- if (this._ccTracksUpdated && this._playbackType === Playback.LIVE && this.hasClosedCaptionsTracks) this._onSubtitleLoaded();
47903
+ if (this._ccTracksUpdated && this._playbackType === Playback.LIVE && this.hasClosedCaptionsTracks) {
47904
+ this._onSubtitleLoaded();
47905
+ }
47656
47906
  }
47657
47907
  }, {
47658
47908
  key: "_fillLevels",
@@ -47678,7 +47928,9 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
47678
47928
  var previousPlayableRegionDuration = this._playableRegionDuration;
47679
47929
  if (fragments.length === 0) return;
47680
47930
  // #EXT-X-PROGRAM-DATE-TIME
47681
- if (fragments[0].rawProgramDateTime) this._programDateTime = fragments[0].rawProgramDateTime;
47931
+ if (fragments[0].rawProgramDateTime) {
47932
+ this._programDateTime = fragments[0].rawProgramDateTime;
47933
+ }
47682
47934
  if (this._playableRegionStartTime !== fragments[0].start) {
47683
47935
  startTimeChanged = true;
47684
47936
  this._playableRegionStartTime = fragments[0].start;