@gcorevideo/player 2.1.13 → 2.3.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.
Files changed (64) hide show
  1. package/dist/index.js +208 -218
  2. package/lib/Player.d.ts +2 -1
  3. package/lib/Player.d.ts.map +1 -1
  4. package/lib/Player.js +28 -7
  5. package/lib/version.d.ts +2 -0
  6. package/lib/version.d.ts.map +1 -1
  7. package/lib/version.js +2 -0
  8. package/package.json +1 -1
  9. package/src/Player.ts +32 -7
  10. package/src/version.ts +2 -0
  11. package/tsconfig.tsbuildinfo +1 -1
  12. package/assets/icons/new/arrow-left.svg +0 -5
  13. package/assets/icons/new/arrow-right.svg +0 -5
  14. package/assets/icons/new/check.svg +0 -5
  15. package/assets/icons/new/close.svg +0 -12
  16. package/assets/icons/new/full.svg +0 -8
  17. package/assets/icons/new/fullscreen-off.svg +0 -14
  18. package/assets/icons/new/fullscreen-on.svg +0 -14
  19. package/assets/icons/new/gear-hd.svg +0 -16
  20. package/assets/icons/new/gear.svg +0 -12
  21. package/assets/icons/new/hd.svg +0 -8
  22. package/assets/icons/new/pause.svg +0 -5
  23. package/assets/icons/new/pip.svg +0 -5
  24. package/assets/icons/new/play.svg +0 -10
  25. package/assets/icons/new/replayleft.svg +0 -5
  26. package/assets/icons/new/replayright.svg +0 -5
  27. package/assets/icons/new/speed.svg +0 -5
  28. package/assets/icons/new/stats.svg +0 -3
  29. package/assets/icons/new/stop.svg +0 -3
  30. package/assets/icons/new/subtitles-off.svg +0 -5
  31. package/assets/icons/new/subtitles-on.svg +0 -6
  32. package/assets/icons/new/volume-max.svg +0 -5
  33. package/assets/icons/new/volume-min.svg +0 -5
  34. package/assets/icons/new/volume-off.svg +0 -5
  35. package/assets/icons/old/cardboard.svg +0 -4
  36. package/assets/icons/old/close-share.svg +0 -13
  37. package/assets/icons/old/close.svg +0 -13
  38. package/assets/icons/old/fb.svg +0 -13
  39. package/assets/icons/old/fullscreen.svg +0 -12
  40. package/assets/icons/old/language.svg +0 -1
  41. package/assets/icons/old/pause.svg +0 -12
  42. package/assets/icons/old/play.svg +0 -12
  43. package/assets/icons/old/quality-arrow.svg +0 -13
  44. package/assets/icons/old/reload.svg +0 -4
  45. package/assets/icons/old/share.svg +0 -13
  46. package/assets/icons/old/sound-off.svg +0 -15
  47. package/assets/icons/old/sound-on.svg +0 -15
  48. package/assets/icons/old/streams.svg +0 -3
  49. package/assets/icons/old/twitter.svg +0 -13
  50. package/assets/icons/old/wn.svg +0 -15
  51. package/assets/icons/standard/01-play.svg +0 -3
  52. package/assets/icons/standard/02-pause.svg +0 -3
  53. package/assets/icons/standard/03-stop.svg +0 -3
  54. package/assets/icons/standard/04-volume.svg +0 -3
  55. package/assets/icons/standard/05-mute.svg +0 -3
  56. package/assets/icons/standard/06-expand.svg +0 -3
  57. package/assets/icons/standard/07-shrink.svg +0 -3
  58. package/assets/icons/standard/08-hd.svg +0 -3
  59. package/assets/icons/standard/09-cc.svg +0 -8
  60. package/assets/icons/standard/10-reload.svg +0 -4
  61. package/assets/style/main.scss +0 -50
  62. package/assets/style/theme.scss +0 -42
  63. package/assets/style/variables.scss +0 -7
  64. package/dist/index.css +0 -125
