@clappr/player 0.6.0 → 0.7.0

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
@@ -117,11 +117,11 @@
117
117
  if ("object" != typeof t || !t) return t;
118
118
  var e = t[Symbol.toPrimitive];
119
119
  if (void 0 !== e) {
120
- var i = e.call(t, r || "default");
120
+ var i = e.call(t, r);
121
121
  if ("object" != typeof i) return i;
122
122
  throw new TypeError("@@toPrimitive must return a primitive value.");
123
123
  }
124
- return ("string" === r ? String : Number)(t);
124
+ return String(t);
125
125
  }
126
126
  function _toPropertyKey$2(t) {
127
127
  var i = _toPrimitive$2(t, "string");
@@ -275,7 +275,7 @@
275
275
  function _createForOfIteratorHelper(o, allowArrayLike) {
276
276
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
277
277
  if (!it) {
278
- if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
278
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike) {
279
279
  if (it) o = it;
280
280
  var i = 0;
281
281
  var F = function () {};
@@ -323,167 +323,6 @@
323
323
  }
324
324
  };
325
325
  }
326
-
327
- // Copyright 2014 Globo.com Player authors. All rights reserved.
328
- // Use of this source code is governed by a BSD-style
329
- // license that can be found in the LICENSE file.
330
-
331
- /* istanbul ignore file */
332
-
333
- /**
334
- * Array.prototype.find
335
- *
336
- * Original source : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find
337
- * See also : https://tc39.github.io/ecma262/#sec-array.prototype.find
338
- */
339
- if (!Array.prototype.find) {
340
- // eslint-disable-next-line
341
- Object.defineProperty(Array.prototype, 'find', {
342
- // Note: ES6 arrow function syntax is not used on purpose to avoid this to be undefined
343
- value: function value(predicate) {
344
- // 1. Let O be ? ToObject(this value).
345
- if (this == null) throw new TypeError('"this" is null or not defined');
346
- var o = Object(this);
347
-
348
- // 2. Let len be ? ToLength(? Get(O, "length")).
349
- var len = o.length >>> 0;
350
-
351
- // 3. If IsCallable(predicate) is false, throw a TypeError exception.
352
- if (typeof predicate !== 'function') throw new TypeError('predicate must be a function');
353
-
354
- // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
355
- var thisArg = arguments[1];
356
-
357
- // 5. Let k be 0.
358
- var k = 0;
359
-
360
- // 6. Repeat, while k < len
361
- while (k < len) {
362
- // a. Let Pk be ! ToString(k).
363
- // b. Let kValue be ? Get(O, Pk).
364
- // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
365
- // d. If testResult is true, return kValue.
366
- var kValue = o[k];
367
- if (predicate.call(thisArg, kValue, k, o)) return kValue;
368
-
369
- // e. Increase k by 1.
370
- k++;
371
- }
372
-
373
- // 7. Return undefined.
374
- return undefined;
375
- }
376
- });
377
- }
378
-
379
- // polyfills for smart TVs
380
-
381
- if (!Object.entries) {
382
- Object.entries = function (obj) {
383
- var ownProps = Object.keys(obj),
384
- i = ownProps.length,
385
- resArray = new Array(i); // preallocate the Array
386
- while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]];
387
- return resArray;
388
- };
389
- }
390
- if (!Object.values) {
391
- Object.values = function (obj) {
392
- var ownProps = Object.keys(obj),
393
- i = ownProps.length,
394
- resArray = new Array(i); // preallocate the Array
395
- while (i--) resArray[i] = obj[ownProps[i]];
396
- return resArray;
397
- };
398
- }
399
-
400
- /**
401
- * Object.assign
402
- * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
403
- *
404
- * Original source : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
405
- */
406
- if (typeof Object.assign != 'function') {
407
- // Must be writable: true, enumerable: false, configurable: true
408
- Object.defineProperty(Object, 'assign', {
409
- // length of function is 2.
410
- value: function assign(target, varArgs) {
411
- if (target == null) {
412
- // TypeError if undefined or null
413
- throw new TypeError('Cannot convert undefined or null to object');
414
- }
415
- var to = Object(target);
416
- for (var index = 1; index < arguments.length; index++) {
417
- var nextSource = arguments[index];
418
- if (nextSource != null) {
419
- // Skip over if undefined or null
420
- for (var nextKey in nextSource) {
421
- // Avoid bugs when hasOwnProperty is shadowed
422
- if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
423
- to[nextKey] = nextSource[nextKey];
424
- }
425
- }
426
- }
427
- }
428
- return to;
429
- },
430
- writable: true,
431
- configurable: true
432
- });
433
- }
434
-
435
- // https://tc39.github.io/ecma262/#sec-array.prototype.findindex
436
- if (!Array.prototype.findIndex) {
437
- Object.defineProperty(Array.prototype, 'findIndex', {
438
- value: function value(predicate) {
439
- // 1. Let O be ? ToObject(this value).
440
- if (this == null) {
441
- throw new TypeError('"this" is null or not defined');
442
- }
443
- var o = Object(this);
444
-
445
- // 2. Let len be ? ToLength(? Get(O, "length")).
446
- var len = o.length >>> 0;
447
-
448
- // 3. If IsCallable(predicate) is false, throw a TypeError exception.
449
- if (typeof predicate !== 'function') {
450
- throw new TypeError('predicate must be a function');
451
- }
452
-
453
- // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
454
- var thisArg = arguments[1];
455
-
456
- // 5. Let k be 0.
457
- var k = 0;
458
-
459
- // 6. Repeat, while k < len
460
- while (k < len) {
461
- // a. Let Pk be ! ToString(k).
462
- // b. Let kValue be ? Get(O, Pk).
463
- // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
464
- // d. If testResult is true, return k.
465
- var kValue = o[k];
466
- if (predicate.call(thisArg, kValue, k, o)) {
467
- return k;
468
- }
469
- // e. Increase k by 1.
470
- k++;
471
- }
472
-
473
- // 7. Return -1.
474
- return -1;
475
- },
476
- configurable: true,
477
- writable: true
478
- });
479
- }
480
-
481
- /* istanbul ignore file */
482
- // https://github.com/mathiasbynens/small
483
- var mp4 = 'data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAA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AAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=';
484
- var Media = {
485
- mp4: mp4
486
- };
487
326
  function getDefaultExportFromCjs$1(x) {
488
327
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
489
328
  }
