@clappr/player 0.6.0 → 0.8.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.
@@ -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$1(t) {
127
127
  var i = _toPrimitive$1(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(o)) || allowArrayLike && o && typeof o.length === "number") {
278
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(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/wAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=';
484
- var Media = {
485
- mp4: mp4
486
- };
487
326
  function getDefaultExportFromCjs(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(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/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pw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AAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+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;
@@ -3136,7 +3143,7 @@
3136
3143
  var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LEVEL_INFO;
3137
3144
  var offLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : LEVEL_DISABLED;
3138
3145
  _classCallCheck$1(this, Log);
3139
- this.EXCLUDE_LIST = ['timeupdate', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress'];
3146
+ this.EXCLUDE_LIST = ['timeupdate', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress', 'core:mousemove'];
3140
3147
  this.level = level;
3141
3148
  this.previousLevel = this.level;
3142
3149
  this.offLevel = offLevel;
@@ -3184,8 +3191,8 @@
3184
3191
  }, {
3185
3192
  key: "log",
3186
3193
  value: function log(klass, level, message) {
3187
- if (this.EXCLUDE_LIST.indexOf(message[0]) >= 0) return;
3188
3194
  if (level < this.level) return;
3195
+ if (this.EXCLUDE_LIST.indexOf(message[0]) >= 0) return;
3189
3196
  if (!message) {
3190
3197
  message = klass;
3191
3198
  klass = null;
@@ -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$1(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$1(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$1(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.9.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.9.0"
7669
7701
  };
7670
7702
  }
7671
7703
  }, {
@@ -7936,7 +7968,6 @@
7936
7968
  key: "pause",
7937
7969
  value: function pause() {
7938
7970
  this.el.pause();
7939
- this.dvrEnabled && this._updateDvr(true);
7940
7971
  }
7941
7972
  }, {
7942
7973
  key: "stop",
@@ -8073,6 +8104,7 @@
8073
8104
  }, {
8074
8105
  key: "_onPause",
8075
8106
  value: function _onPause() {
8107
+ this.dvrEnabled && this._updateDvr(true);
8076
8108
  this._stopPlayheadMovingChecks();
8077
8109
  this._handleBufferingEvents();
8078
8110
  this.trigger(Events.PLAYBACK_PAUSE);
@@ -8080,7 +8112,10 @@
8080
8112
  }, {
8081
8113
  key: "_onSeeking",
8082
8114
  value: function _onSeeking() {
8083
- this.trigger(Events.PLAYBACK_SEEK, this.getCurrentTime());
8115
+ var currentTime = this.getCurrentTime();
8116
+ // assume live if time within 3 seconds of end of stream
8117
+ this.dvrEnabled && this._updateDvr(currentTime < this.getDuration() - 3);
8118
+ this.trigger(Events.PLAYBACK_SEEK, currentTime);
8084
8119
  this._handleBufferingEvents();
8085
8120
  }
8086
8121
  }, {
@@ -8163,6 +8198,7 @@
8163
8198
  key: "destroy",
8164
8199
  value: function destroy() {
8165
8200
  this._destroyed = true;
8201
+ this._stopPlayheadMovingChecks();
8166
8202
  this.handleTextTrackChange && this.el.textTracks.removeEventListener('change', this.handleTextTrackChange);
8167
8203
  this.$el.off('contextmenu');
8168
8204
  _get$1(_getPrototypeOf$1(HTML5Video.prototype), "destroy", this).call(this);
@@ -8186,8 +8222,6 @@
8186
8222
  Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.');
8187
8223
  time = this.getDuration();
8188
8224
  }
8189
- // assume live if time within 3 seconds of end of stream
8190
- this.dvrEnabled && this._updateDvr(time < this.getDuration() - 3);
8191
8225
  time += this.el.seekable.start(0);
8192
8226
  this.el.currentTime = time;
8193
8227
  }
@@ -8425,7 +8459,7 @@
8425
8459
  key: "supportedVersion",
8426
8460
  get: function get() {
8427
8461
  return {
8428
- min: "0.7.2"
8462
+ min: "0.9.0"
8429
8463
  };
8430
8464
  }
8431
8465
  }, {
@@ -8480,7 +8514,7 @@
8480
8514
  key: "supportedVersion",
8481
8515
  get: function get() {
8482
8516
  return {
8483
- min: "0.7.2"
8517
+ min: "0.9.0"
8484
8518
  };
8485
8519
  }
8486
8520
  }, {
@@ -8560,7 +8594,7 @@
8560
8594
  key: "supportedVersion",
8561
8595
  get: function get() {
8562
8596
  return {
8563
- min: "0.7.2"
8597
+ min: "0.9.0"
8564
8598
  };
8565
8599
  }
8566
8600
  }, {
@@ -8686,7 +8720,7 @@
8686
8720
  key: "supportedVersion",
8687
8721
  get: function get() {
8688
8722
  return {
8689
- min: "0.7.2"
8723
+ min: "0.9.0"
8690
8724
  };
8691
8725
  }
8692
8726
  }, {
@@ -8827,7 +8861,7 @@
8827
8861
  key: "supportedVersion",
8828
8862
  get: function get() {
8829
8863
  return {
8830
- min: "0.7.2"
8864
+ min: "0.9.0"
8831
8865
  };
8832
8866
  }
8833
8867
  }, {
@@ -8852,7 +8886,11 @@
8852
8886
  // Use of this source code is governed by a BSD-style
8853
8887
  // license that can be found in the LICENSE file.
8854
8888
 
8855
- var version$1 = "0.7.2";
8889
+ /** @constant
8890
+ @type {string}
8891
+ @default
8892
+ */
8893
+ var version$1 = "0.9.0";
8856
8894
 
8857
8895
  // Built-in Plugins/Playbacks
8858
8896
 
@@ -9016,7 +9054,7 @@
9016
9054
  key: "supportedVersion",
9017
9055
  get: function get() {
9018
9056
  return {
9019
- min: "0.7.2"
9057
+ min: "0.9.0"
9020
9058
  };
9021
9059
  }
9022
9060
  }, {
@@ -9075,7 +9113,7 @@
9075
9113
  key: "supportedVersion",
9076
9114
  get: function get() {
9077
9115
  return {
9078
- min: "0.7.2"
9116
+ min: "0.9.0"
9079
9117
  };
9080
9118
  }
9081
9119
  }, {
@@ -9234,7 +9272,7 @@
9234
9272
  key: "supportedVersion",
9235
9273
  get: function get() {
9236
9274
  return {
9237
- min: "0.7.2"
9275
+ min: "0.9.0"
9238
9276
  };
9239
9277
  }
9240
9278
  }, {
@@ -9361,7 +9399,7 @@
9361
9399
  key: "supportedVersion",
9362
9400
  get: function get() {
9363
9401
  return {
9364
- min: "0.7.2"
9402
+ min: "0.9.0"
9365
9403
  };
9366
9404
  }
9367
9405
  }, {
@@ -9409,7 +9447,7 @@
9409
9447
  key: "supportedVersion",
9410
9448
  get: function get() {
9411
9449
  return {
9412
- min: "0.7.2"
9450
+ min: "0.9.0"
9413
9451
  };
9414
9452
  }
9415
9453
  }, {
@@ -9529,7 +9567,7 @@
9529
9567
  key: "supportedVersion",
9530
9568
  get: function get() {
9531
9569
  return {
9532
- min: "0.7.2"
9570
+ min: "0.9.0"
9533
9571
  };
9534
9572
  }
9535
9573
  }, {
@@ -9648,7 +9686,7 @@
9648
9686
  key: "supportedVersion",
9649
9687
  get: function get() {
9650
9688
  return {
9651
- min: "0.7.2"
9689
+ min: "0.9.0"
9652
9690
  };
9653
9691
  }
9654
9692
  }, {
@@ -10138,7 +10176,7 @@
10138
10176
  key: "supportedVersion",
10139
10177
  get: function get() {
10140
10178
  return {
10141
- min: "0.7.2"
10179
+ min: "0.9.0"
10142
10180
  };
10143
10181
  }
10144
10182
  }, {
@@ -10938,7 +10976,7 @@
10938
10976
  key: "supportedVersion",
10939
10977
  get: function get() {
10940
10978
  return {
10941
- min: "0.7.2"
10979
+ min: "0.9.0"
10942
10980
  };
10943
10981
  }
10944
10982
  }, {
@@ -11141,7 +11179,7 @@
11141
11179
  key: "supportedVersion",
11142
11180
  get: function get() {
11143
11181
  return {
11144
- min: "0.7.2"
11182
+ min: "0.9.0"
11145
11183
  };
11146
11184
  }
11147
11185
  }, {
@@ -11343,7 +11381,7 @@
11343
11381
  key: "supportedVersion",
11344
11382
  get: function get() {
11345
11383
  return {
11346
- min: "0.7.2"
11384
+ min: "0.9.0"
11347
11385
  };
11348
11386
  }
11349
11387
  }, {
@@ -11421,7 +11459,7 @@
11421
11459
  key: "supportedVersion",
11422
11460
  get: function get() {
11423
11461
  return {
11424
- min: "0.7.2"
11462
+ min: "0.9.0"
11425
11463
  };
11426
11464
  }
11427
11465
  }, {
@@ -11542,7 +11580,7 @@
11542
11580
  key: "supportedVersion",
11543
11581
  get: function get() {
11544
11582
  return {
11545
- min: "0.7.2"
11583
+ min: "0.9.0"
11546
11584
  };
11547
11585
  }
11548
11586
  }, {
@@ -11614,7 +11652,7 @@
11614
11652
  WaterMark: WaterMarkPlugin
11615
11653
  };
11616
11654
 
11617
- var version = "0.6.0";
11655
+ var version = "0.8.0";
11618
11656
  for (var _i = 0, _Object$values = Object.values(Plugins); _i < _Object$values.length; _i++) {
11619
11657
  var plugin = _Object$values[_i];
11620
11658
  Loader.registerPlugin(plugin);