package/dist/index.js CHANGED
@@ -1,6 +1,117 @@
1
+ function _arrayLikeToArray(r, a) {
2
+ (null == a || a > r.length) && (a = r.length);
3
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4
+ return n;
5
+ }
6
+ function _arrayWithHoles(r) {
7
+ if (Array.isArray(r)) return r;
8
+ }
9
+ function _arrayWithoutHoles(r) {
10
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
11
+ }
12
+ function _assertThisInitialized(e) {
13
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
14
+ return e;
15
+ }
1
16
  function _callSuper(t, o, e) {
2
17
  return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3
18
  }
19
+ function _classCallCheck(a, n) {
20
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
21
+ }
22
+ function _defineProperties(e, r) {
23
+ for (var t = 0; t < r.length; t++) {
24
+ var o = r[t];
25
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$1(o.key), o);
26
+ }
27
+ }
28
+ function _createClass(e, r, t) {
29
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
30
+ writable: !1
31
+ }), e;
32
+ }
33
+ function _createForOfIteratorHelper(r, e) {
34
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
35
+ if (!t) {
36
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
37
+ t && (r = t);
38
+ var n = 0,
39
+ F = function () {};
40
+ return {
41
+ s: F,
42
+ n: function () {
43
+ return n >= r.length ? {
44
+ done: !0
45
+ } : {
46
+ done: !1,
47
+ value: r[n++]
48
+ };
49
+ },
50
+ e: function (r) {
51
+ throw r;
52
+ },
53
+ f: F
54
+ };
55
+ }
56
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
57
+ }
58
+ var o,
59
+ a = !0,
60
+ u = !1;
61
+ return {
62
+ s: function () {
63
+ t = t.call(r);
64
+ },
65
+ n: function () {
66
+ var r = t.next();
67
+ return a = r.done, r;
68
+ },
69
+ e: function (r) {
70
+ u = !0, o = r;
71
+ },
72
+ f: function () {
73
+ try {
74
+ a || null == t.return || t.return();
75
+ } finally {
76
+ if (u) throw o;
77
+ }
78
+ }
79
+ };
80
+ }
81
+ function _defineProperty$1(e, r, t) {
82
+ return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
83
+ value: t,
84
+ enumerable: !0,
85
+ configurable: !0,
86
+ writable: !0
87
+ }) : e[r] = t, e;
88
+ }
89
+ function _get() {
90
+ return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
91
+ var p = _superPropBase(e, t);
92
+ if (p) {
93
+ var n = Object.getOwnPropertyDescriptor(p, t);
94
+ return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
95
+ }
96
+ }, _get.apply(null, arguments);
97
+ }
98
+ function _getPrototypeOf(t) {
99
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
100
+ return t.__proto__ || Object.getPrototypeOf(t);
101
+ }, _getPrototypeOf(t);
102
+ }
103
+ function _inherits(t, e) {
104
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
105
+ t.prototype = Object.create(e && e.prototype, {
106
+ constructor: {
107
+ value: t,
108
+ writable: !0,
109
+ configurable: !0
110
+ }
111
+ }), Object.defineProperty(t, "prototype", {
112
+ writable: !1
113
+ }), e && _setPrototypeOf(t, e);
114
+ }
4
115
  function _isNativeReflectConstruct() {
5
116
  try {
6
117
  var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
@@ -9,6 +120,9 @@ function _isNativeReflectConstruct() {
9
120
  return !!t;
10
121
  })();
11
122
  }