@@ -2317,6 +2156,167 @@
2317
2156
  var zepto = Zepto;
2318
2157
  var $ = /*@__PURE__*/getDefaultExportFromCjs$1(zepto);
2319
2158
 
2159
+ // Copyright 2014 Globo.com Player authors. All rights reserved.
2160
+ // Use of this source code is governed by a BSD-style
2161
+ // license that can be found in the LICENSE file.
2162
+
2163
+ /* istanbul ignore file */
2164
+
2165
+ /**
2166
+ * Array.prototype.find
2167
+ *
2168
+ * Original source : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find
2169
+ * See also : https://tc39.github.io/ecma262/#sec-array.prototype.find
2170
+ */
2171
+ if (!Array.prototype.find) {
2172
+ // eslint-disable-next-line
2173
+ Object.defineProperty(Array.prototype, 'find', {
2174
+ // Note: ES6 arrow function syntax is not used on purpose to avoid this to be undefined
2175
+ value: function value(predicate) {
2176
+ // 1. Let O be ? ToObject(this value).
2177
+ if (this == null) throw new TypeError('"this" is null or not defined');
2178
+ var o = Object(this);
2179
+
2180
+ // 2. Let len be ? ToLength(? Get(O, "length")).
2181
+ var len = o.length >>> 0;
2182
+
2183
+ // 3. If IsCallable(predicate) is false, throw a TypeError exception.
2184
+ if (typeof predicate !== 'function') throw new TypeError('predicate must be a function');
2185
+
2186
+ // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
2187
+ var thisArg = arguments[1];
2188
+
2189
+ // 5. Let k be 0.
2190
+ var k = 0;
2191
+
2192
+ // 6. Repeat, while k < len
2193
+ while (k < len) {
2194
+ // a. Let Pk be ! ToString(k).
2195
+ // b. Let kValue be ? Get(O, Pk).
2196
+ // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
2197
+ // d. If testResult is true, return kValue.
2198
+ var kValue = o[k];
2199
+ if (predicate.call(thisArg, kValue, k, o)) return kValue;
2200
+
2201
+ // e. Increase k by 1.
2202
+ k++;
2203
+ }
2204
+
2205
+ // 7. Return undefined.
2206
+ return undefined;
2207
+ }
2208
+ });
2209
+ }
2210
+
2211
+ // polyfills for smart TVs
2212
+
2213
+ if (!Object.entries) {
2214
+ Object.entries = function (obj) {
2215
+ var ownProps = Object.keys(obj),
2216
+ i = ownProps.length,
2217
+ resArray = new Array(i); // preallocate the Array
2218
+ while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]];
2219
+ return resArray;
2220
+ };
2221
+ }
2222
+ if (!Object.values) {
2223
+ Object.values = function (obj) {
2224
+ var ownProps = Object.keys(obj),
2225
+ i = ownProps.length,
2226
+ resArray = new Array(i); // preallocate the Array
2227
+ while (i--) resArray[i] = obj[ownProps[i]];
2228
+ return resArray;
2229
+ };
2230
+ }
2231
+
2232
+ /**
2233
+ * Object.assign
2234
+ * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
2235
+ *
2236
+ * Original source : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
2237
+ */
2238
+ if (typeof Object.assign != 'function') {
2239
+ // Must be writable: true, enumerable: false, configurable: true
2240
+ Object.defineProperty(Object, 'assign', {
2241
+ // length of function is 2.
2242
+ value: function assign(target, varArgs) {
2243
+ if (target == null) {
2244
+ // TypeError if undefined or null
2245
+ throw new TypeError('Cannot convert undefined or null to object');
2246
+ }
2247
+ var to = Object(target);
2248
+ for (var index = 1; index < arguments.length; index++) {
2249
+ var nextSource = arguments[index];
2250
+ if (nextSource != null) {
2251
+ // Skip over if undefined or null
2252
+ for (var nextKey in nextSource) {
2253
+ // Avoid bugs when hasOwnProperty is shadowed
2254
+ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
2255
+ to[nextKey] = nextSource[nextKey];
2256
+ }
2257
+ }
2258
+ }
2259
+ }
2260
+ return to;
2261
+ },
2262
+ writable: true,
2263
+ configurable: true
2264
+ });
2265
+ }
2266
+
2267
+ // https://tc39.github.io/ecma262/#sec-array.prototype.findindex
2268
+ if (!Array.prototype.findIndex) {
2269
+ Object.defineProperty(Array.prototype, 'findIndex', {
2270
+ value: function value(predicate) {
2271
+ // 1. Let O be ? ToObject(this value).
2272
+ if (this == null) {
2273
+ throw new TypeError('"this" is null or not defined');
2274
+ }
2275
+ var o = Object(this);
2276
+
2277
+ // 2. Let len be ? ToLength(? Get(O, "length")).
2278
+ var len = o.length >>> 0;
2279
+
2280
+ // 3. If IsCallable(predicate) is false, throw a TypeError exception.
2281
+ if (typeof predicate !== 'function') {
2282
+ throw new TypeError('predicate must be a function');
2283
+ }
2284
+
2285
+ // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
2286
+ var thisArg = arguments[1];
2287
+
2288
+ // 5. Let k be 0.
2289
+ var k = 0;
2290
+
2291
+ // 6. Repeat, while k < len
2292
+ while (k < len) {
2293
+ // a. Let Pk be ! ToString(k).
2294
+ // b. Let kValue be ? Get(O, Pk).
2295
+ // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
2296
+ // d. If testResult is true, return k.
2297
+ var kValue = o[k];
2298
+ if (predicate.call(thisArg, kValue, k, o)) {
2299
+ return k;
2300
+ }
2301
+ // e. Increase k by 1.
2302
+ k++;
2303
+ }
2304
+
2305
+ // 7. Return -1.
2306
+ return -1;
2307
+ },
2308
+ configurable: true,
2309
+ writable: true
2310
+ });
2311
+ }
2312
+
2313
+ /* istanbul ignore file */
2314
+ // https://github.com/mathiasbynens/small
2315
+ var mp4 = 'data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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aGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=';
2316
+ var Media = {
2317
+ mp4: mp4
2318
+ };
2319
+
2320
2320
  /* eslint-disable no-useless-escape */
2321
2321
  // The order of the following arrays is important, be careful if you change it.
2322
2322
 
@@ -2809,6 +2809,13 @@
2809
2809
  assign(Surrogate.prototype, properties);
2810
2810
  return Surrogate;
2811
2811
  }
2812
+
2813
+ /**
2814
+ *
2815
+ * @param {number} time
2816
+ * @param {*=} paddedHours
2817
+ * @returns
2818
+ */
2812
2819
  function formatTime$2(time, paddedHours) {
2813
2820
  if (!isFinite(time)) return '--:--';
2814
2821
  time = time * 1000;
@@ -3335,6 +3342,7 @@
3335
3342
  off();
3336
3343
  callback.apply(this, arguments);
3337
3344
  };
3345
+ _once._callback = callback;
3338
3346
  return this.on(name, _once, context);
3339
3347
  }
3340
3348
 
@@ -3436,20 +3444,35 @@
3436
3444
  }
3437
3445
  }]);
3438
3446
  }();
3439
- var listenMethods = {
3440
- listenTo: 'on',
3441
- listenToOnce: 'once'
3447
+ Events.prototype.listenTo = function (obj, name, callback) {
3448
+ var listeningTo = this._listeningTo || (this._listeningTo = {});
3449
+ var id = obj._listenId || (obj._listenId = uniqueId('l'));
3450
+ listeningTo[id] = obj;
3451
+ if (!callback && _typeof(name) === 'object') callback = this;
3452
+ obj.on(name, callback, this);
3453
+ return this;
3454
+ };
3455
+
3456
+ /**
3457
+ * listen to an event once for a given `obj`
3458
+ * @method listenToOnce
3459
+ * @param {Object} obj
3460
+ * @param {String} name
3461
+ * @param {Function} callback
3462
+ * @param {Object} context
3463
+ * @example
3464
+ * ```javascript
3465
+ * this.listenToOnce(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)
3466
+ * ```
3467
+ */
3468
+ Events.prototype.listenToOnce = function (obj, name, callback) {
3469
+ var listeningTo = this._listeningTo || (this._listeningTo = {});
3470
+ var id = obj._listenId || (obj._listenId = uniqueId('l'));
3471
+ listeningTo[id] = obj;
3472
+ if (!callback && _typeof(name) === 'object') callback = this;
3473
+ obj.once(name, callback, this);
3474
+ return this;
3442
3475
  };
3443
- Object.keys(listenMethods).forEach(function (method) {
3444
- Events.prototype[method] = function (obj, name, callback) {
3445
- var listeningTo = this._listeningTo || (this._listeningTo = {});
3446
- var id = obj._listenId || (obj._listenId = uniqueId('l'));
3447
- listeningTo[id] = obj;
3448
- if (!callback && _typeof(name) === 'object') callback = this;
3449
- obj[listenMethods[method]](name, callback, this);
3450
- return this;
3451
- };
3452
- });
3453
3476
 
3454
3477
  // PLAYER EVENTS
3455
3478
  /**
@@ -4226,9 +4249,14 @@
4226
4249
  };
4227
4250
  var counter = 0;
4228
4251
 
4229
- // JavaScript micro-templating, similar to John Resig's implementation.
4230
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
4231
- // and correctly escapes quotes within interpolated code.
4252
+ /**
4253
+ * JavaScript micro-templating, similar to John Resig's implementation.
4254
+ * Underscore templating handles arbitrary delimiters, preserves whitespace,
4255
+ * and correctly escapes quotes within interpolated code.
4256
+ * @param {string} text
4257
+ * @param {*=} data
4258
+ * @returns
4259
+ */
4232
4260
  var tmpl = function tmpl(text, data) {
4233
4261
  var render;
4234
4262
 
@@ -4306,6 +4334,12 @@
4306
4334
  var _this;
4307
4335
  _classCallCheck$2(this, UIObject);
4308
4336
  _this = _callSuper$1(this, UIObject, [options]);
4337
+ /**
4338
+ * a unique id prefixed with `'c'`, `c1, c232`
4339
+ *
4340
+ * @property cid
4341
+ * @type String
4342
+ */
4309
4343
  _this.cid = uniqueId('c');
4310
4344
  _this._ensureElement();
4311
4345
  _this.delegateEvents();
@@ -4326,25 +4360,6 @@
4326
4360
  return _createClass$2(UIObject, [{
4327
4361
  key: "tagName",
4328
4362
  get:
4329
- /**
4330
- * a unique id prefixed with `'c'`, `c1, c232`
4331
- *
4332
- * @property cid
4333
- * @type String
4334
- */
4335
- /**
4336
- * the dom element itself
4337
- *
4338
- * @property el
4339
- * @type HTMLElement
4340
- */
4341
- /**
4342
- * the dom element wrapped by `$`
4343
- *
4344
- * @property $el
4345
- * @type HTMLElement
4346
- */
4347
-
4348
4363
  /**
4349
4364
  * gets the tag name for the ui component
4350
4365
  * @method tagName
@@ -4443,7 +4458,19 @@
4443
4458
  key: "setElement",
4444
4459
  value: function setElement(element, delegate) {
4445
4460
  if (this.$el) this.undelegateEvents();
4461
+ /**
4462
+ * the dom element wrapped by `$`
4463
+ *
4464
+ * @property $el
4465
+ * @type import("clappr-zepto").ZeptoCollection
4466
+ */
4446
4467
  this.$el = $.zepto.isZ(element) ? element : $(element);
4468
+ /**
4469
+ * the dom element itself
4470
+ *
4471
+ * @property el
4472
+ * @type HTMLElement
4473
+ */
4447
4474
  this.el = this.$el[0];
4448
4475
  if (delegate !== false) this.delegateEvents();
4449
4476
  return this;
@@ -4973,6 +5000,7 @@
4973
5000
  return plugin.destroy();
4974
5001
  });
4975
5002
  this.$el.remove();
5003
+ this.undelegateEvents();
4976
5004
  }
4977
5005
  }, {
4978
5006
  key: "setStyle",
@@ -5923,12 +5951,13 @@
5923
5951
  _this._boundFullscreenHandler = function () {
5924
5952
  return _this.handleFullscreenChange();
5925
5953
  };
5954
+ _this._boundHandleWindowResize = function (o) {
5955
+ return _this.handleWindowResize(o);
5956
+ };
5926
5957
  $(document).bind('fullscreenchange', _this._boundFullscreenHandler);
5927
5958
  $(document).bind('MSFullscreenChange', _this._boundFullscreenHandler);
5928
5959
  $(document).bind('mozfullscreenchange', _this._boundFullscreenHandler);
5929
- Browser.isMobile && $(window).bind('resize', function (o) {
5930
- _this.handleWindowResize(o);
5931
- });
5960
+ Browser.isMobile && $(window).bind('resize', _this._boundHandleWindowResize);
5932
5961
  return _this;
5933
5962
  }
5934
5963
  _inherits$2(Core, _UIObject);
@@ -6201,7 +6230,9 @@
6201
6230
  $(document).unbind('fullscreenchange', this._boundFullscreenHandler);
6202
6231
  $(document).unbind('MSFullscreenChange', this._boundFullscreenHandler);
6203
6232
  $(document).unbind('mozfullscreenchange', this._boundFullscreenHandler);
6233
+ Browser.isMobile && $(window).unbind('resize', this._boundHandleWindowResize);
6204
6234
  this.stopListening();
6235
+ this.undelegateEvents();
6205
6236
  }