123
+ function _iterableToArray(r) {
124
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
125
+ }
12
126
  function _iterableToArrayLimit(r, l) {
13
127
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
14
128
  if (null != t) {
@@ -36,6 +150,12 @@ function _iterableToArrayLimit(r, l) {
36
150
  return a;
37
151
  }
38
152
  }
153
+ function _nonIterableRest() {
154
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
155
+ }
156
+ function _nonIterableSpread() {
157
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
158
+ }
39
159
  function ownKeys$1(e, r) {
40
160
  var t = Object.keys(e);
41
161
  if (Object.getOwnPropertySymbols) {
@@ -57,11 +177,37 @@ function _objectSpread2$1(e) {
57
177
  }
58
178
  return e;
59
179
  }
180
+ function _possibleConstructorReturn(t, e) {
181
+ if (e && ("object" == typeof e || "function" == typeof e)) return e;
182
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
183
+ return _assertThisInitialized(t);
184
+ }
185
+ function _setPrototypeOf(t, e) {
186
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
187
+ return t.__proto__ = e, t;
188
+ }, _setPrototypeOf(t, e);
189
+ }
190
+ function _slicedToArray(r, e) {
191
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
192
+ }
193
+ function _superPropBase(t, o) {
194
+ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
195
+ return t;
196
+ }
197
+ function _superPropGet(t, o, e, r) {
198
+ var p = _get(_getPrototypeOf(t.prototype ), o, e);
199
+ return "function" == typeof p ? function (t) {
200
+ return p.apply(e, t);
201
+ } : p;
202
+ }
203
+ function _toConsumableArray(r) {
204
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
205
+ }
60
206
  function _toPrimitive$1(t, r) {
61
207
  if ("object" != typeof t || !t) return t;
62
208
  var e = t[Symbol.toPrimitive];
63
209
  if (void 0 !== e) {
64
- var i = e.call(t, r );
210
+ var i = e.call(t, r);
65
211
  if ("object" != typeof i) return i;
66
212
  throw new TypeError("@@toPrimitive must return a primitive value.");
67
213
  }
@@ -80,193 +226,13 @@ function _typeof(o) {
80
226
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
81
227
  }, _typeof(o);
82
228
  }
83
- function _classCallCheck(instance, Constructor) {
84
- if (!(instance instanceof Constructor)) {
85
- throw new TypeError("Cannot call a class as a function");
229
+ function _unsupportedIterableToArray(r, a) {
230
+ if (r) {
231
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
232
+ var t = {}.toString.call(r).slice(8, -1);
233
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
86
234
  }
87
235
  }
88
- function _defineProperties(target, props) {
89
- for (var i = 0; i < props.length; i++) {
90
- var descriptor = props[i];
91
- descriptor.enumerable = descriptor.enumerable || false;
92
- descriptor.configurable = true;
93
- if ("value" in descriptor) descriptor.writable = true;
94
- Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
95
- }
96
- }
97
- function _createClass(Constructor, protoProps, staticProps) {
98
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
99
- if (staticProps) _defineProperties(Constructor, staticProps);
100
- Object.defineProperty(Constructor, "prototype", {
101
- writable: false
102
- });
103
- return Constructor;
104
- }
105
- function _defineProperty$1(obj, key, value) {
106
- key = _toPropertyKey$1(key);
107
- if (key in obj) {
108
- Object.defineProperty(obj, key, {
109
- value: value,
110
- enumerable: true,
111
- configurable: true,
112
- writable: true
113
- });
114
- } else {
115
- obj[key] = value;
116
- }
117
- return obj;
118
- }
119
- function _inherits(subClass, superClass) {
120
- if (typeof superClass !== "function" && superClass !== null) {
121
- throw new TypeError("Super expression must either be null or a function");
122
- }
123
- subClass.prototype = Object.create(superClass && superClass.prototype, {
124
- constructor: {
125
- value: subClass,
126
- writable: true,
127
- configurable: true
128
- }
129
- });
130
- Object.defineProperty(subClass, "prototype", {
131
- writable: false
132
- });
133
- if (superClass) _setPrototypeOf(subClass, superClass);
134
- }
135
- function _getPrototypeOf(o) {
136
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
137
- return o.__proto__ || Object.getPrototypeOf(o);
138
- };
139
- return _getPrototypeOf(o);
140
- }
141
- function _setPrototypeOf(o, p) {
142
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
143
- o.__proto__ = p;
144
- return o;
145
- };
146
- return _setPrototypeOf(o, p);
147
- }
148
- function _assertThisInitialized(self) {
149
- if (self === void 0) {
150
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
151
- }
152
- return self;
153
- }
154
- function _possibleConstructorReturn(self, call) {
155
- if (call && (typeof call === "object" || typeof call === "function")) {
156
- return call;
157
- } else if (call !== void 0) {
158
- throw new TypeError("Derived constructors may only return object or undefined");
159
- }
160
- return _assertThisInitialized(self);
161
- }
162
- function _superPropBase(object, property) {
163
- while (!Object.prototype.hasOwnProperty.call(object, property)) {
164
- object = _getPrototypeOf(object);
165
- if (object === null) break;
166
- }
167
- return object;
168
- }
169
- function _get() {
170
- if (typeof Reflect !== "undefined" && Reflect.get) {
171
- _get = Reflect.get.bind();
172
- } else {
173
- _get = function _get(target, property, receiver) {
174
- var base = _superPropBase(target, property);
175
- if (!base) return;
176
- var desc = Object.getOwnPropertyDescriptor(base, property);
177
- if (desc.get) {
178
- return desc.get.call(arguments.length < 3 ? target : receiver);
179
- }
180
- return desc.value;
181
- };
182
- }
183
- return _get.apply(this, arguments);
184
- }
185
- function _slicedToArray(arr, i) {
186
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
187
- }
188
- function _toConsumableArray(arr) {
189
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
190
- }
191
- function _arrayWithoutHoles(arr) {
192
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
193
- }
194
- function _arrayWithHoles(arr) {
195
- if (Array.isArray(arr)) return arr;
196
- }
197
- function _iterableToArray(iter) {
198
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
199
- }
200
- function _unsupportedIterableToArray(o, minLen) {
201
- if (!o) return;
202
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
203
- var n = Object.prototype.toString.call(o).slice(8, -1);
204
- if (n === "Object" && o.constructor) n = o.constructor.name;
205
- if (n === "Map" || n === "Set") return Array.from(o);
206
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
207
- }
208
- function _arrayLikeToArray(arr, len) {
209
- if (len == null || len > arr.length) len = arr.length;
210
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
211
- return arr2;
212
- }
213
- function _nonIterableSpread() {
214
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
215
- }
216
- function _nonIterableRest() {
217
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
218
- }
219
- function _createForOfIteratorHelper(o, allowArrayLike) {
220
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
221
- if (!it) {
222
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike ) {
223
- if (it) o = it;
224
- var i = 0;
225
- var F = function () {};
226
- return {
227
- s: F,
228
- n: function () {
229
- if (i >= o.length) return {
230
- done: true
231
- };
232
- return {
233
- done: false,
234
- value: o[i++]
235
- };
236
- },
237
- e: function (e) {
238
- throw e;
239
- },
240
- f: F
241
- };
242
- }
243
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
244
- }
245
- var normalCompletion = true,
246
- didErr = false,
247
- err;
248
- return {
249
- s: function () {
250
- it = it.call(o);
251
- },
252
- n: function () {
253
- var step = it.next();
254
- normalCompletion = step.done;
255
- return step;
256
- },
257
- e: function (e) {
258
- didErr = true;
259
- err = e;
260
- },
261
- f: function () {
262
- try {
263
- if (!normalCompletion && it.return != null) it.return();
264
- } finally {
265
- if (didErr) throw err;
266
- }
267
- }
268
- };
269
- }
270
236
 