6206
6237
  }, {
6207
6238
  key: "handleFullscreenChange",
@@ -6228,6 +6259,7 @@
6228
6259
  key: "removeContainer",
6229
6260
  value: function removeContainer(container) {
6230
6261
  this.stopListening(container);
6262
+ this.containerFactory.stopListening(container);
6231
6263
  this.containers = this.containers.filter(function (c) {
6232
6264
  return c !== container;
6233
6265
  });
@@ -6530,7 +6562,7 @@
6530
6562
  plugins: {},
6531
6563
  playbacks: []
6532
6564
  };
6533
- var currentVersion = "0.7.2";
6565
+ var currentVersion = "0.8.0";
6534
6566
  return /*#__PURE__*/function () {
6535
6567
  /**
6536
6568
  * builds the loader
@@ -7665,7 +7697,7 @@
7665
7697
  key: "supportedVersion",
7666
7698
  get: function get() {
7667
7699
  return {
7668
- min: "0.7.2"
7700
+ min: "0.8.0"
7669
7701
  };
7670
7702
  }
7671
7703
  }, {
@@ -8163,6 +8195,7 @@
8163
8195
  key: "destroy",
8164
8196
  value: function destroy() {
8165
8197
  this._destroyed = true;
8198
+ this._stopPlayheadMovingChecks();
8166
8199
  this.handleTextTrackChange && this.el.textTracks.removeEventListener('change', this.handleTextTrackChange);
8167
8200
  this.$el.off('contextmenu');
8168
8201
  _get$2(_getPrototypeOf$2(HTML5Video.prototype), "destroy", this).call(this);
@@ -8425,7 +8458,7 @@
8425
8458
  key: "supportedVersion",
8426
8459
  get: function get() {
8427
8460
  return {
8428
- min: "0.7.2"
8461
+ min: "0.8.0"
8429
8462
  };
8430
8463
  }
8431
8464
  }, {
@@ -8480,7 +8513,7 @@
8480
8513
  key: "supportedVersion",
8481
8514
  get: function get() {
8482
8515
  return {
8483
- min: "0.7.2"
8516
+ min: "0.8.0"
8484
8517
  };
8485
8518
  }
8486
8519
  }, {
@@ -8560,7 +8593,7 @@
8560
8593
  key: "supportedVersion",
8561
8594
  get: function get() {
8562
8595
  return {
8563
- min: "0.7.2"
8596
+ min: "0.8.0"
8564
8597
  };
8565
8598
  }
8566
8599
  }, {
@@ -8686,7 +8719,7 @@
8686
8719
  key: "supportedVersion",
8687
8720
  get: function get() {
8688
8721
  return {
8689
- min: "0.7.2"
8722
+ min: "0.8.0"
8690
8723
  };
8691
8724
  }
8692
8725
  }, {
@@ -8827,7 +8860,7 @@
8827
8860
  key: "supportedVersion",
8828
8861
  get: function get() {
8829
8862
  return {
8830
- min: "0.7.2"
8863
+ min: "0.8.0"
8831
8864
  };
8832
8865
  }
8833
8866
  }, {
@@ -8852,7 +8885,11 @@
8852
8885
  // Use of this source code is governed by a BSD-style
8853
8886
  // license that can be found in the LICENSE file.
8854
8887
 
8855
- var version$1 = "0.7.2";
8888
+ /** @constant
8889
+ @type {string}
8890
+ @default
8891
+ */
8892
+ var version$1 = "0.8.0";
8856
8893
 
8857
8894
  // Built-in Plugins/Playbacks
8858
8895
 
@@ -9016,7 +9053,7 @@
9016
9053
  key: "supportedVersion",
9017
9054
  get: function get() {
9018
9055
  return {
9019
- min: "0.7.2"
9056
+ min: "0.8.0"
9020
9057
  };
9021
9058
  }
9022
9059
  }, {
@@ -9075,7 +9112,7 @@
9075
9112
  key: "supportedVersion",
9076
9113
  get: function get() {
9077
9114
  return {
9078
- min: "0.7.2"
9115
+ min: "0.8.0"
9079
9116
  };
9080
9117
  }
9081
9118
  }, {
@@ -9234,7 +9271,7 @@
9234
9271
  key: "supportedVersion",
9235
9272
  get: function get() {
9236
9273
  return {
9237
- min: "0.7.2"
9274
+ min: "0.8.0"
9238
9275
  };
9239
9276
  }
9240
9277
  }, {
@@ -9361,7 +9398,7 @@
9361
9398
  key: "supportedVersion",
9362
9399
  get: function get() {
9363
9400
  return {
9364
- min: "0.7.2"
9401
+ min: "0.8.0"
9365
9402
  };
9366
9403
  }
9367
9404
  }, {
@@ -9409,7 +9446,7 @@
9409
9446
  key: "supportedVersion",
9410
9447
  get: function get() {
9411
9448
  return {
9412
- min: "0.7.2"
9449
+ min: "0.8.0"
9413
9450
  };
9414
9451
  }
9415
9452
  }, {
@@ -9529,7 +9566,7 @@
9529
9566
  key: "supportedVersion",
9530
9567
  get: function get() {
9531
9568
  return {
9532
- min: "0.7.2"
9569
+ min: "0.8.0"
9533
9570
  };
9534
9571
  }
9535
9572
  }, {
@@ -9648,7 +9685,7 @@
9648
9685
  key: "supportedVersion",
9649
9686
  get: function get() {
9650
9687
  return {
9651
- min: "0.7.2"
9688
+ min: "0.8.0"
9652
9689
  };
9653
9690
  }
9654
9691
  }, {
@@ -10138,7 +10175,7 @@
10138
10175
  key: "supportedVersion",
10139
10176
  get: function get() {
10140
10177
  return {
10141
- min: "0.7.2"
10178
+ min: "0.8.0"
10142
10179
  };
10143
10180
  }
10144
10181
  }, {
@@ -10938,7 +10975,7 @@
10938
10975
  key: "supportedVersion",
10939
10976
  get: function get() {
10940
10977
  return {
10941
- min: "0.7.2"
10978
+ min: "0.8.0"
10942
10979
  };
10943
10980
  }
10944
10981
  }, {
@@ -11141,7 +11178,7 @@
11141
11178
  key: "supportedVersion",
11142
11179
  get: function get() {
11143
11180
  return {
11144
- min: "0.7.2"
11181
+ min: "0.8.0"
11145
11182
  };
11146
11183
  }
11147
11184
  }, {
@@ -11343,7 +11380,7 @@
11343
11380
  key: "supportedVersion",
11344
11381
  get: function get() {
11345
11382
  return {
11346
- min: "0.7.2"
11383
+ min: "0.8.0"
11347
11384
  };
11348
11385
  }
11349
11386
  }, {
@@ -11421,7 +11458,7 @@
11421
11458
  key: "supportedVersion",
11422
11459
  get: function get() {
11423
11460
  return {
11424
- min: "0.7.2"
11461
+ min: "0.8.0"
11425
11462
  };
11426
11463
  }
11427
11464
  }, {
@@ -11542,7 +11579,7 @@
11542
11579
  key: "supportedVersion",
11543
11580
  get: function get() {
11544
11581
  return {
11545
- min: "0.7.2"
11582
+ min: "0.8.0"
11546
11583
  };
11547
11584
  }
11548
11585
  }, {
@@ -11614,7 +11651,7 @@
11614
11651
  WaterMark: WaterMarkPlugin
11615
11652
  };
11616
11653
 
11617
- var version = "0.6.0";
11654
+ var version = "0.7.0";
11618
11655
  for (var _i = 0, _Object$values = Object.values(Plugins); _i < _Object$values.length; _i++) {
11619
11656
  var plugin = _Object$values[_i];
11620
11657
  Loader.registerPlugin(plugin);
@@ -29312,7 +29349,7 @@
29312
29349
  // next segment's program date/time group 5 => the datetime spec
29313
29350
  /#.*/.source // All other non-segment oriented tags will match with all groups empty
29314
29351
  ].join('|'), 'g');
29315
- var LEVEL_PLAYLIST_REGEX_SLOW = new RegExp([/#(EXTM3U)/.source, /#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source, /#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|"0.6.0"): *(\d+)/.source, /#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source, /(#)([^:]*):(.*)/.source, /(#)(.*)(?:.*)\r?\n?/.source].join('|'));
29352
+ var LEVEL_PLAYLIST_REGEX_SLOW = new RegExp([/#(EXTM3U)/.source, /#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source, /#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|"0.7.0"): *(\d+)/.source, /#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source, /(#)([^:]*):(.*)/.source, /(#)(.*)(?:.*)\r?\n?/.source].join('|'));
29316
29353
  var MP4_REGEX_SUFFIX = /\.(mp4|m4s|m4v|m4a)$/i;
29317
29354
  function isMP4Url(url) {
29318
29355
  var _URLToolkit$parseURL$, _URLToolkit$parseURL;
@@ -29553,7 +29590,7 @@
29553
29590
  case 'TARGETDURATION':
29554
29591
  level.targetduration = parseFloat(value1);
29555
29592
  break;
29556
- case '"0.6.0"':
29593
+ case '"0.7.0"':
29557
29594
  level.version = parseInt(value1);
29558
29595
  break;
29559
29596
  case 'EXTM3U':
@@ -38424,7 +38461,7 @@
38424
38461
  key: "supportedVersion",
38425
38462
  get: function get() {
38426
38463
  return {
38427
- min: "0.7.2"
38464
+ min: "0.8.0"
38428
38465
  };
38429
38466
  }
38430
38467
  }, {
@@ -38612,7 +38649,7 @@
38612
38649
  key: "_destroyHLSInstance",
38613
38650
  value: function _destroyHLSInstance() {
38614
38651
  if (!this._hls) return;
38615
- this._manifestParsed = false;
38652
+ this._manifestLoading = false;
38616
38653
  this._ccIsSetup = false;
38617
38654
  this._ccTracksUpdated = false;
38618
38655
  this._setInitialState();
@@ -38639,8 +38676,8 @@
38639
38676
  this._hls.once(HLSJS.Events.MEDIA_ATTACHED, function () {
38640
38677
  _this2.options.hlsPlayback.preload && _this2._hls.loadSource(_this2.options.src);
38641
38678
  });
38642
- this._hls.on(HLSJS.Events.MANIFEST_PARSED, function () {
38643
- return _this2._manifestParsed = true;
38679
+ this._hls.on(HLSJS.Events.MANIFEST_LOADING, function () {
38680
+ return _this2._manifestLoading = true;
38644
38681
  });
38645
38682
  this._hls.on(HLSJS.Events.LEVEL_LOADED, function (evt, data) {
38646
38683
  return _this2._updatePlaybackType(evt, data);
@@ -38976,7 +39013,7 @@
38976
39013
  key: "play",
38977
39014
  value: function play() {
38978
39015
  !this._hls && this._setup();
38979
- !this._manifestParsed && !this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src);
39016
+ !this._manifestLoading && !this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src);
38980
39017
  _get(_getPrototypeOf(HlsjsPlayback.prototype), "play", this).call(this);
38981
39018
  this._startTimeUpdateTimer();
38982
39019
  }