271
237
  function getDefaultExportFromCjs$2 (x) {
272
238
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -1042,7 +1008,7 @@ var Zepto = function () {
1042
1008
  },
1043
1009
  scrollTop: function (value) {
1044
1010
  if (!this.length) return;
1045
- var hasScrollTop = ('scrollTop' in this[0]);
1011
+ var hasScrollTop = 'scrollTop' in this[0];
1046
1012
  if (value === undefined$1) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset;
1047
1013
  return this.each(hasScrollTop ? function () {
1048
1014
  this.scrollTop = value;
@@ -1052,7 +1018,7 @@ var Zepto = function () {
1052
1018
  },
1053
1019
  scrollLeft: function (value) {
1054
1020
  if (!this.length) return;
1055
- var hasScrollLeft = ('scrollLeft' in this[0]);
1021
+ var hasScrollLeft = 'scrollLeft' in this[0];
1056
1022
  if (value === undefined$1) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset;
1057
1023
  return this.each(hasScrollLeft ? function () {
1058
1024
  this.scrollLeft = value;
@@ -1738,7 +1704,7 @@ window.$ === undefined && (window.$ = Zepto);
1738
1704
  },
1739
1705
  handlers = {},
1740
1706
  specialEvents = {},
1741
- focusinSupported = ('onfocusin' in window),
1707
+ focusinSupported = 'onfocusin' in window,
1742
1708
  focus = {
1743
1709
  focus: 'focusin',
1744
1710
  blur: 'focusout'
@@ -3277,7 +3243,7 @@ var Events$1 = /*#__PURE__*/function () {
3277
3243
  */
3278
3244
  }, {
3279
3245
  key: "once",
3280
- value: function once(name, callback, context) {
3246
+ value: function _once(name, callback, context) {
3281
3247
  var _this = this;
3282
3248
  var _once;
3283
3249
  if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
@@ -6081,7 +6047,7 @@ var Core = /*#__PURE__*/function (_UIObject) {
6081
6047
  key: "activePlaybackEl",
6082
6048
  get: function get() {
6083
6049
  if (!this.activePlayback) return undefined;
6084
- return this.activePlayback.$el ? this.activePlayback.$el.find('video')[0] : this.activePlayback.el;
6050
+ return this.activePlayback.$el ? this.activePlayback.$el.find('video')[0] || this.activePlayback.el : this.activePlayback.el;
6085
6051
  }
6086
6052
  }, {
6087
6053
  key: "configureDomRecycler",
@@ -6580,7 +6546,7 @@ var Loader = (function () {
6580
6546
  plugins: {},
6581
6547
  playbacks: []
6582
6548
  };
6583
- var currentVersion = "0.11.3";
6549
+ var currentVersion = "0.11.4";
6584
6550
  return /*#__PURE__*/function () {
6585
6551
  /**
6586
6552
  * builds the loader
@@ -7720,7 +7686,7 @@ var HTML5Video = /*#__PURE__*/function (_Playback) {
7720
7686
  key: "supportedVersion",
7721
7687
  get: function get() {
7722
7688
  return {
7723
- min: "0.11.3"
7689
+ min: "0.11.4"
7724
7690
  };
7725
7691
  }
7726
7692
  }, {
@@ -7822,7 +7788,7 @@ var HTML5Video = /*#__PURE__*/function (_Playback) {
7822
7788
  }, {
7823
7789
  key: "configure",
7824
7790
  value: function configure(options) {
7825
- _get(_getPrototypeOf(HTML5Video.prototype), "configure", this).call(this, options);
7791
+ _superPropGet(HTML5Video, "configure", this)([options]);
7826
7792
  this.el.loop = !!options.loop;
7827
7793
  }
7828
7794
 
@@ -7959,16 +7925,16 @@ var HTML5Video = /*#__PURE__*/function (_Playback) {
7959
7925
  value: function consent(cb) {
7960
7926
  var _this3 = this;
7961
7927
  if (this.isPlaying() || this.el._consented) {
7962
- _get(_getPrototypeOf(HTML5Video.prototype), "consent", this).call(this, cb);
7928
+ _superPropGet(HTML5Video, "consent", this)([cb]);
7963
7929
  } else {
7964
- var eventHandler = function eventHandler() {
7965
- _this3.el.removeEventListener('loadedmetadata', eventHandler, false);
7966
- _this3.el.removeEventListener('error', eventHandler, false);
7930
+ var _eventHandler = function eventHandler() {
7931
+ _this3.el.removeEventListener('loadedmetadata', _eventHandler, false);
7932
+ _this3.el.removeEventListener('error', _eventHandler, false);
7967
7933
  _this3.el._consented = true; // Flag to call load() only once
7968
- _get(_getPrototypeOf(HTML5Video.prototype), "consent", _this3).call(_this3, cb);
7934
+ _superPropGet(HTML5Video, "consent", _this3)([cb]);
7969
7935
  };
7970
- this.el.addEventListener('loadedmetadata', eventHandler, false);
7971
- this.el.addEventListener('error', eventHandler, false);
7936
+ this.el.addEventListener('loadedmetadata', _eventHandler, false);
7937
+ this.el.addEventListener('error', _eventHandler, false);
7972
7938
  this.el.load();
7973
7939
  }
7974
7940
  }
@@ -8224,7 +8190,7 @@ var HTML5Video = /*#__PURE__*/function (_Playback) {
8224
8190
  this._stopPlayheadMovingChecks();
8225
8191
  this.handleTextTrackChange && this.el.textTracks.removeEventListener('change', this.handleTextTrackChange);
8226
8192
  this.$el.off('contextmenu');
8227
- _get(_getPrototypeOf(HTML5Video.prototype), "destroy", this).call(this);
8193
+ _superPropGet(HTML5Video, "destroy", this)([]);
8228
8194
  this.el.removeAttribute('src');
8229
8195
  this.el.load(); // load with no src to stop loading of the previous source and avoid leaks
8230
8196
  this._src = null;
@@ -8482,7 +8448,7 @@ var HTML5Audio = /*#__PURE__*/function (_HTML5Video) {
8482
8448
  key: "supportedVersion",
8483
8449
  get: function get() {
8484
8450
  return {
8485
- min: "0.11.3"
8451
+ min: "0.11.4"
8486
8452
  };
8487
8453
  }
8488
8454
  }, {
@@ -8539,7 +8505,7 @@ var HTMLImg = /*#__PURE__*/function (_Playback) {
8539
8505
  key: "supportedVersion",
8540
8506
  get: function get() {
8541
8507
  return {
8542
- min: "0.11.3"
8508
+ min: "0.11.4"
8543
8509
  };
8544
8510
  }
8545
8511
  }, {
@@ -8622,7 +8588,7 @@ var NoOp = /*#__PURE__*/function (_Playback) {
8622
8588
  key: "supportedVersion",
8623
8589
  get: function get() {
8624
8590
  return {
8625
- min: "0.11.3"
8591
+ min: "0.11.4"
8626
8592
  };
8627
8593
  }
8628
8594
  }, {
@@ -8748,7 +8714,7 @@ var Strings = /*#__PURE__*/function (_CorePlugin) {
8748
8714
  key: "supportedVersion",
8749
8715
  get: function get() {
8750
8716
  return {
8751
- min: "0.11.3"
8717
+ min: "0.11.4"
8752
8718
  };
8753
8719
  }
8754
8720
  }, {
@@ -8890,7 +8856,7 @@ var SourcesPlugin = /*#__PURE__*/function (_CorePlugin) {
8890
8856
  key: "supportedVersion",
8891
8857
  get: function get() {
8892
8858
  return {
8893
- min: "0.11.3"
8859
+ min: "0.11.4"
8894
8860
  };
8895
8861
  }
8896
8862
  }, {
@@ -42243,6 +42209,7 @@ class Player {
42243
42209
  emitter = new EventLite();
42244
42210
  player = null;
42245
42211
  ready = false;
42212
+ rootNode = null;
42246
42213
  tuneInTimerId = null;
42247
42214
  tunedIn = false;
42248
42215
  get activePlayback() {
@@ -42258,6 +42225,12 @@ class Player {
42258
42225
  return 'native';
42259
42226
  }
42260
42227
  }
42228
+ get activeSource() {
42229
+ if (!this.player?.core.activePlayback) {
42230
+ return null;
42231
+ }
42232
+ return this.player.core.activePlayback.options.src;
42233
+ }
42261
42234
  get bitrate() {
42262
42235
  return this.bitrateInfo;
42263
42236
  }
@@ -42380,6 +42353,7 @@ class Player {
42380
42353
  this.bindBitrateChangeHandler();
42381
42354
  }
42382
42355
  player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => {
42356
+ // this.trigger(Events.ContainerChanged)
42383
42357
  this.bindBitrateChangeHandler();
42384
42358
  }, null);
42385
42359
  if (Browser.isiOS && player.core.activePlayback) {
@@ -42393,7 +42367,19 @@ class Player {
42393
42367
  });
42394
42368
  }
42395
42369
  player.core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42396
- trace(`${T} CORE_SCREEN_ORIENTATION_CHANGED`, { orientation });
42370
+ trace(`${T} CORE_SCREEN_ORIENTATION_CHANGED`, {
42371
+ orientation,
42372
+ rootNode: {
42373
+ width: this.rootNode?.clientWidth,
42374
+ height: this.rootNode?.clientHeight,
42375
+ },
42376
+ });
42377
+ if (Browser.isiOS && this.rootNode) {
42378
+ player.core.resize({
42379
+ width: this.rootNode.clientWidth,
42380
+ height: this.rootNode.clientHeight,
42381
+ });
42382
+ }
42397
42383
  }, null);
42398
42384
  player.core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42399
42385
  trace(`${T} CORE_RESIZE`, {
@@ -42431,7 +42417,7 @@ class Player {
42431
42417
  setTimeout(() => this.tuneIn(), 0);
42432
42418
  },
42433
42419
  onResize: (newSize) => {
42434
- trace(`${T} CORE_RESIZE`, {
42420
+ trace(`${T} onResize`, {
42435
42421
  newSize,
42436
42422
  });
42437
42423
  },
@@ -42468,7 +42454,7 @@ class Player {
42468
42454
  }
42469
42455
  },
42470
42456
  };
42471
- buildCoreOptions(playerElement) {
42457
+ buildCoreOptions(rootNode) {
42472
42458
  const multisources = this.config.multisources;
42473
42459
  const mainSource = this.config.playbackType === 'live'
42474
42460
  ? multisources.find((ms) => ms.live !== false)
@@ -42478,13 +42464,14 @@ class Player {
42478
42464
  : [];
42479
42465
  // const mainSourceUrl = mediaSources[0];
42480
42466
  const poster = mainSource?.poster ?? this.config.poster;
42467
+ this.rootNode = rootNode;
42481
42468
  const coreOptions = {
42482
42469
  ...this.config.pluginSettings,
42483
42470
  allowUserInteraction: true,
42484
42471
  autoPlay: false,
42485
42472
  debug: this.config.debug || 'none',
42486
42473
  events: this.events,
42487
- height: playerElement.clientHeight,
42474
+ height: rootNode.clientHeight,
42488
42475
  loop: this.config.loop,
42489
42476
  multisources,
42490
42477
  mute: this.config.mute,
@@ -42498,10 +42485,10 @@ class Player {
42498
42485
  debug: this.config.debug === 'all' || this.config.debug === 'hls',
42499
42486
  },
42500
42487
  },
42501
- parent: playerElement,
42488
+ parent: rootNode,
42502
42489
  playbackType: this.config.playbackType,
42503
42490
  poster,
42504
- width: playerElement.clientWidth,
42491
+ width: rootNode.clientWidth,
42505
42492
  // source: mainSourceUrl,
42506
42493
  sources: mediaSources,
42507
42494
  strings: this.config.strings,
@@ -42509,6 +42496,7 @@ class Player {
42509
42496
  return coreOptions;
42510
42497
  }
42511
42498
  configurePlaybacks() {
42499
+ // TODO check if there are DASH and HLS sources and don't register the respective playbacks if not
42512
42500
  Loader.registerPlayback(DashPlayback);
42513
42501
  Loader.registerPlayback(HlsPlayback);
42514
42502
  }
@@ -42694,12 +42682,12 @@ class SentryTracer {
42694
42682
  }
42695
42683
  }
42696
42684
 
42697
- var version$1 = "2.1.13";
42685
+ var version$1 = "2.3.0";
42698
42686
 
42699
42687
  var packages = {
42700
42688
  "": {
42701
42689
  name: "@gcorevideo/player",
42702
- version: "2.1.13",
42690
+ version: "2.3.0",
42703
42691
  license: "Apache-2.0",
42704
42692
  dependencies: {
42705
42693
  "@clappr/core": "^0.11.3",
@@ -42723,9 +42711,9 @@ var packages = {
42723
42711
  }
42724
42712
  },
42725
42713
  "node_modules/@clappr/core": {
42726
- version: "0.11.3",
42727
- resolved: "https://registry.npmjs.org/@clappr/core/-/core-0.11.3.tgz",
42728
- integrity: "sha512-3oelZ5th+P7BAlpkYNcxI7JV4rGOr+n+h6BMJK4tw5d1iC68CRAC03SJsxjfxPlR0YvQTq2aARQ+2imqXQyUXQ==",
42714
+ version: "0.11.4",
42715
+ resolved: "https://registry.npmjs.org/@clappr/core/-/core-0.11.4.tgz",
42716
+ integrity: "sha512-JC/YtMRhB7fmw4/jAD7Rocom0mdlUDKyJRH/6aEKk3gTzHdqQIzH5pnm/k2CJCG31XFBOZLvYo5vk0Y1EPmtAw==",
42729
42717
  license: "BSD-3-Clause"
42730
42718
  },
42731
42719
  "node_modules/@jridgewell/sourcemap-codec": {
@@ -44548,6 +44536,8 @@ function version() {
44548
44536
  return {
44549
44537
  gplayer: version$1,
44550
44538
  clappr: packages['node_modules/@clappr/core'].version,
44539
+ dashjs: packages['node_modules/dashjs'].version,
44540
+ hlsjs: packages['node_modules/hls.js'].version,
44551
44541
  };
44552
44542
  }
44553
44543
 
package/lib/Player.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { BitrateInfo, PlaybackType, PlayerPlugin } from './types.js';
2
2
  import { PlayerConfig, PlayerEvent } from './types.js';
3
- import '../assets/style/main.scss';
4
3
  type PlayerEventHandler<T extends PlayerEvent> = () => void;
5
4
  export type PlaybackModule = 'dash' | 'hls' | 'native';
6
5
  /**
@@ -12,9 +11,11 @@ export declare class Player {
12
11
  private emitter;
13
12
  private player;
14
13
  private ready;
14
+ private rootNode;
15
15
  private tuneInTimerId;
16
16
  private tunedIn;
17
17
  get activePlayback(): PlaybackModule | null;
18
+ get activeSource(): string | null;
18
19
  get bitrate(): BitrateInfo | null;
19
20
  get hd(): any;
20
21
  get playbackType(): PlaybackType | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EAEb,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAItD,OAAO,2BAA2B,CAAA;AAIlC,KAAK,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI,MAAM,IAAI,CAAA;AAiB3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;AAItD;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,WAAW,CAA2B;IAE9C,OAAO,CAAC,MAAM,CAAgC;IAE9C,OAAO,CAAC,OAAO,CAAkB;IAEjC,OAAO,CAAC,MAAM,CAA4B;IAE1C,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO,CAAC,aAAa,CAA6C;IAElE,OAAO,CAAC,OAAO,CAAQ;IAEvB,IAAI,cAAc,IAAI,cAAc,GAAG,IAAI,CAY1C;IAED,IAAI,OAAO,IAAI,WAAW,GAAG,IAAI,CAEhC;IAED,IAAI,EAAE,QAEL;IAED,IAAI,YAAY,IAAI,YAAY,GAAG,S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