@eluvio/elv-player-js 2.1.26 → 2.1.29
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/.vite/manifest.json +16 -26
- package/dist/Analytics-B0HNzKyF.js +22 -0
- package/dist/{Analytics-Cia_WeMD.mjs → Analytics-PhARu_hv.mjs} +741 -673
- package/dist/dash.all.min-27fvn-N6.js +21 -0
- package/dist/dash.all.min-yDykE22p.mjs +18838 -0
- package/dist/elv-player-js.cjs.js +1 -1
- package/dist/elv-player-js.es.js +1 -1
- package/dist/{index-SUB8Y1LV.js → index-B1O74cO8.js} +1 -1
- package/dist/{index-znYnmQZ9.mjs → index-BrEf07aq.mjs} +75 -75
- package/dist/{index-DIMPV66P.mjs → index-D31_YQxo.mjs} +1 -1
- package/dist/{index-B3BXYKlU.js → index-oPcDkWfW.js} +4 -4
- package/lib/player/Analytics.js +1 -1
- package/lib/player/Cast.js +4 -2
- package/lib/player/Controls.js +6 -6
- package/lib/player/Player.js +20 -19
- package/lib/ui/PlayerUI.jsx +2 -3
- package/lib/ui/WebControls.jsx +1 -1
- package/package.json +3 -3
- package/dist/Analytics-C8OZKhRN.js +0 -22
- package/dist/dash.all.min-CyrHsR08.mjs +0 -18380
- package/dist/dash.all.min-DK6_ZBJe.js +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ht = Object.create, Ue = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, vt = Object.getOwnPropertyNames, mt = Object.getPrototypeOf, yt = Object.prototype.hasOwnProperty, Fe = function(a, e) {
|
|
2
2
|
return function() {
|
|
3
3
|
return a && (e = a(a = 0)), e;
|
|
4
4
|
};
|
|
@@ -7,13 +7,13 @@ var pt = Object.create, Ue = Object.defineProperty, ft = Object.getOwnPropertyDe
|
|
|
7
7
|
return e || a((e = { exports: {} }).exports, e), e.exports;
|
|
8
8
|
};
|
|
9
9
|
}, gt = function(a, e, t, r) {
|
|
10
|
-
if (e && typeof e == "object" || typeof e == "function") for (var i = vt(e), n = 0,
|
|
10
|
+
if (e && typeof e == "object" || typeof e == "function") for (var i = vt(e), n = 0, s = i.length, u; n < s; n++) u = i[n], !yt.call(a, u) && u !== t && Ue(a, u, { get: (function(d) {
|
|
11
11
|
return e[d];
|
|
12
12
|
}).bind(null, u), enumerable: !(r = ft(e, u)) || r.enumerable });
|
|
13
13
|
return a;
|
|
14
|
-
},
|
|
15
|
-
return t = a != null ?
|
|
16
|
-
},
|
|
14
|
+
}, j = function(a, e, t) {
|
|
15
|
+
return t = a != null ? ht(mt(a)) : {}, gt(!a || !a.__esModule ? Ue(t, "default", { value: a, enumerable: !0 }) : t, a);
|
|
16
|
+
}, G = N(function(a, e) {
|
|
17
17
|
var t;
|
|
18
18
|
typeof window < "u" ? t = window : typeof global < "u" ? t = global : typeof self < "u" ? t = self : t = {}, e.exports = t;
|
|
19
19
|
});
|
|
@@ -23,19 +23,19 @@ function Z(a, e) {
|
|
|
23
23
|
var $ = Fe(function() {
|
|
24
24
|
$();
|
|
25
25
|
});
|
|
26
|
-
function
|
|
26
|
+
function Ge(a) {
|
|
27
27
|
"@swc/helpers - typeof";
|
|
28
28
|
return a && typeof Symbol < "u" && a.constructor === Symbol ? "symbol" : typeof a;
|
|
29
29
|
}
|
|
30
30
|
var Qe = Fe(function() {
|
|
31
|
-
}),
|
|
31
|
+
}), We = N(function(a, e) {
|
|
32
32
|
var t = Array.prototype.slice;
|
|
33
33
|
e.exports = r;
|
|
34
34
|
function r(i, n) {
|
|
35
35
|
for (("length" in i) || (i = [i]), i = t.call(i); i.length; ) {
|
|
36
|
-
var
|
|
36
|
+
var s = i.shift(), u = n(s);
|
|
37
37
|
if (u) return u;
|
|
38
|
-
|
|
38
|
+
s.childNodes && s.childNodes.length && (i = t.call(s.childNodes).concat(i));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}), bt = N(function(a, e) {
|
|
@@ -56,7 +56,7 @@ var Qe = Fe(function() {
|
|
|
56
56
|
t.prototype.type = "DOMTextNode", t.prototype.nodeType = 3, t.prototype.nodeName = "#text", t.prototype.toString = function() {
|
|
57
57
|
return this.data;
|
|
58
58
|
}, t.prototype.replaceData = function(r, i, n) {
|
|
59
|
-
var
|
|
59
|
+
var s = this.data, u = s.substring(0, r), d = s.substring(r + i, s.length);
|
|
60
60
|
this.data = u + n + d, this.length = this.data.length;
|
|
61
61
|
};
|
|
62
62
|
}), Ve = N(function(a, e) {
|
|
@@ -64,8 +64,8 @@ var Qe = Fe(function() {
|
|
|
64
64
|
function t(r) {
|
|
65
65
|
var i = this, n = r.type;
|
|
66
66
|
r.target || (r.target = i), i.listeners || (i.listeners = {});
|
|
67
|
-
var
|
|
68
|
-
if (
|
|
67
|
+
var s = i.listeners[n];
|
|
68
|
+
if (s) return s.forEach(function(u) {
|
|
69
69
|
r.currentTarget = i, typeof u == "function" ? u(r) : u.handleEvent(r);
|
|
70
70
|
});
|
|
71
71
|
i.parentNode && i.parentNode.dispatchEvent(r);
|
|
@@ -81,137 +81,137 @@ var Qe = Fe(function() {
|
|
|
81
81
|
function t(r, i) {
|
|
82
82
|
var n = this;
|
|
83
83
|
if (n.listeners && n.listeners[r]) {
|
|
84
|
-
var
|
|
85
|
-
u !== -1 &&
|
|
84
|
+
var s = n.listeners[r], u = s.indexOf(i);
|
|
85
|
+
u !== -1 && s.splice(u, 1);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}), Tt = N(function(a, e) {
|
|
89
89
|
Qe(), e.exports = r;
|
|
90
90
|
var t = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"];
|
|
91
|
-
function r(
|
|
92
|
-
switch (
|
|
91
|
+
function r(c) {
|
|
92
|
+
switch (c.nodeType) {
|
|
93
93
|
case 3:
|
|
94
|
-
return
|
|
94
|
+
return m(c.data);
|
|
95
95
|
case 8:
|
|
96
|
-
return "<!--" +
|
|
96
|
+
return "<!--" + c.data + "-->";
|
|
97
97
|
default:
|
|
98
|
-
return i(
|
|
98
|
+
return i(c);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
function i(
|
|
102
|
-
var
|
|
103
|
-
return
|
|
101
|
+
function i(c) {
|
|
102
|
+
var o = [], p = c.tagName;
|
|
103
|
+
return c.namespaceURI === "http://www.w3.org/1999/xhtml" && (p = p.toLowerCase()), o.push("<" + p + l(c) + u(c)), t.indexOf(p) > -1 ? o.push(" />") : (o.push(">"), c.childNodes.length ? o.push.apply(o, c.childNodes.map(r)) : c.textContent || c.innerText ? o.push(m(c.textContent || c.innerText)) : c.innerHTML && o.push(c.innerHTML), o.push("</" + p + ">")), o.join("");
|
|
104
104
|
}
|
|
105
|
-
function n(
|
|
106
|
-
var
|
|
107
|
-
return
|
|
105
|
+
function n(c, o) {
|
|
106
|
+
var p = Ge(c[o]);
|
|
107
|
+
return o === "style" && Object.keys(c.style).length > 0 ? !0 : c.hasOwnProperty(o) && (p === "string" || p === "boolean" || p === "number") && o !== "nodeName" && o !== "className" && o !== "tagName" && o !== "textContent" && o !== "innerText" && o !== "namespaceURI" && o !== "innerHTML";
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
if (typeof
|
|
111
|
-
var
|
|
112
|
-
return Object.keys(
|
|
113
|
-
var y =
|
|
114
|
-
|
|
109
|
+
function s(c) {
|
|
110
|
+
if (typeof c == "string") return c;
|
|
111
|
+
var o = "";
|
|
112
|
+
return Object.keys(c).forEach(function(p) {
|
|
113
|
+
var y = c[p];
|
|
114
|
+
p = p.replace(/[A-Z]/g, function(f) {
|
|
115
115
|
return "-" + f.toLowerCase();
|
|
116
|
-
}),
|
|
117
|
-
}),
|
|
118
|
-
}
|
|
119
|
-
function u(
|
|
120
|
-
var
|
|
121
|
-
for (var y in
|
|
122
|
-
return
|
|
123
|
-
}
|
|
124
|
-
function d(
|
|
125
|
-
var
|
|
126
|
-
return
|
|
127
|
-
var y =
|
|
128
|
-
y === "style" && (f =
|
|
129
|
-
}),
|
|
130
|
-
}
|
|
131
|
-
function c
|
|
132
|
-
var
|
|
133
|
-
for (var
|
|
134
|
-
for (var y in
|
|
135
|
-
var g =
|
|
136
|
-
|
|
116
|
+
}), o += p + ":" + y + ";";
|
|
117
|
+
}), o;
|
|
118
|
+
}
|
|
119
|
+
function u(c) {
|
|
120
|
+
var o = c.dataset, p = [];
|
|
121
|
+
for (var y in o) p.push({ name: "data-" + y, value: o[y] });
|
|
122
|
+
return p.length ? d(p) : "";
|
|
123
|
+
}
|
|
124
|
+
function d(c) {
|
|
125
|
+
var o = [];
|
|
126
|
+
return c.forEach(function(p) {
|
|
127
|
+
var y = p.name, f = p.value;
|
|
128
|
+
y === "style" && (f = s(f)), o.push(y + '="' + b(f) + '"');
|
|
129
|
+
}), o.length ? " " + o.join(" ") : "";
|
|
130
|
+
}
|
|
131
|
+
function l(c) {
|
|
132
|
+
var o = [];
|
|
133
|
+
for (var p in c) n(c, p) && o.push({ name: p, value: c[p] });
|
|
134
|
+
for (var y in c._attributes) for (var f in c._attributes[y]) {
|
|
135
|
+
var g = c._attributes[y][f], _ = (g.prefix ? g.prefix + ":" : "") + f;
|
|
136
|
+
o.push({ name: _, value: g.value });
|
|
137
137
|
}
|
|
138
|
-
return
|
|
138
|
+
return c.className && o.push({ name: "class", value: c.className }), o.length ? d(o) : "";
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
var
|
|
142
|
-
return typeof
|
|
140
|
+
function m(c) {
|
|
141
|
+
var o = "";
|
|
142
|
+
return typeof c == "string" ? o = c : c && (o = c.toString()), o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
143
143
|
}
|
|
144
|
-
function b(
|
|
145
|
-
return
|
|
144
|
+
function b(c) {
|
|
145
|
+
return m(c).replace(/"/g, """);
|
|
146
146
|
}
|
|
147
147
|
}), Ke = N(function(a, e) {
|
|
148
148
|
$();
|
|
149
|
-
var t =
|
|
149
|
+
var t = We(), r = Ve(), i = Je(), n = ze(), s = Tt(), u = "http://www.w3.org/1999/xhtml";
|
|
150
150
|
e.exports = d;
|
|
151
|
-
function d(
|
|
152
|
-
if (!Z(this, d)) return new d(
|
|
153
|
-
var
|
|
154
|
-
this.tagName =
|
|
155
|
-
}
|
|
156
|
-
d.prototype.type = "DOMElement", d.prototype.nodeType = 1, d.prototype.appendChild = function(
|
|
157
|
-
return
|
|
158
|
-
}, d.prototype.replaceChild = function(
|
|
159
|
-
|
|
160
|
-
var b = this.childNodes.indexOf(
|
|
161
|
-
return
|
|
162
|
-
}, d.prototype.removeChild = function(
|
|
163
|
-
var
|
|
164
|
-
return this.childNodes.splice(
|
|
165
|
-
}, d.prototype.insertBefore = function(
|
|
166
|
-
|
|
167
|
-
var b =
|
|
168
|
-
return b > -1 ? this.childNodes.splice(b, 0,
|
|
169
|
-
}, d.prototype.setAttributeNS = function(
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
151
|
+
function d(l, m, b) {
|
|
152
|
+
if (!Z(this, d)) return new d(l);
|
|
153
|
+
var c = b === void 0 ? u : b || null;
|
|
154
|
+
this.tagName = c === u ? String(l).toUpperCase() : l, this.nodeName = this.tagName, this.className = "", this.dataset = {}, this.childNodes = [], this.parentNode = null, this.style = {}, this.ownerDocument = m || null, this.namespaceURI = c, this._attributes = {}, this.tagName === "INPUT" && (this.type = "text");
|
|
155
|
+
}
|
|
156
|
+
d.prototype.type = "DOMElement", d.prototype.nodeType = 1, d.prototype.appendChild = function(l) {
|
|
157
|
+
return l.parentNode && l.parentNode.removeChild(l), this.childNodes.push(l), l.parentNode = this, l;
|
|
158
|
+
}, d.prototype.replaceChild = function(l, m) {
|
|
159
|
+
l.parentNode && l.parentNode.removeChild(l);
|
|
160
|
+
var b = this.childNodes.indexOf(m);
|
|
161
|
+
return m.parentNode = null, this.childNodes[b] = l, l.parentNode = this, m;
|
|
162
|
+
}, d.prototype.removeChild = function(l) {
|
|
163
|
+
var m = this.childNodes.indexOf(l);
|
|
164
|
+
return this.childNodes.splice(m, 1), l.parentNode = null, l;
|
|
165
|
+
}, d.prototype.insertBefore = function(l, m) {
|
|
166
|
+
l.parentNode && l.parentNode.removeChild(l);
|
|
167
|
+
var b = m == null ? -1 : this.childNodes.indexOf(m);
|
|
168
|
+
return b > -1 ? this.childNodes.splice(b, 0, l) : this.childNodes.push(l), l.parentNode = this, l;
|
|
169
|
+
}, d.prototype.setAttributeNS = function(l, m, b) {
|
|
170
|
+
var c = null, o = m, p = m.indexOf(":");
|
|
171
|
+
if (p > -1 && (c = m.substr(0, p), o = m.substr(p + 1)), this.tagName === "INPUT" && m === "type") this.type = b;
|
|
172
172
|
else {
|
|
173
|
-
var y = this._attributes[
|
|
174
|
-
y[
|
|
173
|
+
var y = this._attributes[l] || (this._attributes[l] = {});
|
|
174
|
+
y[o] = { value: b, prefix: c };
|
|
175
175
|
}
|
|
176
|
-
}, d.prototype.getAttributeNS = function(
|
|
177
|
-
var b = this._attributes[
|
|
178
|
-
return this.tagName === "INPUT" &&
|
|
179
|
-
}, d.prototype.removeAttributeNS = function(
|
|
180
|
-
var b = this._attributes[
|
|
181
|
-
b && delete b[
|
|
182
|
-
}, d.prototype.hasAttributeNS = function(
|
|
183
|
-
var b = this._attributes[
|
|
184
|
-
return !!b &&
|
|
185
|
-
}, d.prototype.setAttribute = function(
|
|
186
|
-
return this.setAttributeNS(null,
|
|
187
|
-
}, d.prototype.getAttribute = function(
|
|
188
|
-
return this.getAttributeNS(null,
|
|
189
|
-
}, d.prototype.removeAttribute = function(
|
|
190
|
-
return this.removeAttributeNS(null,
|
|
191
|
-
}, d.prototype.hasAttribute = function(
|
|
192
|
-
return this.hasAttributeNS(null,
|
|
176
|
+
}, d.prototype.getAttributeNS = function(l, m) {
|
|
177
|
+
var b = this._attributes[l], c = b && b[m] && b[m].value;
|
|
178
|
+
return this.tagName === "INPUT" && m === "type" ? this.type : typeof c != "string" ? null : c;
|
|
179
|
+
}, d.prototype.removeAttributeNS = function(l, m) {
|
|
180
|
+
var b = this._attributes[l];
|
|
181
|
+
b && delete b[m];
|
|
182
|
+
}, d.prototype.hasAttributeNS = function(l, m) {
|
|
183
|
+
var b = this._attributes[l];
|
|
184
|
+
return !!b && m in b;
|
|
185
|
+
}, d.prototype.setAttribute = function(l, m) {
|
|
186
|
+
return this.setAttributeNS(null, l, m);
|
|
187
|
+
}, d.prototype.getAttribute = function(l) {
|
|
188
|
+
return this.getAttributeNS(null, l);
|
|
189
|
+
}, d.prototype.removeAttribute = function(l) {
|
|
190
|
+
return this.removeAttributeNS(null, l);
|
|
191
|
+
}, d.prototype.hasAttribute = function(l) {
|
|
192
|
+
return this.hasAttributeNS(null, l);
|
|
193
193
|
}, d.prototype.removeEventListener = n, d.prototype.addEventListener = i, d.prototype.dispatchEvent = r, d.prototype.focus = function() {
|
|
194
194
|
}, d.prototype.toString = function() {
|
|
195
|
-
return
|
|
196
|
-
}, d.prototype.getElementsByClassName = function(
|
|
197
|
-
var
|
|
198
|
-
return t(this, function(
|
|
199
|
-
if (
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
return
|
|
203
|
-
}) && b.push(
|
|
195
|
+
return s(this);
|
|
196
|
+
}, d.prototype.getElementsByClassName = function(l) {
|
|
197
|
+
var m = l.split(" "), b = [];
|
|
198
|
+
return t(this, function(c) {
|
|
199
|
+
if (c.nodeType === 1) {
|
|
200
|
+
var o = c.className || "", p = o.split(" ");
|
|
201
|
+
m.every(function(y) {
|
|
202
|
+
return p.indexOf(y) !== -1;
|
|
203
|
+
}) && b.push(c);
|
|
204
204
|
}
|
|
205
205
|
}), b;
|
|
206
|
-
}, d.prototype.getElementsByTagName = function(
|
|
207
|
-
|
|
208
|
-
var
|
|
206
|
+
}, d.prototype.getElementsByTagName = function(l) {
|
|
207
|
+
l = l.toLowerCase();
|
|
208
|
+
var m = [];
|
|
209
209
|
return t(this.childNodes, function(b) {
|
|
210
|
-
b.nodeType === 1 && (
|
|
211
|
-
}),
|
|
212
|
-
}, d.prototype.contains = function(
|
|
213
|
-
return t(this, function(
|
|
214
|
-
return
|
|
210
|
+
b.nodeType === 1 && (l === "*" || b.tagName.toLowerCase() === l) && m.push(b);
|
|
211
|
+
}), m;
|
|
212
|
+
}, d.prototype.contains = function(l) {
|
|
213
|
+
return t(this, function(m) {
|
|
214
|
+
return l === m;
|
|
215
215
|
}) || !1;
|
|
216
216
|
};
|
|
217
217
|
}), kt = N(function(a, e) {
|
|
@@ -237,33 +237,33 @@ var Qe = Fe(function() {
|
|
|
237
237
|
};
|
|
238
238
|
}), xt = N(function(a, e) {
|
|
239
239
|
$();
|
|
240
|
-
var t =
|
|
240
|
+
var t = We(), r = bt(), i = wt(), n = Ke(), s = kt(), u = Et(), d = Ve(), l = Je(), m = ze();
|
|
241
241
|
e.exports = b;
|
|
242
242
|
function b() {
|
|
243
243
|
if (!Z(this, b)) return new b();
|
|
244
244
|
this.head = this.createElement("head"), this.body = this.createElement("body"), this.documentElement = this.createElement("html"), this.documentElement.appendChild(this.head), this.documentElement.appendChild(this.body), this.childNodes = [this.documentElement], this.nodeType = 9;
|
|
245
245
|
}
|
|
246
|
-
var
|
|
247
|
-
|
|
248
|
-
return new i(
|
|
249
|
-
},
|
|
250
|
-
var y =
|
|
251
|
-
return new n(
|
|
252
|
-
},
|
|
253
|
-
return new n(
|
|
254
|
-
},
|
|
255
|
-
return new
|
|
256
|
-
},
|
|
257
|
-
return new u(
|
|
258
|
-
},
|
|
259
|
-
return new r(
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
var
|
|
263
|
-
if (String(y.id) ===
|
|
246
|
+
var c = b.prototype;
|
|
247
|
+
c.createTextNode = function(o) {
|
|
248
|
+
return new i(o, this);
|
|
249
|
+
}, c.createElementNS = function(o, p) {
|
|
250
|
+
var y = o === null ? null : String(o);
|
|
251
|
+
return new n(p, this, y);
|
|
252
|
+
}, c.createElement = function(o) {
|
|
253
|
+
return new n(o, this);
|
|
254
|
+
}, c.createDocumentFragment = function() {
|
|
255
|
+
return new s(this);
|
|
256
|
+
}, c.createEvent = function(o) {
|
|
257
|
+
return new u(o);
|
|
258
|
+
}, c.createComment = function(o) {
|
|
259
|
+
return new r(o, this);
|
|
260
|
+
}, c.getElementById = function(o) {
|
|
261
|
+
o = String(o);
|
|
262
|
+
var p = t(this.childNodes, function(y) {
|
|
263
|
+
if (String(y.id) === o) return y;
|
|
264
264
|
});
|
|
265
|
-
return
|
|
266
|
-
},
|
|
265
|
+
return p || null;
|
|
266
|
+
}, c.getElementsByClassName = n.prototype.getElementsByClassName, c.getElementsByTagName = n.prototype.getElementsByTagName, c.contains = n.prototype.contains, c.removeEventListener = m, c.addEventListener = l, c.dispatchEvent = d;
|
|
267
267
|
}), Dt = N(function(a, e) {
|
|
268
268
|
var t = xt();
|
|
269
269
|
e.exports = new t();
|
|
@@ -271,15 +271,15 @@ var Qe = Fe(function() {
|
|
|
271
271
|
var t = typeof global < "u" ? global : typeof window < "u" ? window : {}, r = Dt(), i;
|
|
272
272
|
typeof document < "u" ? i = document : (i = t["__GLOBAL_DOCUMENT_CACHE@4"], i || (i = t["__GLOBAL_DOCUMENT_CACHE@4"] = r)), e.exports = i;
|
|
273
273
|
});
|
|
274
|
-
function
|
|
274
|
+
function Rt(a) {
|
|
275
275
|
if (Array.isArray(a)) return a;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function qt(a, e) {
|
|
278
278
|
var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
|
|
279
279
|
if (t != null) {
|
|
280
|
-
var r = [], i = !0, n = !1,
|
|
280
|
+
var r = [], i = !0, n = !1, s, u;
|
|
281
281
|
try {
|
|
282
|
-
for (t = t.call(a); !(i = (
|
|
282
|
+
for (t = t.call(a); !(i = (s = t.next()).done) && (r.push(s.value), !(e && r.length === e)); i = !0) ;
|
|
283
283
|
} catch (d) {
|
|
284
284
|
n = !0, u = d;
|
|
285
285
|
} finally {
|
|
@@ -292,33 +292,33 @@ function Rt(a, e) {
|
|
|
292
292
|
return r;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function At() {
|
|
296
296
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
297
297
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Re(a, e) {
|
|
300
300
|
(e == null || e > a.length) && (e = a.length);
|
|
301
301
|
for (var t = 0, r = new Array(e); t < e; t++) r[t] = a[t];
|
|
302
302
|
return r;
|
|
303
303
|
}
|
|
304
304
|
function Xe(a, e) {
|
|
305
305
|
if (a) {
|
|
306
|
-
if (typeof a == "string") return
|
|
306
|
+
if (typeof a == "string") return Re(a, e);
|
|
307
307
|
var t = Object.prototype.toString.call(a).slice(8, -1);
|
|
308
308
|
if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(t);
|
|
309
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return
|
|
309
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Re(a, e);
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
function Q(a, e) {
|
|
313
|
-
return
|
|
313
|
+
return Rt(a) || qt(a, e) || Xe(a, e) || At();
|
|
314
314
|
}
|
|
315
|
-
var
|
|
316
|
-
var a =
|
|
315
|
+
var oe = j(G()), Ie = j(G()), St = j(G()), Ot = { now: function() {
|
|
316
|
+
var a = St.default.performance, e = a && a.timing, t = e && e.navigationStart, r = typeof t == "number" && typeof a.now == "function" ? t + a.now() : Date.now();
|
|
317
317
|
return Math.round(r);
|
|
318
|
-
} },
|
|
318
|
+
} }, I = Ot, de = function() {
|
|
319
319
|
var a, e, t;
|
|
320
|
-
if (typeof ((a =
|
|
321
|
-
t = new Uint8Array(32),
|
|
320
|
+
if (typeof ((a = Ie.default.crypto) === null || a === void 0 ? void 0 : a.getRandomValues) == "function") {
|
|
321
|
+
t = new Uint8Array(32), Ie.default.crypto.getRandomValues(t);
|
|
322
322
|
for (var r = 0; r < 32; r++) t[r] = t[r] % 16;
|
|
323
323
|
} else {
|
|
324
324
|
t = [];
|
|
@@ -326,10 +326,10 @@ var se = C(U()), Le = C(U()), Ot = C(U()), At = { now: function() {
|
|
|
326
326
|
}
|
|
327
327
|
var n = 0;
|
|
328
328
|
e = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(d) {
|
|
329
|
-
var
|
|
330
|
-
return n++,
|
|
329
|
+
var l = d === "x" ? t[n] : t[n] & 3 | 8;
|
|
330
|
+
return n++, l.toString(16);
|
|
331
331
|
});
|
|
332
|
-
var
|
|
332
|
+
var s = I.now(), u = s?.toString(16).substring(3);
|
|
333
333
|
return u ? e.substring(0, 28) + u : e;
|
|
334
334
|
}, Ze = function() {
|
|
335
335
|
return ("000000" + (Math.random() * Math.pow(36, 6) << 0).toString(36)).slice(-6);
|
|
@@ -341,14 +341,14 @@ var se = C(U()), Le = C(U()), Ot = C(U()), At = { now: function() {
|
|
|
341
341
|
} catch {
|
|
342
342
|
}
|
|
343
343
|
return e && !e.muxId && (e.muxId = a), e?.muxId || a;
|
|
344
|
-
},
|
|
344
|
+
}, _e = function(a) {
|
|
345
345
|
var e;
|
|
346
346
|
a && typeof a.nodeName < "u" ? (e = a, a = H(e)) : e = document.querySelector(a);
|
|
347
347
|
var t = e && e.nodeName ? e.nodeName.toLowerCase() : "";
|
|
348
348
|
return [e, a, t];
|
|
349
349
|
};
|
|
350
350
|
function Pt(a) {
|
|
351
|
-
if (Array.isArray(a)) return
|
|
351
|
+
if (Array.isArray(a)) return Re(a);
|
|
352
352
|
}
|
|
353
353
|
function Lt(a) {
|
|
354
354
|
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
|
|
@@ -357,32 +357,32 @@ function It() {
|
|
|
357
357
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
358
358
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function B(a) {
|
|
361
361
|
return Pt(a) || Lt(a) || Xe(a) || It();
|
|
362
362
|
}
|
|
363
363
|
var Y = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4 }, Nt = function(a) {
|
|
364
|
-
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3, t, r, i, n,
|
|
364
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3, t, r, i, n, s, u = [console, a], d = (t = console.trace).bind.apply(t, B(u)), l = (r = console.info).bind.apply(r, B(u)), m = (i = console.debug).bind.apply(i, B(u)), b = (n = console.warn).bind.apply(n, B(u)), c = (s = console.error).bind.apply(s, B(u)), o = e;
|
|
365
365
|
return { trace: function() {
|
|
366
|
-
for (var
|
|
367
|
-
if (!(
|
|
366
|
+
for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
|
|
367
|
+
if (!(o > Y.TRACE)) return d.apply(void 0, B(y));
|
|
368
368
|
}, debug: function() {
|
|
369
|
-
for (var
|
|
370
|
-
if (!(
|
|
369
|
+
for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
|
|
370
|
+
if (!(o > Y.DEBUG)) return m.apply(void 0, B(y));
|
|
371
371
|
}, info: function() {
|
|
372
|
-
for (var
|
|
373
|
-
if (!(
|
|
372
|
+
for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
|
|
373
|
+
if (!(o > Y.INFO)) return l.apply(void 0, B(y));
|
|
374
374
|
}, warn: function() {
|
|
375
|
-
for (var
|
|
376
|
-
if (!(
|
|
375
|
+
for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
|
|
376
|
+
if (!(o > Y.WARN)) return b.apply(void 0, B(y));
|
|
377
377
|
}, error: function() {
|
|
378
|
-
for (var
|
|
379
|
-
if (!(
|
|
378
|
+
for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
|
|
379
|
+
if (!(o > Y.ERROR)) return c.apply(void 0, B(y));
|
|
380
380
|
}, get level() {
|
|
381
|
-
return
|
|
382
|
-
}, set level(
|
|
383
|
-
|
|
381
|
+
return o;
|
|
382
|
+
}, set level(p) {
|
|
383
|
+
p !== this.level && (o = p ?? e);
|
|
384
384
|
} };
|
|
385
|
-
}, q = Nt("[mux]"), we =
|
|
385
|
+
}, q = Nt("[mux]"), we = j(G());
|
|
386
386
|
function qe() {
|
|
387
387
|
var a = we.default.doNotTrack || we.default.navigator && we.default.navigator.doNotTrack;
|
|
388
388
|
return a === "1";
|
|
@@ -392,7 +392,7 @@ function T(a) {
|
|
|
392
392
|
return a;
|
|
393
393
|
}
|
|
394
394
|
$();
|
|
395
|
-
function
|
|
395
|
+
function P(a, e) {
|
|
396
396
|
if (!Z(a, e)) throw new TypeError("Cannot call a class as a function");
|
|
397
397
|
}
|
|
398
398
|
function Ct(a, e) {
|
|
@@ -401,10 +401,10 @@ function Ct(a, e) {
|
|
|
401
401
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(a, r.key, r);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function U(a, e, t) {
|
|
405
405
|
return e && Ct(a.prototype, e), a;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function v(a, e, t) {
|
|
408
408
|
return e in a ? Object.defineProperty(a, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[e] = t, a;
|
|
409
409
|
}
|
|
410
410
|
function te(a) {
|
|
@@ -416,33 +416,33 @@ function jt(a, e) {
|
|
|
416
416
|
for (; !Object.prototype.hasOwnProperty.call(a, e) && (a = te(a), a !== null); ) ;
|
|
417
417
|
return a;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
return typeof Reflect < "u" && Reflect.get ?
|
|
421
|
-
var
|
|
422
|
-
if (
|
|
423
|
-
var u = Object.getOwnPropertyDescriptor(
|
|
419
|
+
function pe(a, e, t) {
|
|
420
|
+
return typeof Reflect < "u" && Reflect.get ? pe = Reflect.get : pe = function(r, i, n) {
|
|
421
|
+
var s = jt(r, i);
|
|
422
|
+
if (s) {
|
|
423
|
+
var u = Object.getOwnPropertyDescriptor(s, i);
|
|
424
424
|
return u.get ? u.get.call(n || r) : u.value;
|
|
425
425
|
}
|
|
426
|
-
},
|
|
426
|
+
}, pe(a, e, t || a);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
return
|
|
428
|
+
function Ae(a, e) {
|
|
429
|
+
return Ae = Object.setPrototypeOf || function(t, r) {
|
|
430
430
|
return t.__proto__ = r, t;
|
|
431
|
-
},
|
|
431
|
+
}, Ae(a, e);
|
|
432
432
|
}
|
|
433
433
|
function Ht(a, e) {
|
|
434
434
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
435
|
-
a.prototype = Object.create(e && e.prototype, { constructor: { value: a, writable: !0, configurable: !0 } }), e &&
|
|
435
|
+
a.prototype = Object.create(e && e.prototype, { constructor: { value: a, writable: !0, configurable: !0 } }), e && Ae(a, e);
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function Bt(a, e) {
|
|
438
438
|
if (a == null) return {};
|
|
439
439
|
var t = {}, r = Object.keys(a), i, n;
|
|
440
440
|
for (n = 0; n < r.length; n++) i = r[n], !(e.indexOf(i) >= 0) && (t[i] = a[i]);
|
|
441
441
|
return t;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Mt(a, e) {
|
|
444
444
|
if (a == null) return {};
|
|
445
|
-
var t =
|
|
445
|
+
var t = Bt(a, e), r, i;
|
|
446
446
|
if (Object.getOwnPropertySymbols) {
|
|
447
447
|
var n = Object.getOwnPropertySymbols(a);
|
|
448
448
|
for (i = 0; i < n.length; i++) r = n[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(a, r) && (t[r] = a[r]);
|
|
@@ -461,9 +461,9 @@ function Ut() {
|
|
|
461
461
|
}
|
|
462
462
|
Qe();
|
|
463
463
|
function Ft(a, e) {
|
|
464
|
-
return e && (
|
|
464
|
+
return e && (Ge(e) === "object" || typeof e == "function") ? e : T(a);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Gt(a) {
|
|
467
467
|
var e = Ut();
|
|
468
468
|
return function() {
|
|
469
469
|
var t = te(a), r;
|
|
@@ -474,13 +474,13 @@ function Wt(a) {
|
|
|
474
474
|
return Ft(this, r);
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
|
-
var
|
|
477
|
+
var M = function(a) {
|
|
478
478
|
return le(a)[0];
|
|
479
479
|
}, le = function(a) {
|
|
480
480
|
if (typeof a != "string" || a === "") return ["localhost"];
|
|
481
481
|
var e = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, t = a.match(e) || [], r = t[4], i;
|
|
482
482
|
return r && (i = (r.match(/[^\.]+\.[^\.]+$/) || [])[0]), [r, i];
|
|
483
|
-
}, Te =
|
|
483
|
+
}, Te = j(G()), Qt = { exists: function() {
|
|
484
484
|
var a = Te.default.performance, e = a && a.timing;
|
|
485
485
|
return e !== void 0;
|
|
486
486
|
}, domContentLoadedEventEnd: function() {
|
|
@@ -489,8 +489,8 @@ var B = function(a) {
|
|
|
489
489
|
}, navigationStart: function() {
|
|
490
490
|
var a = Te.default.performance, e = a && a.timing;
|
|
491
491
|
return e && e.navigationStart;
|
|
492
|
-
} },
|
|
493
|
-
function
|
|
492
|
+
} }, he = Qt;
|
|
493
|
+
function L(a, e, t) {
|
|
494
494
|
t = t === void 0 ? 1 : t, a[e] = a[e] || 0, a[e] += t;
|
|
495
495
|
}
|
|
496
496
|
function fe(a) {
|
|
@@ -499,12 +499,12 @@ function fe(a) {
|
|
|
499
499
|
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(i) {
|
|
500
500
|
return Object.getOwnPropertyDescriptor(t, i).enumerable;
|
|
501
501
|
}))), r.forEach(function(i) {
|
|
502
|
-
|
|
502
|
+
v(a, i, t[i]);
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
505
|
return a;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Wt(a, e) {
|
|
508
508
|
var t = Object.keys(a);
|
|
509
509
|
if (Object.getOwnPropertySymbols) {
|
|
510
510
|
var r = Object.getOwnPropertySymbols(a);
|
|
@@ -513,12 +513,12 @@ function Gt(a, e) {
|
|
|
513
513
|
return t;
|
|
514
514
|
}
|
|
515
515
|
function Oe(a, e) {
|
|
516
|
-
return e = e ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) :
|
|
516
|
+
return e = e ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) : Wt(Object(e)).forEach(function(t) {
|
|
517
517
|
Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(e, t));
|
|
518
518
|
}), a;
|
|
519
519
|
}
|
|
520
520
|
var Vt = ["x-cdn", "content-type"], $e = ["x-request-id", "cf-ray", "x-amz-cf-id", "x-akamai-request-id"], Jt = Vt.concat($e);
|
|
521
|
-
function
|
|
521
|
+
function Pe(a) {
|
|
522
522
|
a = a || "";
|
|
523
523
|
var e = {}, t = a.trim().split(/[\r\n]+/);
|
|
524
524
|
return t.forEach(function(r) {
|
|
@@ -548,58 +548,58 @@ var zt = function(a) {
|
|
|
548
548
|
return e;
|
|
549
549
|
}, et = zt, ce = function(a) {
|
|
550
550
|
if (!a) return {};
|
|
551
|
-
var e =
|
|
551
|
+
var e = he.navigationStart(), t = a.loading, r = t ? t.start : a.trequest, i = t ? t.first : a.tfirst, n = t ? t.end : a.tload;
|
|
552
552
|
return { bytesLoaded: a.total, requestStart: Math.round(e + r), responseStart: Math.round(e + i), responseEnd: Math.round(e + n) };
|
|
553
553
|
}, ne = function(a) {
|
|
554
|
-
if (!(!a || typeof a.getAllResponseHeaders != "function")) return
|
|
554
|
+
if (!(!a || typeof a.getAllResponseHeaders != "function")) return Pe(a.getAllResponseHeaders());
|
|
555
555
|
}, Kt = function(a, e, t) {
|
|
556
|
-
var r = arguments.length > 4 ? arguments[4] : void 0, i = a.log, n = a.utils.secondsToMs,
|
|
557
|
-
var g = parseInt(r.version),
|
|
558
|
-
return g === 1 && f.programDateTime !== null && (
|
|
556
|
+
var r = arguments.length > 4 ? arguments[4] : void 0, i = a.log, n = a.utils.secondsToMs, s = function(f) {
|
|
557
|
+
var g = parseInt(r.version), _;
|
|
558
|
+
return g === 1 && f.programDateTime !== null && (_ = f.programDateTime), g === 0 && f.pdt !== null && (_ = f.pdt), _;
|
|
559
559
|
};
|
|
560
|
-
if (!
|
|
560
|
+
if (!he.exists()) {
|
|
561
561
|
i.warn("performance timing not supported. Not tracking HLS.js.");
|
|
562
562
|
return;
|
|
563
563
|
}
|
|
564
564
|
var u = function(f, g) {
|
|
565
565
|
return a.emit(e, f, g);
|
|
566
566
|
}, d = function(f, g) {
|
|
567
|
-
var
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}), h.forEach(function(
|
|
571
|
-
|
|
567
|
+
var _ = g.levels, h = g.audioTracks, w = g.url, k = g.stats, E = g.networkDetails, R = g.sessionData, A = {}, S = {};
|
|
568
|
+
_.forEach(function(C, z) {
|
|
569
|
+
A[z] = { width: C.width, height: C.height, bitrate: C.bitrate, attrs: C.attrs };
|
|
570
|
+
}), h.forEach(function(C, z) {
|
|
571
|
+
S[z] = { name: C.name, language: C.lang, bitrate: C.bitrate };
|
|
572
572
|
});
|
|
573
|
-
var
|
|
574
|
-
u("requestcompleted", Oe(fe({}, et(
|
|
573
|
+
var D = ce(k), x = D.bytesLoaded, V = D.requestStart, ae = D.responseStart, ie = D.responseEnd;
|
|
574
|
+
u("requestcompleted", Oe(fe({}, et(R)), { request_event_type: f, request_bytes_loaded: x, request_start: V, request_response_start: ae, request_response_end: ie, request_type: "manifest", request_hostname: M(w), request_response_headers: ne(E), request_rendition_lists: { media: A, audio: S, video: {} } }));
|
|
575
575
|
};
|
|
576
576
|
t.on(r.Events.MANIFEST_LOADED, d);
|
|
577
|
-
var
|
|
578
|
-
var
|
|
579
|
-
u("requestcompleted", { request_event_type: f, request_bytes_loaded:
|
|
577
|
+
var l = function(f, g) {
|
|
578
|
+
var _ = g.details, h = g.level, w = g.networkDetails, k = g.stats, E = ce(k), R = E.bytesLoaded, A = E.requestStart, S = E.responseStart, D = E.responseEnd, x = _.fragments[_.fragments.length - 1], V = s(x) + n(x.duration);
|
|
579
|
+
u("requestcompleted", { request_event_type: f, request_bytes_loaded: R, request_start: A, request_response_start: S, request_response_end: D, request_current_level: h, request_type: "manifest", request_hostname: M(_.url), request_response_headers: ne(w), video_holdback: _.holdBack && n(_.holdBack), video_part_holdback: _.partHoldBack && n(_.partHoldBack), video_part_target_duration: _.partTarget && n(_.partTarget), video_target_duration: _.targetduration && n(_.targetduration), video_source_is_live: _.live, player_manifest_newest_program_time: isNaN(V) ? void 0 : V });
|
|
580
580
|
};
|
|
581
|
-
t.on(r.Events.LEVEL_LOADED,
|
|
582
|
-
var
|
|
583
|
-
var
|
|
584
|
-
u("requestcompleted", { request_event_type: f, request_bytes_loaded: E, request_start:
|
|
581
|
+
t.on(r.Events.LEVEL_LOADED, l);
|
|
582
|
+
var m = function(f, g) {
|
|
583
|
+
var _ = g.details, h = g.networkDetails, w = g.stats, k = ce(w), E = k.bytesLoaded, R = k.requestStart, A = k.responseStart, S = k.responseEnd;
|
|
584
|
+
u("requestcompleted", { request_event_type: f, request_bytes_loaded: E, request_start: R, request_response_start: A, request_response_end: S, request_type: "manifest", request_hostname: M(_.url), request_response_headers: ne(h) });
|
|
585
585
|
};
|
|
586
|
-
t.on(r.Events.AUDIO_TRACK_LOADED,
|
|
586
|
+
t.on(r.Events.AUDIO_TRACK_LOADED, m);
|
|
587
587
|
var b = function(f, g) {
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
var k = ce(
|
|
588
|
+
var _ = g.stats, h = g.networkDetails, w = g.frag;
|
|
589
|
+
_ = _ || w.stats;
|
|
590
|
+
var k = ce(_), E = k.bytesLoaded, R = k.requestStart, A = k.responseStart, S = k.responseEnd, D = h ? ne(h) : void 0, x = { request_event_type: f, request_bytes_loaded: E, request_start: R, request_response_start: A, request_response_end: S, request_hostname: h ? M(h.responseURL) : void 0, request_id: D ? ve(D) : void 0, request_response_headers: D, request_media_duration: w.duration, request_url: h?.responseURL };
|
|
591
591
|
w.type === "main" ? (x.request_type = "media", x.request_current_level = w.level, x.request_video_width = (t.levels[w.level] || {}).width, x.request_video_height = (t.levels[w.level] || {}).height, x.request_labeled_bitrate = (t.levels[w.level] || {}).bitrate) : x.request_type = w.type, u("requestcompleted", x);
|
|
592
592
|
};
|
|
593
593
|
t.on(r.Events.FRAG_LOADED, b);
|
|
594
|
-
var
|
|
595
|
-
var
|
|
594
|
+
var c = function(f, g) {
|
|
595
|
+
var _ = g.frag, h = _.start, w = s(_), k = { currentFragmentPDT: w, currentFragmentStart: n(h) };
|
|
596
596
|
u("fragmentchange", k);
|
|
597
597
|
};
|
|
598
|
-
t.on(r.Events.FRAG_CHANGED,
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
if ((h === r.ErrorDetails.MANIFEST_LOAD_ERROR || h === r.ErrorDetails.MANIFEST_LOAD_TIMEOUT || h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT || h === r.ErrorDetails.LEVEL_LOAD_ERROR || h === r.ErrorDetails.LEVEL_LOAD_TIMEOUT || h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT || h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT || h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT) && u("requestfailed", { request_error: h, request_url:
|
|
602
|
-
var
|
|
598
|
+
t.on(r.Events.FRAG_CHANGED, c);
|
|
599
|
+
var o = function(f, g) {
|
|
600
|
+
var _ = g.type, h = g.details, w = g.response, k = g.fatal, E = g.frag, R = g.networkDetails, A = E?.url || g.url || "", S = R ? ne(R) : void 0;
|
|
601
|
+
if ((h === r.ErrorDetails.MANIFEST_LOAD_ERROR || h === r.ErrorDetails.MANIFEST_LOAD_TIMEOUT || h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT || h === r.ErrorDetails.LEVEL_LOAD_ERROR || h === r.ErrorDetails.LEVEL_LOAD_TIMEOUT || h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT || h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT || h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT) && u("requestfailed", { request_error: h, request_url: A, request_hostname: M(A), request_id: S ? ve(S) : void 0, request_type: h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT ? "media" : h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT ? "audio" : h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT ? "subtitle" : h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT ? "encryption" : "manifest", request_error_code: w?.code, request_error_text: w?.text }), k) {
|
|
602
|
+
var D, x = "".concat(A ? "url: ".concat(A, `
|
|
603
603
|
`) : "") + "".concat(w && (w.code || w.text) ? "response: ".concat(w.code, ", ").concat(w.text, `
|
|
604
604
|
`) : "") + "".concat(g.reason ? "failure reason: ".concat(g.reason, `
|
|
605
605
|
`) : "") + "".concat(g.level ? "level: ".concat(g.level, `
|
|
@@ -607,38 +607,42 @@ var zt = function(a) {
|
|
|
607
607
|
`) : "") + "".concat(g.buffer ? "buffer length: ".concat(g.buffer, `
|
|
608
608
|
`) : "") + "".concat(g.error ? "error: ".concat(g.error, `
|
|
609
609
|
`) : "") + "".concat(g.event ? "event: ".concat(g.event, `
|
|
610
|
-
`) : "") + "".concat(g.err ? "error message: ".concat((
|
|
610
|
+
`) : "") + "".concat(g.err ? "error message: ".concat((D = g.err) === null || D === void 0 ? void 0 : D.message, `
|
|
611
611
|
`) : "");
|
|
612
|
-
u("error", { player_error_code:
|
|
612
|
+
u("error", { player_error_code: _, player_error_message: h, player_error_context: x });
|
|
613
613
|
}
|
|
614
614
|
};
|
|
615
|
-
t.on(r.Events.ERROR,
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
u("requestcanceled", { request_event_type: f, request_url: h, request_type: "media", request_hostname:
|
|
615
|
+
t.on(r.Events.ERROR, o);
|
|
616
|
+
var p = function(f, g) {
|
|
617
|
+
var _ = g.frag, h = _ && _._url || "";
|
|
618
|
+
u("requestcanceled", { request_event_type: f, request_url: h, request_type: "media", request_hostname: M(h) });
|
|
619
619
|
};
|
|
620
|
-
t.on(r.Events.FRAG_LOAD_EMERGENCY_ABORTED,
|
|
620
|
+
t.on(r.Events.FRAG_LOAD_EMERGENCY_ABORTED, p);
|
|
621
621
|
var y = function(f, g) {
|
|
622
|
-
var
|
|
622
|
+
var _ = g.level, h = t.levels[_];
|
|
623
623
|
if (h && h.attrs && h.attrs.BANDWIDTH) {
|
|
624
624
|
var w = h.attrs.BANDWIDTH, k, E = parseFloat(h.attrs["FRAME-RATE"]);
|
|
625
625
|
isNaN(E) || (k = E), w ? u("renditionchange", { video_source_fps: k, video_source_bitrate: w, video_source_width: h.width, video_source_height: h.height, video_source_rendition_name: h.name, video_source_codec: h?.videoCodec }) : i.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js");
|
|
626
626
|
}
|
|
627
627
|
};
|
|
628
628
|
t.on(r.Events.LEVEL_SWITCHED, y), t._stopMuxMonitor = function() {
|
|
629
|
-
t.off(r.Events.MANIFEST_LOADED, d), t.off(r.Events.LEVEL_LOADED,
|
|
629
|
+
t.off(r.Events.MANIFEST_LOADED, d), t.off(r.Events.LEVEL_LOADED, l), t.off(r.Events.AUDIO_TRACK_LOADED, m), t.off(r.Events.FRAG_LOADED, b), t.off(r.Events.FRAG_CHANGED, c), t.off(r.Events.ERROR, o), t.off(r.Events.FRAG_LOAD_EMERGENCY_ABORTED, p), t.off(r.Events.LEVEL_SWITCHED, y), t.off(r.Events.DESTROYING, t._stopMuxMonitor), delete t._stopMuxMonitor;
|
|
630
630
|
}, t.on(r.Events.DESTROYING, t._stopMuxMonitor);
|
|
631
631
|
}, Yt = function(a) {
|
|
632
632
|
a && typeof a._stopMuxMonitor == "function" && a._stopMuxMonitor();
|
|
633
|
-
},
|
|
633
|
+
}, Ne = function(a, e) {
|
|
634
634
|
if (!a || !a.requestEndDate) return {};
|
|
635
|
-
var t =
|
|
636
|
-
|
|
637
|
-
var b =
|
|
638
|
-
return { requestStart: n, requestResponseStart:
|
|
635
|
+
var t = M(a.url), r = a.url, i = a.bytesLoaded, n = new Date(a.requestStartDate).getTime(), s = new Date(a.firstByteDate).getTime(), u = new Date(a.requestEndDate).getTime(), d = isNaN(a.duration) ? 0 : a.duration, l = typeof e.getMetricsFor == "function" ? e.getMetricsFor(a.mediaType).HttpList : e.getDashMetrics().getHttpRequests(a.mediaType), m;
|
|
636
|
+
l.length > 0 && (m = Pe(l[l.length - 1]._responseHeaders || ""));
|
|
637
|
+
var b = m ? ve(m) : void 0;
|
|
638
|
+
return { requestStart: n, requestResponseStart: s, requestResponseEnd: u, requestBytesLoaded: i, requestResponseHeaders: m, requestMediaDuration: d, requestHostname: t, requestUrl: r, requestId: b };
|
|
639
639
|
}, Xt = function(a, e) {
|
|
640
|
-
|
|
641
|
-
|
|
640
|
+
if (typeof e.getCurrentRepresentationForType == "function") {
|
|
641
|
+
var t = e.getCurrentRepresentationForType(a);
|
|
642
|
+
return t ? { currentLevel: t.absoluteIndex, renditionWidth: t.width || null, renditionHeight: t.height || null, renditionBitrate: t.bandwidth } : {};
|
|
643
|
+
}
|
|
644
|
+
var r = e.getQualityFor(a), i = e.getCurrentTrackFor(a).bitrateList;
|
|
645
|
+
return i ? { currentLevel: r, renditionWidth: i[r].width || null, renditionHeight: i[r].height || null, renditionBitrate: i[r].bandwidth } : {};
|
|
642
646
|
}, Zt = function(a) {
|
|
643
647
|
var e;
|
|
644
648
|
return (e = a.match(/.*codecs\*?="(.*)"/)) === null || e === void 0 ? void 0 : e[1];
|
|
@@ -657,93 +661,106 @@ var zt = function(a) {
|
|
|
657
661
|
r.warn("Invalid dash.js player reference. Monitoring blocked.");
|
|
658
662
|
return;
|
|
659
663
|
}
|
|
660
|
-
var i = $t(t), n = function(
|
|
661
|
-
return a.emit(e,
|
|
662
|
-
},
|
|
663
|
-
var h =
|
|
664
|
-
n("requestcompleted", { request_event_type: h, request_start: 0, request_response_start: 0, request_response_end: 0, request_bytes_loaded: -1, request_type: "manifest", request_hostname:
|
|
664
|
+
var i = $t(t), n = function(_, h) {
|
|
665
|
+
return a.emit(e, _, h);
|
|
666
|
+
}, s = function(_) {
|
|
667
|
+
var h = _.type, w = _.data, k = (w || {}).url;
|
|
668
|
+
n("requestcompleted", { request_event_type: h, request_start: 0, request_response_start: 0, request_response_end: 0, request_bytes_loaded: -1, request_type: "manifest", request_hostname: M(k), request_url: k });
|
|
665
669
|
};
|
|
666
|
-
t.on("manifestLoaded",
|
|
667
|
-
var u = {}, d = function(
|
|
668
|
-
if (typeof
|
|
669
|
-
var h =
|
|
670
|
+
t.on("manifestLoaded", s);
|
|
671
|
+
var u = {}, d = function(_) {
|
|
672
|
+
if (typeof _.getRequests != "function") return null;
|
|
673
|
+
var h = _.getRequests({ state: "executed" });
|
|
670
674
|
return h.length === 0 ? null : h[h.length - 1];
|
|
671
|
-
},
|
|
672
|
-
var h =
|
|
673
|
-
|
|
674
|
-
},
|
|
675
|
-
var h =
|
|
676
|
-
|
|
677
|
-
var
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}),
|
|
681
|
-
var x =
|
|
682
|
-
n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end:
|
|
675
|
+
}, l = function(_) {
|
|
676
|
+
var h = _.type, w = _.fragmentModel, k = _.chunk, E = d(w);
|
|
677
|
+
m({ type: h, request: E, chunk: k });
|
|
678
|
+
}, m = function(_) {
|
|
679
|
+
var h = _.type, w = _.chunk, k = _.request, E = (w || {}).mediaInfo, R = E || {}, A = R.type, S = R.bitrateList;
|
|
680
|
+
S = S || [];
|
|
681
|
+
var D = {};
|
|
682
|
+
S.forEach(function(re, F) {
|
|
683
|
+
D[F] = {}, D[F].width = re.width, D[F].height = re.height, D[F].bitrate = re.bandwidth, D[F].attrs = {};
|
|
684
|
+
}), A === "video" ? u.video = D : A === "audio" ? u.audio = D : u.media = D;
|
|
685
|
+
var x = Ne(k, t), V = x.requestStart, ae = x.requestResponseStart, ie = x.requestResponseEnd, C = x.requestResponseHeaders, z = x.requestMediaDuration, ye = x.requestHostname, ge = x.requestUrl, be = x.requestId;
|
|
686
|
+
n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end: ie, request_bytes_loaded: -1, request_type: A + "_init", request_response_headers: C, request_hostname: ye, request_id: be, request_url: ge, request_media_duration: z, request_rendition_lists: u });
|
|
683
687
|
};
|
|
684
|
-
i >= 4 ? t.on("initFragmentLoaded",
|
|
685
|
-
var b = function(
|
|
686
|
-
var h =
|
|
687
|
-
|
|
688
|
-
},
|
|
689
|
-
var h =
|
|
690
|
-
n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end:
|
|
688
|
+
i >= 4 ? t.on("initFragmentLoaded", m) : t.on("initFragmentLoaded", l);
|
|
689
|
+
var b = function(_) {
|
|
690
|
+
var h = _.type, w = _.fragmentModel, k = _.chunk, E = d(w);
|
|
691
|
+
c({ type: h, request: E, chunk: k });
|
|
692
|
+
}, c = function(_) {
|
|
693
|
+
var h = _.type, w = _.chunk, k = _.request, E = w || {}, R = E.mediaInfo, A = E.start, S = R || {}, D = S.type, x = Ne(k, t), V = x.requestStart, ae = x.requestResponseStart, ie = x.requestResponseEnd, C = x.requestBytesLoaded, z = x.requestResponseHeaders, ye = x.requestMediaDuration, ge = x.requestHostname, be = x.requestUrl, re = x.requestId, F = Xt(D, t), lt = F.currentLevel, ct = F.renditionWidth, pt = F.renditionHeight, _t = F.renditionBitrate;
|
|
694
|
+
n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end: ie, request_bytes_loaded: C, request_type: D, request_response_headers: z, request_hostname: ge, request_id: re, request_url: be, request_media_start_time: A, request_media_duration: ye, request_current_level: lt, request_labeled_bitrate: _t, request_video_width: ct, request_video_height: pt });
|
|
691
695
|
};
|
|
692
|
-
i >= 4 ? t.on("mediaFragmentLoaded",
|
|
693
|
-
var
|
|
694
|
-
if (
|
|
695
|
-
if (!(
|
|
696
|
+
i >= 4 ? t.on("mediaFragmentLoaded", c) : t.on("mediaFragmentLoaded", b);
|
|
697
|
+
var o = { video: void 0, audio: void 0, totalBitrate: void 0 }, p = function() {
|
|
698
|
+
if (o.video && typeof o.video.bitrate == "number") {
|
|
699
|
+
if (!(o.video.width && o.video.height)) {
|
|
696
700
|
r.warn("have bitrate info for video but missing width/height");
|
|
697
701
|
return;
|
|
698
702
|
}
|
|
699
|
-
var
|
|
700
|
-
if (
|
|
703
|
+
var _ = o.video.bitrate;
|
|
704
|
+
if (o.audio && typeof o.audio.bitrate == "number" && (_ += o.audio.bitrate), _ !== o.totalBitrate) return o.totalBitrate = _, { video_source_bitrate: _, video_source_height: o.video.height, video_source_width: o.video.width, video_source_codec: Zt(o.video.codec) };
|
|
701
705
|
}
|
|
702
|
-
}, y = function(
|
|
703
|
-
|
|
704
|
-
r.warn("missing evt.newQuality in qualityChangeRendered event", p);
|
|
705
|
-
return;
|
|
706
|
-
}
|
|
707
|
-
var k = p.mediaType;
|
|
706
|
+
}, y = function(_, h, w) {
|
|
707
|
+
var k = _.mediaType;
|
|
708
708
|
if (k === "audio" || k === "video") {
|
|
709
|
-
var E
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
709
|
+
var E;
|
|
710
|
+
if (typeof t.getRepresentationsByType == "function") if (_.newRepresentation) E = { bitrate: _.newRepresentation.bandwidth, width: _.newRepresentation.width, height: _.newRepresentation.height, qualityIndex: _.newRepresentation.absoluteIndex };
|
|
711
|
+
else {
|
|
712
|
+
var R = t.getRepresentationsByType(k);
|
|
713
|
+
if (R && typeof _.newQuality == "number") {
|
|
714
|
+
var A = R.find(function(D) {
|
|
715
|
+
return D.absoluteIndex === _.newQuality || D.index === _.newQuality;
|
|
716
|
+
});
|
|
717
|
+
A && (E = { bitrate: A.bandwidth, width: A.width, height: A.height, qualityIndex: _.newQuality });
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
if (typeof _.newQuality != "number") {
|
|
722
|
+
r.warn("missing evt.newQuality in qualityChangeRendered event", _);
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
E = t.getBitrateInfoListFor(k).find(function(D) {
|
|
726
|
+
var x = D.qualityIndex;
|
|
727
|
+
return x === _.newQuality;
|
|
728
|
+
});
|
|
729
|
+
}
|
|
713
730
|
if (!(E && typeof E.bitrate == "number")) {
|
|
714
731
|
r.warn("missing bitrate info for ".concat(k));
|
|
715
732
|
return;
|
|
716
733
|
}
|
|
717
|
-
|
|
718
|
-
var
|
|
719
|
-
|
|
734
|
+
o[k] = Oe(fe({}, E), { codec: t.getCurrentTrackFor(k).codec });
|
|
735
|
+
var S = p();
|
|
736
|
+
S && n("renditionchange", S);
|
|
720
737
|
}
|
|
721
738
|
};
|
|
722
739
|
t.on("qualityChangeRendered", y);
|
|
723
|
-
var f = function(
|
|
724
|
-
var h =
|
|
725
|
-
h = h || {}, n("requestcanceled", { request_event_type: h.type + "_" + h.action, request_url: h.url, request_type: w, request_hostname:
|
|
740
|
+
var f = function(_) {
|
|
741
|
+
var h = _.request, w = _.mediaType;
|
|
742
|
+
h = h || {}, n("requestcanceled", { request_event_type: h.type + "_" + h.action, request_url: h.url, request_type: w, request_hostname: M(h.url) });
|
|
726
743
|
};
|
|
727
744
|
t.on("fragmentLoadingAbandoned", f);
|
|
728
|
-
var g = function(
|
|
729
|
-
var h =
|
|
730
|
-
h?.code === 27 && n("requestfailed", { request_error: E.type + "_" + E.action, request_url: E.url, request_hostname:
|
|
731
|
-
var
|
|
732
|
-
`) : "") + "".concat(
|
|
745
|
+
var g = function(_) {
|
|
746
|
+
var h = _.error, w, k, E = (h == null || (w = h.data) === null || w === void 0 ? void 0 : w.request) || {}, R = (h == null || (k = h.data) === null || k === void 0 ? void 0 : k.response) || {};
|
|
747
|
+
h?.code === 27 && n("requestfailed", { request_error: E.type + "_" + E.action, request_url: E.url, request_hostname: M(E.url), request_type: E.mediaType, request_error_code: R.status, request_error_text: R.statusText });
|
|
748
|
+
var A = "".concat(E != null && E.url ? "url: ".concat(E.url, `
|
|
749
|
+
`) : "") + "".concat(R != null && R.status || R != null && R.statusText ? "response: ".concat(R?.status, ", ").concat(R?.statusText, `
|
|
733
750
|
`) : "");
|
|
734
|
-
n("error", { player_error_code: h?.code, player_error_message: h?.message, player_error_context:
|
|
751
|
+
n("error", { player_error_code: h?.code, player_error_message: h?.message, player_error_context: A });
|
|
735
752
|
};
|
|
736
753
|
t.on("error", g), t._stopMuxMonitor = function() {
|
|
737
|
-
t.off("manifestLoaded",
|
|
754
|
+
t.off("manifestLoaded", s), t.off("initFragmentLoaded", m), t.off("mediaFragmentLoaded", c), t.off("qualityChangeRendered", y), t.off("error", g), t.off("fragmentLoadingAbandoned", f), delete t._stopMuxMonitor;
|
|
738
755
|
};
|
|
739
756
|
}, ta = function(a) {
|
|
740
757
|
a && typeof a._stopMuxMonitor == "function" && a._stopMuxMonitor();
|
|
741
|
-
},
|
|
758
|
+
}, Ce = 0, aa = (function() {
|
|
742
759
|
function a() {
|
|
743
|
-
|
|
760
|
+
P(this, a), v(this, "_listeners", void 0);
|
|
744
761
|
}
|
|
745
|
-
return
|
|
746
|
-
return t._eventEmitterGuid = t._eventEmitterGuid || ++
|
|
762
|
+
return U(a, [{ key: "on", value: function(e, t, r) {
|
|
763
|
+
return t._eventEmitterGuid = t._eventEmitterGuid || ++Ce, this._listeners = this._listeners || {}, this._listeners[e] = this._listeners[e] || [], r && (t = t.bind(r)), this._listeners[e].push(t), t;
|
|
747
764
|
} }, { key: "off", value: function(e, t) {
|
|
748
765
|
var r = this._listeners && this._listeners[e];
|
|
749
766
|
r && r.forEach(function(i, n) {
|
|
@@ -751,7 +768,7 @@ var zt = function(a) {
|
|
|
751
768
|
});
|
|
752
769
|
} }, { key: "one", value: function(e, t, r) {
|
|
753
770
|
var i = this;
|
|
754
|
-
t._eventEmitterGuid = t._eventEmitterGuid || ++
|
|
771
|
+
t._eventEmitterGuid = t._eventEmitterGuid || ++Ce;
|
|
755
772
|
var n = function() {
|
|
756
773
|
i.off(e, n), t.apply(r || this, arguments);
|
|
757
774
|
};
|
|
@@ -760,18 +777,18 @@ var zt = function(a) {
|
|
|
760
777
|
var r = this;
|
|
761
778
|
if (this._listeners) {
|
|
762
779
|
t = t || {};
|
|
763
|
-
var i = this._listeners["before" + e] || [], n = this._listeners["before*"] || [],
|
|
764
|
-
|
|
765
|
-
b.call(r, { type: e },
|
|
780
|
+
var i = this._listeners["before" + e] || [], n = this._listeners["before*"] || [], s = this._listeners[e] || [], u = this._listeners["after" + e] || [], d = function(l, m) {
|
|
781
|
+
l = l.slice(), l.forEach(function(b) {
|
|
782
|
+
b.call(r, { type: e }, m);
|
|
766
783
|
});
|
|
767
784
|
};
|
|
768
|
-
d(i, t), d(n, t), d(
|
|
785
|
+
d(i, t), d(n, t), d(s, t), d(u, t);
|
|
769
786
|
}
|
|
770
787
|
} }]), a;
|
|
771
|
-
})(),
|
|
788
|
+
})(), ia = aa, ke = j(G()), ra = (function() {
|
|
772
789
|
function a(e) {
|
|
773
790
|
var t = this;
|
|
774
|
-
|
|
791
|
+
P(this, a), v(this, "_playbackHeartbeatInterval", void 0), v(this, "_playheadShouldBeProgressing", void 0), v(this, "pm", void 0), this.pm = e, this._playbackHeartbeatInterval = null, this._playheadShouldBeProgressing = !1, e.on("playing", function() {
|
|
775
792
|
t._playheadShouldBeProgressing = !0;
|
|
776
793
|
}), e.on("play", this._startPlaybackHeartbeatInterval.bind(this)), e.on("playing", this._startPlaybackHeartbeatInterval.bind(this)), e.on("adbreakstart", this._startPlaybackHeartbeatInterval.bind(this)), e.on("adplay", this._startPlaybackHeartbeatInterval.bind(this)), e.on("adplaying", this._startPlaybackHeartbeatInterval.bind(this)), e.on("devicewake", this._startPlaybackHeartbeatInterval.bind(this)), e.on("viewstart", this._startPlaybackHeartbeatInterval.bind(this)), e.on("rebufferstart", this._startPlaybackHeartbeatInterval.bind(this)), e.on("pause", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("ended", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("viewend", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("error", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("aderror", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("adpause", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("adended", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("adbreakend", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("seeked", function() {
|
|
777
794
|
e.data.player_is_paused ? t._stopPlaybackHeartbeatInterval() : t._startPlaybackHeartbeatInterval();
|
|
@@ -781,7 +798,7 @@ var zt = function(a) {
|
|
|
781
798
|
t._playbackHeartbeatInterval !== null && (ke.default.clearInterval(t._playbackHeartbeatInterval), e.emit("playbackheartbeatend", { viewer_time: i.viewer_time }), t._playbackHeartbeatInterval = null);
|
|
782
799
|
});
|
|
783
800
|
}
|
|
784
|
-
return
|
|
801
|
+
return U(a, [{ key: "_startPlaybackHeartbeatInterval", value: function() {
|
|
785
802
|
var e = this;
|
|
786
803
|
this._playbackHeartbeatInterval === null && (this.pm.emit("playbackheartbeat"), this._playbackHeartbeatInterval = ke.default.setInterval(function() {
|
|
787
804
|
e.pm.emit("playbackheartbeat");
|
|
@@ -789,39 +806,45 @@ var zt = function(a) {
|
|
|
789
806
|
} }, { key: "_stopPlaybackHeartbeatInterval", value: function() {
|
|
790
807
|
this._playheadShouldBeProgressing = !1, this._playbackHeartbeatInterval !== null && (ke.default.clearInterval(this._playbackHeartbeatInterval), this.pm.emit("playbackheartbeatend"), this._playbackHeartbeatInterval = null);
|
|
791
808
|
} }]), a;
|
|
792
|
-
})(), na =
|
|
809
|
+
})(), na = ra, sa = function a(e) {
|
|
793
810
|
var t = this;
|
|
794
|
-
|
|
811
|
+
P(this, a), v(this, "viewErrored", void 0), e.on("viewinit", function() {
|
|
795
812
|
t.viewErrored = !1;
|
|
796
813
|
}), e.on("error", function(r, i) {
|
|
797
814
|
try {
|
|
798
815
|
var n = e.errorTranslator({ player_error_code: i.player_error_code, player_error_message: i.player_error_message, player_error_context: i.player_error_context, player_error_severity: i.player_error_severity, player_error_business_exception: i.player_error_business_exception });
|
|
799
816
|
n && (e.data.player_error_code = n.player_error_code || i.player_error_code, e.data.player_error_message = n.player_error_message || i.player_error_message, e.data.player_error_context = n.player_error_context || i.player_error_context, e.data.player_error_severity = n.player_error_severity || i.player_error_severity, e.data.player_error_business_exception = n.player_error_business_exception || i.player_error_business_exception, t.viewErrored = !0);
|
|
800
|
-
} catch (
|
|
801
|
-
e.mux.log.warn("Exception in error translator callback.",
|
|
817
|
+
} catch (s) {
|
|
818
|
+
e.mux.log.warn("Exception in error translator callback.", s), t.viewErrored = !0;
|
|
802
819
|
}
|
|
803
820
|
}), e.on("aftererror", function() {
|
|
804
|
-
var r, i, n,
|
|
805
|
-
(r = e.data) === null || r === void 0 || delete r.player_error_code, (i = e.data) === null || i === void 0 || delete i.player_error_message, (n = e.data) === null || n === void 0 || delete n.player_error_context, (
|
|
821
|
+
var r, i, n, s, u;
|
|
822
|
+
(r = e.data) === null || r === void 0 || delete r.player_error_code, (i = e.data) === null || i === void 0 || delete i.player_error_message, (n = e.data) === null || n === void 0 || delete n.player_error_context, (s = e.data) === null || s === void 0 || delete s.player_error_severity, (u = e.data) === null || u === void 0 || delete u.player_error_business_exception;
|
|
806
823
|
});
|
|
807
|
-
},
|
|
824
|
+
}, oa = sa, ua = (function() {
|
|
808
825
|
function a(e) {
|
|
809
|
-
|
|
826
|
+
P(this, a), v(this, "_watchTimeTrackerLastCheckedTime", void 0), v(this, "pm", void 0), this.pm = e, this._watchTimeTrackerLastCheckedTime = null, e.on("playbackheartbeat", this._updateWatchTime.bind(this)), e.on("playbackheartbeatend", this._clearWatchTimeState.bind(this));
|
|
810
827
|
}
|
|
811
|
-
return
|
|
828
|
+
return U(a, [{ key: "_updateWatchTime", value: function(e, t) {
|
|
812
829
|
var r = t.viewer_time;
|
|
813
|
-
this._watchTimeTrackerLastCheckedTime === null && (this._watchTimeTrackerLastCheckedTime = r),
|
|
830
|
+
this._watchTimeTrackerLastCheckedTime === null && (this._watchTimeTrackerLastCheckedTime = r), L(this.pm.data, "view_watch_time", r - this._watchTimeTrackerLastCheckedTime), this._watchTimeTrackerLastCheckedTime = r;
|
|
814
831
|
} }, { key: "_clearWatchTimeState", value: function(e, t) {
|
|
815
832
|
this._updateWatchTime(e, t), this._watchTimeTrackerLastCheckedTime = null;
|
|
816
833
|
} }]), a;
|
|
817
834
|
})(), da = ua, la = (function() {
|
|
818
835
|
function a(e) {
|
|
819
836
|
var t = this;
|
|
820
|
-
|
|
837
|
+
P(this, a), v(this, "_playbackTimeTrackerLastPlayheadPosition", void 0), v(this, "_lastTime", void 0), v(this, "_isAdPlaying", void 0), v(this, "_callbackUpdatePlaybackTime", void 0), v(this, "pm", void 0), this.pm = e, this._playbackTimeTrackerLastPlayheadPosition = -1, this._lastTime = I.now(), this._isAdPlaying = !1, this._callbackUpdatePlaybackTime = null, e.on("viewinit", function() {
|
|
838
|
+
t.pm.data.view_playing_time_ms_cumulative = 0;
|
|
839
|
+
});
|
|
821
840
|
var r = this._startPlaybackTimeTracking.bind(this);
|
|
822
|
-
e.on("playing", r), e.on("adplaying", r)
|
|
823
|
-
var i =
|
|
824
|
-
|
|
841
|
+
e.on("playing", r), e.on("adplaying", r);
|
|
842
|
+
var i = function() {
|
|
843
|
+
t.pm.data.player_is_paused || r();
|
|
844
|
+
};
|
|
845
|
+
e.on("seeked", i), e.on("rebufferend", i);
|
|
846
|
+
var n = this._stopPlaybackTimeTracking.bind(this);
|
|
847
|
+
e.on("playbackheartbeatend", n), e.on("seeking", n), e.on("rebufferstart", n), e.on("adplaying", function() {
|
|
825
848
|
t._isAdPlaying = !0;
|
|
826
849
|
}), e.on("adended", function() {
|
|
827
850
|
t._isAdPlaying = !1;
|
|
@@ -834,26 +857,26 @@ var zt = function(a) {
|
|
|
834
857
|
}), e.on("adplay", function() {
|
|
835
858
|
t._isAdPlaying = !1;
|
|
836
859
|
}), e.on("viewinit", function() {
|
|
837
|
-
t._playbackTimeTrackerLastPlayheadPosition = -1, t._lastTime =
|
|
860
|
+
t._playbackTimeTrackerLastPlayheadPosition = -1, t._lastTime = I.now(), t._isAdPlaying = !1, t._callbackUpdatePlaybackTime = null;
|
|
838
861
|
});
|
|
839
862
|
}
|
|
840
|
-
return
|
|
841
|
-
this._callbackUpdatePlaybackTime === null && (this._callbackUpdatePlaybackTime = this._updatePlaybackTime.bind(this), this._playbackTimeTrackerLastPlayheadPosition = this.pm.data.player_playhead_time, this.pm.on("playbackheartbeat", this._callbackUpdatePlaybackTime));
|
|
863
|
+
return U(a, [{ key: "_startPlaybackTimeTracking", value: function() {
|
|
864
|
+
this._callbackUpdatePlaybackTime === null && (this._callbackUpdatePlaybackTime = this._updatePlaybackTime.bind(this), this._playbackTimeTrackerLastPlayheadPosition = this.pm.data.player_playhead_time, this._lastTime = I.now(), this.pm.on("playbackheartbeat", this._callbackUpdatePlaybackTime));
|
|
842
865
|
} }, { key: "_stopPlaybackTimeTracking", value: function() {
|
|
843
866
|
this._callbackUpdatePlaybackTime && (this._updatePlaybackTime(), this.pm.off("playbackheartbeat", this._callbackUpdatePlaybackTime), this._callbackUpdatePlaybackTime = null, this._playbackTimeTrackerLastPlayheadPosition = -1);
|
|
844
867
|
} }, { key: "_updatePlaybackTime", value: function() {
|
|
845
|
-
var e = this.pm.data.player_playhead_time, t =
|
|
846
|
-
this._playbackTimeTrackerLastPlayheadPosition >= 0 && e > this._playbackTimeTrackerLastPlayheadPosition ?
|
|
868
|
+
var e = this.pm.data.player_playhead_time || 0, t = I.now(), r = t - this._lastTime, i = -1;
|
|
869
|
+
this._playbackTimeTrackerLastPlayheadPosition >= 0 && e > this._playbackTimeTrackerLastPlayheadPosition ? i = e - this._playbackTimeTrackerLastPlayheadPosition : this._isAdPlaying && (i = r), i > 0 && i <= 1e3 && L(this.pm.data, "view_content_playback_time", i), this._callbackUpdatePlaybackTime !== null && r > 0 && r <= 1e3 && (this._isAdPlaying && L(this.pm.data, "ad_playing_time_ms_cumulative", r), L(this.pm.data, "view_playing_time_ms_cumulative", r)), this._playbackTimeTrackerLastPlayheadPosition = e, this._lastTime = t;
|
|
847
870
|
} }]), a;
|
|
848
|
-
})(), ca = la,
|
|
871
|
+
})(), ca = la, pa = (function() {
|
|
849
872
|
function a(e) {
|
|
850
|
-
|
|
873
|
+
P(this, a), v(this, "pm", void 0), this.pm = e;
|
|
851
874
|
var t = this._updatePlayheadTime.bind(this);
|
|
852
875
|
e.on("playbackheartbeat", t), e.on("playbackheartbeatend", t), e.on("timeupdate", t), e.on("destroy", function() {
|
|
853
876
|
e.off("timeupdate", t);
|
|
854
877
|
});
|
|
855
878
|
}
|
|
856
|
-
return
|
|
879
|
+
return U(a, [{ key: "_updateMaxPlayheadPosition", value: function() {
|
|
857
880
|
this.pm.data.view_max_playhead_position = typeof this.pm.data.view_max_playhead_position > "u" ? this.pm.data.player_playhead_time : Math.max(this.pm.data.view_max_playhead_position, this.pm.data.player_playhead_time);
|
|
858
881
|
} }, { key: "_updatePlayheadTime", value: function(e, t) {
|
|
859
882
|
var r = this, i = function() {
|
|
@@ -865,33 +888,33 @@ var zt = function(a) {
|
|
|
865
888
|
typeof n < "u" && (this.pm.data.player_playhead_time = n, i(), this._updateMaxPlayheadPosition());
|
|
866
889
|
}
|
|
867
890
|
} }]), a;
|
|
868
|
-
})(),
|
|
869
|
-
if (
|
|
870
|
-
var t, r = function(n,
|
|
871
|
-
i(
|
|
891
|
+
})(), _a = pa, je = 300 * 1e3, ha = function a(e) {
|
|
892
|
+
if (P(this, a), !e.disableRebufferTracking) {
|
|
893
|
+
var t, r = function(n, s) {
|
|
894
|
+
i(s), t = void 0;
|
|
872
895
|
}, i = function(n) {
|
|
873
896
|
if (t) {
|
|
874
|
-
var
|
|
875
|
-
|
|
897
|
+
var s = n.viewer_time - t;
|
|
898
|
+
L(e.data, "view_rebuffer_duration", s), t = n.viewer_time, e.data.view_rebuffer_duration > je && (e.emit("viewend"), e.send("viewend"), e.mux.log.warn("Ending view after rebuffering for longer than ".concat(je, "ms, future events will be ignored unless a programchange or videochange occurs.")));
|
|
876
899
|
}
|
|
877
900
|
e.data.view_watch_time >= 0 && e.data.view_rebuffer_count > 0 && (e.data.view_rebuffer_frequency = e.data.view_rebuffer_count / e.data.view_watch_time, e.data.view_rebuffer_percentage = e.data.view_rebuffer_duration / e.data.view_watch_time);
|
|
878
901
|
};
|
|
879
|
-
e.on("playbackheartbeat", function(n,
|
|
880
|
-
return i(
|
|
881
|
-
}), e.on("rebufferstart", function(n,
|
|
882
|
-
t || (
|
|
902
|
+
e.on("playbackheartbeat", function(n, s) {
|
|
903
|
+
return i(s);
|
|
904
|
+
}), e.on("rebufferstart", function(n, s) {
|
|
905
|
+
t || (L(e.data, "view_rebuffer_count", 1), t = s.viewer_time, e.one("rebufferend", r));
|
|
883
906
|
}), e.on("viewinit", function() {
|
|
884
907
|
t = void 0, e.off("rebufferend", r);
|
|
885
908
|
});
|
|
886
909
|
}
|
|
887
|
-
}, fa =
|
|
910
|
+
}, fa = ha, va = (function() {
|
|
888
911
|
function a(e) {
|
|
889
912
|
var t = this;
|
|
890
|
-
|
|
891
|
-
t._cleanupRebufferTracker(null, { viewer_time:
|
|
913
|
+
P(this, a), v(this, "_lastCheckedTime", void 0), v(this, "_lastPlayheadTime", void 0), v(this, "_lastPlayheadTimeUpdatedTime", void 0), v(this, "_rebuffering", void 0), v(this, "pm", void 0), this.pm = e, !(e.disableRebufferTracking || e.disablePlayheadRebufferTracking) && (this._lastCheckedTime = null, this._lastPlayheadTime = null, this._lastPlayheadTimeUpdatedTime = null, e.on("playbackheartbeat", this._checkIfRebuffering.bind(this)), e.on("playbackheartbeatend", this._cleanupRebufferTracker.bind(this)), e.on("seeking", function() {
|
|
914
|
+
t._cleanupRebufferTracker(null, { viewer_time: I.now() });
|
|
892
915
|
}));
|
|
893
916
|
}
|
|
894
|
-
return
|
|
917
|
+
return U(a, [{ key: "_checkIfRebuffering", value: function(e, t) {
|
|
895
918
|
if (this.pm.seekingTracker.isSeeking || this.pm.adTracker.isAdBreak || !this.pm.playbackHeartbeat._playheadShouldBeProgressing) {
|
|
896
919
|
this._cleanupRebufferTracker(e, t);
|
|
897
920
|
return;
|
|
@@ -923,12 +946,12 @@ var zt = function(a) {
|
|
|
923
946
|
})(), ma = va, ya = (function() {
|
|
924
947
|
function a(e) {
|
|
925
948
|
var t = this;
|
|
926
|
-
|
|
949
|
+
P(this, a), v(this, "pm", void 0), this.pm = e, e.on("viewinit", function() {
|
|
927
950
|
var r = e.data, i = r.view_id;
|
|
928
951
|
if (!r.view_program_changed) {
|
|
929
|
-
var n = function(
|
|
952
|
+
var n = function(s, u) {
|
|
930
953
|
var d = u.viewer_time;
|
|
931
|
-
(
|
|
954
|
+
(s.type === "playing" && typeof e.data.view_time_to_first_frame > "u" || s.type === "adplaying" && (typeof e.data.view_time_to_first_frame > "u" || t._inPrerollPosition())) && t.calculateTimeToFirstFrame(d || I.now(), i);
|
|
932
955
|
};
|
|
933
956
|
e.one("playing", n), e.one("adplaying", n), e.one("viewend", function() {
|
|
934
957
|
e.off("playing", n), e.off("adplaying", n);
|
|
@@ -936,27 +959,27 @@ var zt = function(a) {
|
|
|
936
959
|
}
|
|
937
960
|
});
|
|
938
961
|
}
|
|
939
|
-
return
|
|
962
|
+
return U(a, [{ key: "_inPrerollPosition", value: function() {
|
|
940
963
|
return typeof this.pm.data.view_content_playback_time > "u" || this.pm.data.view_content_playback_time <= 1e3;
|
|
941
964
|
} }, { key: "calculateTimeToFirstFrame", value: function(e, t) {
|
|
942
965
|
t === this.pm.data.view_id && (this.pm.watchTimeTracker._updateWatchTime(null, { viewer_time: e }), this.pm.data.view_time_to_first_frame = this.pm.data.view_watch_time, (this.pm.data.player_autoplay_on || this.pm.data.video_is_autoplay) && this.pm.pageLoadInitTime && (this.pm.data.view_aggregate_startup_time = this.pm.data.view_start + this.pm.data.view_watch_time - this.pm.pageLoadInitTime));
|
|
943
966
|
} }]), a;
|
|
944
967
|
})(), ga = ya, ba = function a(e) {
|
|
945
968
|
var t = this;
|
|
946
|
-
|
|
969
|
+
P(this, a), v(this, "_lastPlayerHeight", void 0), v(this, "_lastPlayerWidth", void 0), v(this, "_lastPlayheadPosition", void 0), v(this, "_lastSourceHeight", void 0), v(this, "_lastSourceWidth", void 0), e.on("viewinit", function() {
|
|
947
970
|
t._lastPlayheadPosition = -1;
|
|
948
971
|
});
|
|
949
|
-
var r = ["pause", "rebufferstart", "seeking", "error", "adbreakstart", "hb", "renditionchange", "orientationchange", "viewend"], i = ["playing", "hb", "renditionchange", "orientationchange"];
|
|
972
|
+
var r = ["pause", "rebufferstart", "seeking", "error", "adbreakstart", "hb", "renditionchange", "orientationchange", "viewend", "playbackmodechange"], i = ["playing", "hb", "renditionchange", "orientationchange", "playbackmodechange"];
|
|
950
973
|
r.forEach(function(n) {
|
|
951
974
|
e.on(n, function() {
|
|
952
975
|
if (t._lastPlayheadPosition >= 0 && e.data.player_playhead_time >= 0 && t._lastPlayerWidth >= 0 && t._lastSourceWidth > 0 && t._lastPlayerHeight >= 0 && t._lastSourceHeight > 0) {
|
|
953
|
-
var
|
|
954
|
-
if (
|
|
976
|
+
var s = e.data.player_playhead_time - t._lastPlayheadPosition;
|
|
977
|
+
if (s < 0) {
|
|
955
978
|
t._lastPlayheadPosition = -1;
|
|
956
979
|
return;
|
|
957
980
|
}
|
|
958
|
-
var u = Math.min(t._lastPlayerWidth / t._lastSourceWidth, t._lastPlayerHeight / t._lastSourceHeight), d = Math.max(0, u - 1),
|
|
959
|
-
e.data.view_max_upscale_percentage = Math.max(e.data.view_max_upscale_percentage || 0, d), e.data.view_max_downscale_percentage = Math.max(e.data.view_max_downscale_percentage || 0,
|
|
981
|
+
var u = Math.min(t._lastPlayerWidth / t._lastSourceWidth, t._lastPlayerHeight / t._lastSourceHeight), d = Math.max(0, u - 1), l = Math.max(0, 1 - u);
|
|
982
|
+
e.data.view_max_upscale_percentage = Math.max(e.data.view_max_upscale_percentage || 0, d), e.data.view_max_downscale_percentage = Math.max(e.data.view_max_downscale_percentage || 0, l), L(e.data, "view_total_content_playback_time", s), L(e.data, "view_total_upscaling", d * s), L(e.data, "view_total_downscaling", l * s);
|
|
960
983
|
}
|
|
961
984
|
t._lastPlayheadPosition = -1;
|
|
962
985
|
});
|
|
@@ -967,30 +990,30 @@ var zt = function(a) {
|
|
|
967
990
|
});
|
|
968
991
|
}, wa = ba, Ta = 2e3, ka = function a(e) {
|
|
969
992
|
var t = this;
|
|
970
|
-
|
|
993
|
+
P(this, a), v(this, "isSeeking", void 0), this.isSeeking = !1;
|
|
971
994
|
var r = -1, i = function() {
|
|
972
|
-
var n =
|
|
973
|
-
|
|
995
|
+
var n = I.now(), s = (e.data.viewer_time || n) - (r || n);
|
|
996
|
+
L(e.data, "view_seek_duration", s), e.data.view_max_seek_time = Math.max(e.data.view_max_seek_time || 0, s), t.isSeeking = !1, r = -1;
|
|
974
997
|
};
|
|
975
|
-
e.on("seeking", function(n,
|
|
976
|
-
if (Object.assign(e.data,
|
|
977
|
-
r =
|
|
998
|
+
e.on("seeking", function(n, s) {
|
|
999
|
+
if (Object.assign(e.data, s), t.isSeeking && s.viewer_time - r <= Ta) {
|
|
1000
|
+
r = s.viewer_time;
|
|
978
1001
|
return;
|
|
979
1002
|
}
|
|
980
|
-
t.isSeeking && i(), t.isSeeking = !0, r =
|
|
1003
|
+
t.isSeeking && i(), t.isSeeking = !0, r = s.viewer_time, L(e.data, "view_seek_count", 1), e.send("seeking");
|
|
981
1004
|
}), e.on("seeked", function() {
|
|
982
1005
|
i();
|
|
983
1006
|
}), e.on("viewend", function() {
|
|
984
1007
|
t.isSeeking && (i(), e.send("seeked")), t.isSeeking = !1, r = -1;
|
|
985
1008
|
});
|
|
986
|
-
}, Ea = ka,
|
|
1009
|
+
}, Ea = ka, He = function(a, e) {
|
|
987
1010
|
a.push(e), a.sort(function(t, r) {
|
|
988
1011
|
return t.viewer_time - r.viewer_time;
|
|
989
1012
|
});
|
|
990
1013
|
}, xa = ["adbreakstart", "adrequest", "adresponse", "adplay", "adplaying", "adpause", "adended", "adbreakend", "aderror", "adclicked", "adskipped"], Da = (function() {
|
|
991
1014
|
function a(e) {
|
|
992
1015
|
var t = this;
|
|
993
|
-
|
|
1016
|
+
P(this, a), v(this, "_adHasPlayed", void 0), v(this, "_adRequests", void 0), v(this, "_adResponses", void 0), v(this, "_currentAdRequestNumber", void 0), v(this, "_currentAdResponseNumber", void 0), v(this, "_prerollPlayTime", void 0), v(this, "_wouldBeNewAdPlay", void 0), v(this, "isAdBreak", void 0), v(this, "pm", void 0), this.pm = e, e.on("viewinit", function() {
|
|
994
1017
|
t.isAdBreak = !1, t._currentAdRequestNumber = 0, t._currentAdResponseNumber = 0, t._adRequests = [], t._adResponses = [], t._adHasPlayed = !1, t._wouldBeNewAdPlay = !0, t._prerollPlayTime = void 0;
|
|
995
1018
|
}), xa.forEach(function(i) {
|
|
996
1019
|
return e.on(i, t._updateAdData.bind(t));
|
|
@@ -1001,26 +1024,26 @@ var zt = function(a) {
|
|
|
1001
1024
|
e.on("adbreakstart", function() {
|
|
1002
1025
|
t.isAdBreak = !0;
|
|
1003
1026
|
}), e.on("play", r), e.on("playing", r), e.on("viewend", r), e.on("adrequest", function(i, n) {
|
|
1004
|
-
n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdRequestNumber++ }, n),
|
|
1027
|
+
n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdRequestNumber++ }, n), He(t._adRequests, n), L(e.data, "view_ad_request_count"), t.inPrerollPosition() && (e.data.view_preroll_requested = !0, t._adHasPlayed || L(e.data, "view_preroll_request_count"));
|
|
1005
1028
|
}), e.on("adresponse", function(i, n) {
|
|
1006
|
-
n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdResponseNumber++ }, n),
|
|
1007
|
-
var
|
|
1008
|
-
|
|
1029
|
+
n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdResponseNumber++ }, n), He(t._adResponses, n);
|
|
1030
|
+
var s = t.findAdRequest(n.ad_request_id);
|
|
1031
|
+
s && L(e.data, "view_ad_request_time", Math.max(0, n.viewer_time - s.viewer_time));
|
|
1009
1032
|
}), e.on("adplay", function(i, n) {
|
|
1010
|
-
t._adHasPlayed = !0, t._wouldBeNewAdPlay && (t._wouldBeNewAdPlay = !1,
|
|
1033
|
+
t._adHasPlayed = !0, t._wouldBeNewAdPlay && (t._wouldBeNewAdPlay = !1, L(e.data, "view_ad_played_count")), t.inPrerollPosition() && !e.data.view_preroll_played && (e.data.view_preroll_played = !0, t._adRequests.length > 0 && (e.data.view_preroll_request_time = Math.max(0, n.viewer_time - t._adRequests[0].viewer_time)), e.data.view_start && (e.data.view_startup_preroll_request_time = Math.max(0, n.viewer_time - e.data.view_start)), t._prerollPlayTime = n.viewer_time);
|
|
1011
1034
|
}), e.on("adplaying", function(i, n) {
|
|
1012
1035
|
t.inPrerollPosition() && typeof e.data.view_preroll_load_time > "u" && typeof t._prerollPlayTime < "u" && (e.data.view_preroll_load_time = n.viewer_time - t._prerollPlayTime, e.data.view_startup_preroll_load_time = n.viewer_time - t._prerollPlayTime);
|
|
1013
1036
|
}), e.on("adclicked", function(i, n) {
|
|
1014
|
-
t._wouldBeNewAdPlay ||
|
|
1037
|
+
t._wouldBeNewAdPlay || L(e.data, "view_ad_clicked_count");
|
|
1015
1038
|
}), e.on("adskipped", function(i, n) {
|
|
1016
|
-
t._wouldBeNewAdPlay ||
|
|
1039
|
+
t._wouldBeNewAdPlay || L(e.data, "view_ad_skipped_count");
|
|
1017
1040
|
}), e.on("adended", function() {
|
|
1018
1041
|
t._wouldBeNewAdPlay = !0;
|
|
1019
1042
|
}), e.on("aderror", function() {
|
|
1020
1043
|
t._wouldBeNewAdPlay = !0;
|
|
1021
1044
|
});
|
|
1022
1045
|
}
|
|
1023
|
-
return
|
|
1046
|
+
return U(a, [{ key: "inPrerollPosition", value: function() {
|
|
1024
1047
|
return typeof this.pm.data.view_content_playback_time > "u" || this.pm.data.view_content_playback_time <= 1e3;
|
|
1025
1048
|
} }, { key: "findAdRequest", value: function(e) {
|
|
1026
1049
|
for (var t = 0; t < this._adRequests.length; t++) if (this._adRequests[t].ad_request_id === e) return this._adRequests[t];
|
|
@@ -1031,46 +1054,26 @@ var zt = function(a) {
|
|
|
1031
1054
|
this.pm.data.view_preroll_ad_tag_domain = n, this.pm.data.view_preroll_ad_tag_hostname = i;
|
|
1032
1055
|
}
|
|
1033
1056
|
if (!this.pm.data.view_preroll_ad_asset_hostname && t.ad_asset_url) {
|
|
1034
|
-
var
|
|
1057
|
+
var s = Q(le(t.ad_asset_url), 2), u = s[0], d = s[1];
|
|
1035
1058
|
this.pm.data.view_preroll_ad_asset_domain = d, this.pm.data.view_preroll_ad_asset_hostname = u;
|
|
1036
1059
|
}
|
|
1060
|
+
this.pm.data.ad_type = "preroll";
|
|
1037
1061
|
}
|
|
1038
|
-
this.pm.data.ad_asset_url = t?.ad_asset_url, this.pm.data.ad_tag_url = t?.ad_tag_url, this.pm.data.ad_creative_id = t?.ad_creative_id, this.pm.data.ad_id = t?.ad_id, this.pm.data.ad_universal_id = t?.ad_universal_id;
|
|
1062
|
+
this.pm.data.ad_asset_url = t?.ad_asset_url, this.pm.data.ad_tag_url = t?.ad_tag_url, this.pm.data.ad_creative_id = t?.ad_creative_id, this.pm.data.ad_id = t?.ad_id, this.pm.data.ad_universal_id = t?.ad_universal_id, t != null && t.ad_type && (this.pm.data.ad_type = t?.ad_type);
|
|
1039
1063
|
} }]), a;
|
|
1040
|
-
})(),
|
|
1041
|
-
I(this, a);
|
|
1042
|
-
var t, r, i = function() {
|
|
1043
|
-
e.disableRebufferTracking || (A(e.data, "view_waiting_rebuffer_count", 1), t = P.now(), r = He.default.setInterval(function() {
|
|
1044
|
-
if (t) {
|
|
1045
|
-
var c = P.now();
|
|
1046
|
-
A(e.data, "view_waiting_rebuffer_duration", c - t), t = c;
|
|
1047
|
-
}
|
|
1048
|
-
}, 250));
|
|
1049
|
-
}, n = function() {
|
|
1050
|
-
e.disableRebufferTracking || t && (A(e.data, "view_waiting_rebuffer_duration", P.now() - t), t = !1, He.default.clearInterval(r));
|
|
1051
|
-
}, o = !1, u = function() {
|
|
1052
|
-
o = !0;
|
|
1053
|
-
}, d = function() {
|
|
1054
|
-
o = !1, n();
|
|
1055
|
-
};
|
|
1056
|
-
e.on("waiting", function() {
|
|
1057
|
-
o && i();
|
|
1058
|
-
}), e.on("playing", function() {
|
|
1059
|
-
n(), u();
|
|
1060
|
-
}), e.on("pause", d), e.on("seeking", d);
|
|
1061
|
-
}, Sa = Ra, Oa = function a(e) {
|
|
1064
|
+
})(), Ra = Da, qa = function a(e) {
|
|
1062
1065
|
var t = this;
|
|
1063
|
-
|
|
1066
|
+
P(this, a), v(this, "lastWallClockTime", void 0);
|
|
1064
1067
|
var r = function() {
|
|
1065
|
-
t.lastWallClockTime =
|
|
1068
|
+
t.lastWallClockTime = I.now(), e.on("before*", i);
|
|
1066
1069
|
}, i = function(n) {
|
|
1067
|
-
var
|
|
1068
|
-
t.lastWallClockTime =
|
|
1070
|
+
var s = I.now(), u = t.lastWallClockTime;
|
|
1071
|
+
t.lastWallClockTime = s, s - u > 3e4 && (e.emit("devicesleep", { viewer_time: u }), Object.assign(e.data, { viewer_time: u }), e.send("devicesleep"), e.emit("devicewake", { viewer_time: s }), Object.assign(e.data, { viewer_time: s }), e.send("devicewake"));
|
|
1069
1072
|
};
|
|
1070
1073
|
e.one("playbackheartbeat", r), e.on("playbackheartbeatend", function() {
|
|
1071
1074
|
e.off("before*", i), e.one("playbackheartbeat", r);
|
|
1072
1075
|
});
|
|
1073
|
-
}, Aa =
|
|
1076
|
+
}, Aa = qa, Ee = j(G()), tt = (function(a) {
|
|
1074
1077
|
return a();
|
|
1075
1078
|
})(function() {
|
|
1076
1079
|
var a = function() {
|
|
@@ -1081,35 +1084,35 @@ var zt = function(a) {
|
|
|
1081
1084
|
return r;
|
|
1082
1085
|
};
|
|
1083
1086
|
function e(t) {
|
|
1084
|
-
function r(i, n,
|
|
1087
|
+
function r(i, n, s) {
|
|
1085
1088
|
var u;
|
|
1086
1089
|
if (typeof document < "u") {
|
|
1087
1090
|
if (arguments.length > 1) {
|
|
1088
|
-
if (
|
|
1091
|
+
if (s = a({ path: "/" }, r.defaults, s), typeof s.expires == "number") {
|
|
1089
1092
|
var d = /* @__PURE__ */ new Date();
|
|
1090
|
-
d.setMilliseconds(d.getMilliseconds() +
|
|
1093
|
+
d.setMilliseconds(d.getMilliseconds() + s.expires * 864e5), s.expires = d;
|
|
1091
1094
|
}
|
|
1092
1095
|
try {
|
|
1093
1096
|
u = JSON.stringify(n), /^[\{\[]/.test(u) && (n = u);
|
|
1094
1097
|
} catch {
|
|
1095
1098
|
}
|
|
1096
|
-
return t.write ? n = t.write(n, i) : n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), i = encodeURIComponent(String(i)), i = i.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent), i = i.replace(/[\(\)]/g, escape), document.cookie = [i, "=", n,
|
|
1099
|
+
return t.write ? n = t.write(n, i) : n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), i = encodeURIComponent(String(i)), i = i.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent), i = i.replace(/[\(\)]/g, escape), document.cookie = [i, "=", n, s.expires ? "; expires=" + s.expires.toUTCString() : "", s.path ? "; path=" + s.path : "", s.domain ? "; domain=" + s.domain : "", s.secure ? "; secure" : ""].join("");
|
|
1097
1100
|
}
|
|
1098
1101
|
i || (u = {});
|
|
1099
|
-
for (var
|
|
1100
|
-
var
|
|
1101
|
-
|
|
1102
|
+
for (var l = document.cookie ? document.cookie.split("; ") : [], m = /(%[0-9A-Z]{2})+/g, b = 0; b < l.length; b++) {
|
|
1103
|
+
var c = l[b].split("="), o = c.slice(1).join("=");
|
|
1104
|
+
o.charAt(0) === '"' && (o = o.slice(1, -1));
|
|
1102
1105
|
try {
|
|
1103
|
-
var
|
|
1104
|
-
if (
|
|
1105
|
-
|
|
1106
|
+
var p = c[0].replace(m, decodeURIComponent);
|
|
1107
|
+
if (o = t.read ? t.read(o, p) : t(o, p) || o.replace(m, decodeURIComponent), this.json) try {
|
|
1108
|
+
o = JSON.parse(o);
|
|
1106
1109
|
} catch {
|
|
1107
1110
|
}
|
|
1108
|
-
if (i ===
|
|
1109
|
-
u =
|
|
1111
|
+
if (i === p) {
|
|
1112
|
+
u = o;
|
|
1110
1113
|
break;
|
|
1111
1114
|
}
|
|
1112
|
-
i || (u[
|
|
1115
|
+
i || (u[p] = o);
|
|
1113
1116
|
} catch {
|
|
1114
1117
|
}
|
|
1115
1118
|
}
|
|
@@ -1126,46 +1129,46 @@ var zt = function(a) {
|
|
|
1126
1129
|
}
|
|
1127
1130
|
return e(function() {
|
|
1128
1131
|
});
|
|
1129
|
-
}), at = "muxData",
|
|
1132
|
+
}), at = "muxData", Sa = function(a) {
|
|
1130
1133
|
return Object.entries(a).map(function(e) {
|
|
1131
1134
|
var t = Q(e, 2), r = t[0], i = t[1];
|
|
1132
1135
|
return "".concat(r, "=").concat(i);
|
|
1133
1136
|
}).join("&");
|
|
1134
|
-
},
|
|
1137
|
+
}, Oa = function(a) {
|
|
1135
1138
|
return a.split("&").reduce(function(e, t) {
|
|
1136
|
-
var r = Q(t.split("="), 2), i = r[0], n = r[1],
|
|
1139
|
+
var r = Q(t.split("="), 2), i = r[0], n = r[1], s = +n, u = n && s == n ? s : n;
|
|
1137
1140
|
return e[i] = u, e;
|
|
1138
1141
|
}, {});
|
|
1139
|
-
},
|
|
1142
|
+
}, it = function() {
|
|
1140
1143
|
var a;
|
|
1141
1144
|
try {
|
|
1142
|
-
a =
|
|
1145
|
+
a = Oa(tt.get(at) || "");
|
|
1143
1146
|
} catch {
|
|
1144
1147
|
a = {};
|
|
1145
1148
|
}
|
|
1146
1149
|
return a;
|
|
1147
|
-
},
|
|
1150
|
+
}, rt = function(a) {
|
|
1148
1151
|
try {
|
|
1149
|
-
tt.set(at,
|
|
1152
|
+
tt.set(at, Sa(a), { expires: 365 });
|
|
1150
1153
|
} catch {
|
|
1151
1154
|
}
|
|
1152
|
-
},
|
|
1153
|
-
var a =
|
|
1154
|
-
return a.mux_viewer_id = a.mux_viewer_id || de(), a.msn = a.msn || Math.random(),
|
|
1155
|
-
},
|
|
1156
|
-
var a =
|
|
1157
|
-
return a.session_start && (a.sst = a.session_start, delete a.session_start), a.session_id && (a.sid = a.session_id, delete a.session_id), a.session_expires && (a.sex = a.session_expires, delete a.session_expires), (!a.sex || a.sex < e) && (a.sid = de(), a.sst = e), a.sex = e + 1500 * 1e3,
|
|
1155
|
+
}, Pa = function() {
|
|
1156
|
+
var a = it();
|
|
1157
|
+
return a.mux_viewer_id = a.mux_viewer_id || de(), a.msn = a.msn || Math.random(), rt(a), { mux_viewer_id: a.mux_viewer_id, mux_sample_number: a.msn };
|
|
1158
|
+
}, La = function() {
|
|
1159
|
+
var a = it(), e = I.now();
|
|
1160
|
+
return a.session_start && (a.sst = a.session_start, delete a.session_start), a.session_id && (a.sid = a.session_id, delete a.session_id), a.session_expires && (a.sex = a.session_expires, delete a.session_expires), (!a.sex || a.sex < e) && (a.sid = de(), a.sst = e), a.sex = e + 1500 * 1e3, rt(a), { session_id: a.sid, session_start: a.sst, session_expires: a.sex };
|
|
1158
1161
|
};
|
|
1159
|
-
function
|
|
1162
|
+
function Ia(a, e) {
|
|
1160
1163
|
var t = e.beaconCollectionDomain, r = e.beaconDomain;
|
|
1161
1164
|
if (t) return "https://" + t;
|
|
1162
1165
|
a = a || "inferred";
|
|
1163
1166
|
var i = r || "litix.io";
|
|
1164
1167
|
return a.match(/^[a-z0-9]+$/) ? "https://" + a + "." + i : "https://img.litix.io/a.gif";
|
|
1165
1168
|
}
|
|
1166
|
-
var
|
|
1169
|
+
var Na = j(G()), nt = function() {
|
|
1167
1170
|
var a;
|
|
1168
|
-
switch (
|
|
1171
|
+
switch (st()) {
|
|
1169
1172
|
case "cellular":
|
|
1170
1173
|
a = "cellular";
|
|
1171
1174
|
break;
|
|
@@ -1181,13 +1184,13 @@ var ja = C(U()), nt = function() {
|
|
|
1181
1184
|
a = "other";
|
|
1182
1185
|
}
|
|
1183
1186
|
return a;
|
|
1184
|
-
},
|
|
1185
|
-
var a =
|
|
1187
|
+
}, st = function() {
|
|
1188
|
+
var a = Na.default.navigator, e = a && (a.connection || a.mozConnection || a.webkitConnection);
|
|
1186
1189
|
return e && e.type;
|
|
1187
1190
|
};
|
|
1188
|
-
nt.getConnectionFromAPI =
|
|
1189
|
-
var
|
|
1190
|
-
function
|
|
1191
|
+
nt.getConnectionFromAPI = st;
|
|
1192
|
+
var Ca = nt, ja = { a: "env", b: "beacon", c: "custom", d: "ad", e: "event", f: "experiment", i: "internal", m: "mux", n: "response", p: "player", q: "request", r: "retry", s: "session", t: "timestamp", u: "viewer", v: "video", w: "page", x: "view", y: "sub" }, Ha = ot(ja), Ba = { ad: "ad", af: "affiliate", ag: "aggregate", ap: "api", al: "application", ao: "audio", ar: "architecture", as: "asset", au: "autoplay", av: "average", bi: "bitrate", bn: "brand", br: "break", bw: "browser", by: "bytes", bz: "business", ca: "cached", cb: "cancel", cc: "codec", cd: "code", cg: "category", ch: "changed", ci: "client", ck: "clicked", cl: "canceled", cm: "cmcd", cn: "config", co: "count", ce: "counter", cp: "complete", cq: "creator", cr: "creative", cs: "captions", ct: "content", cu: "current", cv: "cumulative", cx: "connection", cz: "context", da: "data", dg: "downscaling", dm: "domain", dn: "cdn", do: "downscale", dr: "drm", dp: "dropped", du: "duration", dv: "device", dy: "dynamic", eb: "enabled", ec: "encoding", ed: "edge", en: "end", eg: "engine", em: "embed", er: "error", ep: "experiments", es: "errorcode", et: "errortext", ee: "event", ev: "events", ex: "expires", ez: "exception", fa: "failed", fi: "first", fm: "family", ft: "format", fp: "fps", fq: "frequency", fr: "frame", fs: "fullscreen", ha: "has", hb: "holdback", he: "headers", ho: "host", hn: "hostname", ht: "height", id: "id", ii: "init", in: "instance", ip: "ip", is: "is", ke: "key", la: "language", lb: "labeled", le: "level", li: "live", ld: "loaded", lo: "load", ls: "lists", lt: "latency", ma: "max", md: "media", me: "message", mf: "manifest", mi: "mime", ml: "midroll", mm: "min", mn: "manufacturer", mo: "model", mp: "mode", ms: "ms", mx: "mux", ne: "newest", nm: "name", no: "number", on: "on", or: "origin", os: "os", pa: "paused", pb: "playback", pd: "producer", pe: "percentage", pf: "played", pg: "program", ph: "playhead", pi: "plugin", pl: "preroll", pn: "playing", po: "poster", pp: "pip", pr: "preload", ps: "position", pt: "part", pv: "previous", py: "property", px: "pop", pz: "plan", ra: "rate", rd: "requested", re: "rebuffer", rf: "rendition", rg: "range", rm: "remote", ro: "ratio", rp: "response", rq: "request", rs: "requests", sa: "sample", sd: "skipped", se: "session", sh: "shift", sk: "seek", sm: "stream", so: "source", sq: "sequence", sr: "series", ss: "status", st: "start", su: "startup", sv: "server", sw: "software", sy: "severity", ta: "tag", tc: "tech", te: "text", tg: "target", th: "throughput", ti: "time", tl: "total", to: "to", tt: "title", ty: "type", ug: "upscaling", un: "universal", up: "upscale", ur: "url", us: "user", va: "variant", vd: "viewed", vi: "video", ve: "version", vw: "view", vr: "viewer", wd: "width", wa: "watch", wt: "waiting" }, Be = ot(Ba);
|
|
1193
|
+
function ot(a) {
|
|
1191
1194
|
var e = {};
|
|
1192
1195
|
for (var t in a) a.hasOwnProperty(t) && (e[a[t]] = t);
|
|
1193
1196
|
return e;
|
|
@@ -1197,22 +1200,22 @@ function Se(a) {
|
|
|
1197
1200
|
return Object.keys(a).forEach(function(r) {
|
|
1198
1201
|
var i = !1;
|
|
1199
1202
|
if (a.hasOwnProperty(r) && a[r] !== void 0) {
|
|
1200
|
-
var n = r.split("_"),
|
|
1201
|
-
u || (q.info("Data key word `" + n[0] + "` not expected in " + r), u =
|
|
1202
|
-
d === "url" && (i = !0),
|
|
1203
|
+
var n = r.split("_"), s = n[0], u = Ha[s];
|
|
1204
|
+
u || (q.info("Data key word `" + n[0] + "` not expected in " + r), u = s + "_"), n.splice(1).forEach(function(d) {
|
|
1205
|
+
d === "url" && (i = !0), Be[d] ? u += Be[d] : Number.isInteger(Number(d)) ? u += d : (q.info("Data key word `" + d + "` not expected in " + r), u += "_" + d + "_");
|
|
1203
1206
|
}), i ? t[u] = a[r] : e[u] = a[r];
|
|
1204
1207
|
}
|
|
1205
1208
|
}), Object.assign(e, t);
|
|
1206
1209
|
}
|
|
1207
|
-
var X =
|
|
1210
|
+
var X = j(G()), Ma = j(Ye()), Ua = { maxBeaconSize: 300, maxQueueLength: 3600, baseTimeBetweenBeacons: 1e4, maxPayloadKBSize: 500 }, Fa = 56 * 1024, Ga = ["hb", "requestcompleted", "requestfailed", "requestcanceled"], Qa = "https://img.litix.io", W = function(a) {
|
|
1208
1211
|
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1209
|
-
this._beaconUrl = a ||
|
|
1212
|
+
this._beaconUrl = a || Qa, this._eventQueue = [], this._postInFlight = !1, this._resendAfterPost = !1, this._failureCount = 0, this._sendTimeout = !1, this._options = Object.assign({}, Ua, e);
|
|
1210
1213
|
};
|
|
1211
|
-
|
|
1214
|
+
W.prototype.queueEvent = function(a, e) {
|
|
1212
1215
|
var t = Object.assign({}, e);
|
|
1213
1216
|
return this._eventQueue.length <= this._options.maxQueueLength || a === "eventrateexceeded" ? (this._eventQueue.push(t), this._sendTimeout || this._startBeaconSending(), this._eventQueue.length <= this._options.maxQueueLength) : !1;
|
|
1214
1217
|
};
|
|
1215
|
-
|
|
1218
|
+
W.prototype.flushEvents = function() {
|
|
1216
1219
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1217
1220
|
if (a && this._eventQueue.length === 1) {
|
|
1218
1221
|
this._eventQueue.pop();
|
|
@@ -1220,18 +1223,18 @@ G.prototype.flushEvents = function() {
|
|
|
1220
1223
|
}
|
|
1221
1224
|
this._eventQueue.length && this._sendBeaconQueue(), this._startBeaconSending();
|
|
1222
1225
|
};
|
|
1223
|
-
|
|
1226
|
+
W.prototype.destroy = function() {
|
|
1224
1227
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1225
1228
|
this.destroyed = !0, a ? this._clearBeaconQueue() : this.flushEvents(), X.default.clearTimeout(this._sendTimeout);
|
|
1226
1229
|
};
|
|
1227
|
-
|
|
1230
|
+
W.prototype._clearBeaconQueue = function() {
|
|
1228
1231
|
var a = this._eventQueue.length > this._options.maxBeaconSize ? this._eventQueue.length - this._options.maxBeaconSize : 0, e = this._eventQueue.slice(a);
|
|
1229
1232
|
a > 0 && Object.assign(e[e.length - 1], Se({ mux_view_message: "event queue truncated" }));
|
|
1230
1233
|
var t = this._createPayload(e);
|
|
1231
1234
|
ut(this._beaconUrl, t, !0, function() {
|
|
1232
1235
|
});
|
|
1233
1236
|
};
|
|
1234
|
-
|
|
1237
|
+
W.prototype._sendBeaconQueue = function() {
|
|
1235
1238
|
var a = this;
|
|
1236
1239
|
if (this._postInFlight) {
|
|
1237
1240
|
this._resendAfterPost = !0;
|
|
@@ -1239,41 +1242,41 @@ G.prototype._sendBeaconQueue = function() {
|
|
|
1239
1242
|
}
|
|
1240
1243
|
var e = this._eventQueue.slice(0, this._options.maxBeaconSize);
|
|
1241
1244
|
this._eventQueue = this._eventQueue.slice(this._options.maxBeaconSize), this._postInFlight = !0;
|
|
1242
|
-
var t = this._createPayload(e), r =
|
|
1245
|
+
var t = this._createPayload(e), r = I.now();
|
|
1243
1246
|
ut(this._beaconUrl, t, !1, function(i, n) {
|
|
1244
|
-
n ? (a._eventQueue = e.concat(a._eventQueue), a._failureCount += 1, q.info("Error sending beacon: " + n)) : a._failureCount = 0, a._roundTripTime =
|
|
1247
|
+
n ? (a._eventQueue = e.concat(a._eventQueue), a._failureCount += 1, q.info("Error sending beacon: " + n)) : a._failureCount = 0, a._roundTripTime = I.now() - r, a._postInFlight = !1, a._resendAfterPost && (a._resendAfterPost = !1, a._eventQueue.length > 0 && a._sendBeaconQueue());
|
|
1245
1248
|
});
|
|
1246
1249
|
};
|
|
1247
|
-
|
|
1250
|
+
W.prototype._getNextBeaconTime = function() {
|
|
1248
1251
|
if (!this._failureCount) return this._options.baseTimeBetweenBeacons;
|
|
1249
1252
|
var a = Math.pow(2, this._failureCount - 1);
|
|
1250
1253
|
return a = a * Math.random(), (1 + a) * this._options.baseTimeBetweenBeacons;
|
|
1251
1254
|
};
|
|
1252
|
-
|
|
1255
|
+
W.prototype._startBeaconSending = function() {
|
|
1253
1256
|
var a = this;
|
|
1254
1257
|
X.default.clearTimeout(this._sendTimeout), !this.destroyed && (this._sendTimeout = X.default.setTimeout(function() {
|
|
1255
1258
|
a._eventQueue.length && a._sendBeaconQueue(), a._startBeaconSending();
|
|
1256
1259
|
}, this._getNextBeaconTime()));
|
|
1257
1260
|
};
|
|
1258
|
-
|
|
1259
|
-
var e = this, t = { transmission_timestamp: Math.round(
|
|
1261
|
+
W.prototype._createPayload = function(a) {
|
|
1262
|
+
var e = this, t = { transmission_timestamp: Math.round(I.now()) };
|
|
1260
1263
|
this._roundTripTime && (t.rtt_ms = Math.round(this._roundTripTime));
|
|
1261
|
-
var r, i, n,
|
|
1264
|
+
var r, i, n, s = function() {
|
|
1262
1265
|
r = JSON.stringify({ metadata: t, events: i || a }), n = r.length / 1024;
|
|
1263
1266
|
}, u = function() {
|
|
1264
1267
|
return n <= e._options.maxPayloadKBSize;
|
|
1265
1268
|
};
|
|
1266
|
-
return
|
|
1269
|
+
return s(), u() || (q.info("Payload size is too big (" + n + " kb). Removing unnecessary events."), i = a.filter(function(d) {
|
|
1267
1270
|
return Ga.indexOf(d.e) === -1;
|
|
1268
|
-
}),
|
|
1269
|
-
for (var
|
|
1270
|
-
var
|
|
1271
|
-
typeof
|
|
1271
|
+
}), s()), u() || (q.info("Payload size still too big (" + n + " kb). Cropping fields.."), i.forEach(function(d) {
|
|
1272
|
+
for (var l in d) {
|
|
1273
|
+
var m = d[l], b = 50 * 1024;
|
|
1274
|
+
typeof m == "string" && m.length > b && (d[l] = m.substring(0, b));
|
|
1272
1275
|
}
|
|
1273
|
-
}),
|
|
1276
|
+
}), s()), r;
|
|
1274
1277
|
};
|
|
1275
|
-
var
|
|
1276
|
-
return a.length <=
|
|
1278
|
+
var Wa = typeof Ma.default.exitPictureInPicture == "function" ? function(a) {
|
|
1279
|
+
return a.length <= Fa;
|
|
1277
1280
|
} : function(a) {
|
|
1278
1281
|
return !1;
|
|
1279
1282
|
}, ut = function(a, e, t, r) {
|
|
@@ -1282,7 +1285,7 @@ var Ja = typeof Fa.default.exitPictureInPicture == "function" ? function(a) {
|
|
|
1282
1285
|
return;
|
|
1283
1286
|
}
|
|
1284
1287
|
if (X.default.fetch) {
|
|
1285
|
-
X.default.fetch(a, { method: "POST", body: e, headers: { "Content-Type": "text/plain" }, keepalive:
|
|
1288
|
+
X.default.fetch(a, { method: "POST", body: e, headers: { "Content-Type": "text/plain" }, keepalive: Wa(e) }).then(function(n) {
|
|
1286
1289
|
return r(null, n.ok ? null : "Error");
|
|
1287
1290
|
}).catch(function(n) {
|
|
1288
1291
|
return r(null, n);
|
|
@@ -1297,188 +1300,241 @@ var Ja = typeof Fa.default.exitPictureInPicture == "function" ? function(a) {
|
|
|
1297
1300
|
return;
|
|
1298
1301
|
}
|
|
1299
1302
|
r();
|
|
1300
|
-
},
|
|
1303
|
+
}, Va = W, Ja = ["env_key", "view_id", "view_sequence_number", "player_sequence_number", "beacon_domain", "player_playhead_time", "viewer_time", "mux_api_version", "event", "video_id", "player_instance_id", "player_error_code", "player_error_message", "player_error_context", "player_error_severity", "player_error_business_exception", "view_playing_time_ms_cumulative", "ad_playing_time_ms_cumulative"], za = ["adplay", "adplaying", "adpause", "adfirstquartile", "admidpoint", "adthirdquartile", "adended", "adresponse", "adrequest"], Ka = ["ad_id", "ad_creative_id", "ad_universal_id"], Ya = ["viewstart", "error", "ended", "viewend"], Xa = 600 * 1e3, Za = (function() {
|
|
1301
1304
|
function a(e, t) {
|
|
1302
1305
|
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1303
|
-
|
|
1304
|
-
var i, n,
|
|
1305
|
-
|
|
1306
|
+
P(this, a);
|
|
1307
|
+
var i, n, s, u, d, l, m, b, c, o, p, y;
|
|
1308
|
+
v(this, "mux", void 0), v(this, "envKey", void 0), v(this, "options", void 0), v(this, "eventQueue", void 0), v(this, "sampleRate", void 0), v(this, "disableCookies", void 0), v(this, "respectDoNotTrack", void 0), v(this, "previousBeaconData", void 0), v(this, "lastEventTime", void 0), v(this, "rateLimited", void 0), v(this, "pageLevelData", void 0), v(this, "viewerData", void 0), this.mux = e, this.envKey = t, this.options = r, this.previousBeaconData = null, this.lastEventTime = 0, this.rateLimited = !1, this.eventQueue = new Va(Ia(this.envKey, this.options));
|
|
1306
1309
|
var f;
|
|
1307
1310
|
this.sampleRate = (f = this.options.sampleRate) !== null && f !== void 0 ? f : 1;
|
|
1308
1311
|
var g;
|
|
1309
1312
|
this.disableCookies = (g = this.options.disableCookies) !== null && g !== void 0 ? g : !1;
|
|
1310
|
-
var
|
|
1311
|
-
this.respectDoNotTrack = (
|
|
1313
|
+
var _;
|
|
1314
|
+
this.respectDoNotTrack = (_ = this.options.respectDoNotTrack) !== null && _ !== void 0 ? _ : !1, this.previousBeaconData = null, this.lastEventTime = 0, this.rateLimited = !1, this.pageLevelData = { mux_api_version: this.mux.API_VERSION, mux_embed: this.mux.NAME, mux_embed_version: this.mux.VERSION, viewer_application_name: (i = this.options.platform) === null || i === void 0 ? void 0 : i.name, viewer_application_version: (n = this.options.platform) === null || n === void 0 ? void 0 : n.version, viewer_application_engine: (s = this.options.platform) === null || s === void 0 ? void 0 : s.layout, viewer_device_name: (u = this.options.platform) === null || u === void 0 ? void 0 : u.product, viewer_device_category: "", viewer_device_manufacturer: (d = this.options.platform) === null || d === void 0 ? void 0 : d.manufacturer, viewer_os_family: (m = this.options.platform) === null || m === void 0 || (l = m.os) === null || l === void 0 ? void 0 : l.family, viewer_os_architecture: (c = this.options.platform) === null || c === void 0 || (b = c.os) === null || b === void 0 ? void 0 : b.architecture, viewer_os_version: (p = this.options.platform) === null || p === void 0 || (o = p.os) === null || o === void 0 ? void 0 : o.version, viewer_connection_type: Ca(), page_url: Ee.default === null || Ee.default === void 0 || (y = Ee.default.location) === null || y === void 0 ? void 0 : y.href }, this.viewerData = this.disableCookies ? {} : Pa();
|
|
1312
1315
|
}
|
|
1313
|
-
return
|
|
1316
|
+
return U(a, [{ key: "send", value: function(e, t) {
|
|
1314
1317
|
if (!(!e || !(t != null && t.view_id))) {
|
|
1315
1318
|
if (this.respectDoNotTrack && qe()) return q.info("Not sending `" + e + "` because Do Not Track is enabled");
|
|
1316
1319
|
if (!t || typeof t != "object") return q.error("A data object was expected in send() but was not provided");
|
|
1317
|
-
var r = this.disableCookies ? {} :
|
|
1320
|
+
var r = this.disableCookies ? {} : La(), i = Oe(fe({}, this.pageLevelData, t, r, this.viewerData), { event: e, env_key: this.envKey });
|
|
1318
1321
|
i.user_id && (i.viewer_user_id = i.user_id, delete i.user_id);
|
|
1319
|
-
var n,
|
|
1320
|
-
if (this.lastEventTime = this.mux.utils.now(),
|
|
1321
|
-
if (this.envKey || q.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL", e, i, d), !this.rateLimited)
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
var n, s = ((n = i.mux_sample_number) !== null && n !== void 0 ? n : 0) >= this.sampleRate, u = this._deduplicateBeaconData(e, i), d = Se(u);
|
|
1323
|
+
if (this.lastEventTime = this.mux.utils.now(), s) return q.info("Not sending event due to sample rate restriction", e, i, d);
|
|
1324
|
+
if (this.envKey || q.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL", e, i, d), !this.rateLimited) if (q.info("Sending event", e, i, d), this.rateLimited = !this.eventQueue.queueEvent(e, d), this.mux.WINDOW_UNLOADING && e === "viewend") this.eventQueue.destroy(!0);
|
|
1325
|
+
else {
|
|
1326
|
+
if (this.mux.WINDOW_HIDDEN && e === "hb") this.eventQueue.flushEvents(!0);
|
|
1327
|
+
else if (Ya.indexOf(e) >= 0) {
|
|
1328
|
+
if (e === "error" && t.player_error_severity === "warning") return;
|
|
1329
|
+
this.eventQueue.flushEvents();
|
|
1330
|
+
}
|
|
1331
|
+
if (this.rateLimited) return i.event = "eventrateexceeded", d = Se(i), this.eventQueue.queueEvent(i.event, d), q.error("Beaconing disabled due to rate limit.");
|
|
1324
1332
|
}
|
|
1325
1333
|
}
|
|
1326
1334
|
} }, { key: "destroy", value: function() {
|
|
1327
1335
|
this.eventQueue.destroy(!1);
|
|
1328
1336
|
} }, { key: "_deduplicateBeaconData", value: function(e, t) {
|
|
1329
1337
|
var r = this, i = {}, n = t.view_id;
|
|
1330
|
-
if (n === "-1" || e === "viewstart" || e === "viewend" || !this.previousBeaconData || this.mux.utils.now() - this.lastEventTime >=
|
|
1338
|
+
if (n === "-1" || e === "viewstart" || e === "viewend" || !this.previousBeaconData || this.mux.utils.now() - this.lastEventTime >= Xa) i = fe({}, t), n && (this.previousBeaconData = i), n && e === "viewend" && (this.previousBeaconData = null);
|
|
1331
1339
|
else {
|
|
1332
|
-
var
|
|
1340
|
+
var s = e.indexOf("request") === 0;
|
|
1333
1341
|
Object.entries(t).forEach(function(u) {
|
|
1334
|
-
var d = Q(u, 2),
|
|
1335
|
-
r.previousBeaconData && (
|
|
1342
|
+
var d = Q(u, 2), l = d[0], m = d[1];
|
|
1343
|
+
r.previousBeaconData && (m !== r.previousBeaconData[l] || Ja.indexOf(l) > -1 || r.objectHasChanged(s, l, m, r.previousBeaconData[l]) || r.eventRequiresKey(e, l)) && (i[l] = m, r.previousBeaconData[l] = m);
|
|
1336
1344
|
});
|
|
1337
1345
|
}
|
|
1338
1346
|
return i;
|
|
1339
1347
|
} }, { key: "objectHasChanged", value: function(e, t, r, i) {
|
|
1340
1348
|
return !e || t.indexOf("request_") !== 0 ? !1 : t === "request_response_headers" || typeof r != "object" || typeof i != "object" ? !0 : Object.keys(r || {}).length !== Object.keys(i || {}).length;
|
|
1341
1349
|
} }, { key: "eventRequiresKey", value: function(e, t) {
|
|
1342
|
-
return !!(e === "renditionchange" && t.indexOf("video_source_") === 0 ||
|
|
1350
|
+
return !!(e === "renditionchange" && t.indexOf("video_source_") === 0 || Ka.includes(t) && za.includes(e) || e === "playbackmodechange" && t.indexOf("player_playback_mode") === 0);
|
|
1343
1351
|
} }]), a;
|
|
1344
|
-
})(),
|
|
1345
|
-
|
|
1346
|
-
var t = 0, r = 0, i = 0, n = 0,
|
|
1347
|
-
var
|
|
1352
|
+
})(), $a = function a(e) {
|
|
1353
|
+
P(this, a);
|
|
1354
|
+
var t = 0, r = 0, i = 0, n = 0, s = 0, u = 0, d = 0, l = function(c, o) {
|
|
1355
|
+
var p = o.request_start, y = o.request_response_start, f = o.request_response_end, g = o.request_bytes_loaded;
|
|
1348
1356
|
n++;
|
|
1349
|
-
var
|
|
1350
|
-
if (y ? (
|
|
1357
|
+
var _, h;
|
|
1358
|
+
if (y ? (_ = y - (p ?? 0), h = (f ?? 0) - y) : h = (f ?? 0) - (p ?? 0), h > 0 && g && g > 0) {
|
|
1351
1359
|
var w = g / h * 8e3;
|
|
1352
|
-
|
|
1360
|
+
s++, r += g, i += h, e.data.view_min_request_throughput = Math.min(e.data.view_min_request_throughput || 1 / 0, w), e.data.view_average_request_throughput = r / i * 8e3, e.data.view_request_count = n, _ > 0 && (t += _, e.data.view_max_request_latency = Math.max(e.data.view_max_request_latency || 0, _), e.data.view_average_request_latency = t / s);
|
|
1353
1361
|
}
|
|
1354
|
-
},
|
|
1362
|
+
}, m = function(c, o) {
|
|
1355
1363
|
n++, u++, e.data.view_request_count = n, e.data.view_request_failed_count = u;
|
|
1356
|
-
}, b = function(
|
|
1364
|
+
}, b = function(c, o) {
|
|
1357
1365
|
n++, d++, e.data.view_request_count = n, e.data.view_request_canceled_count = d;
|
|
1358
1366
|
};
|
|
1359
|
-
e.on("requestcompleted",
|
|
1360
|
-
},
|
|
1367
|
+
e.on("requestcompleted", l), e.on("requestfailed", m), e.on("requestcanceled", b);
|
|
1368
|
+
}, ei = $a, ti = 3600 * 1e3, ai = function a(e) {
|
|
1361
1369
|
var t = this;
|
|
1362
|
-
|
|
1363
|
-
var n = i.viewer_time,
|
|
1364
|
-
if (t._lastEventTime =
|
|
1365
|
-
var d = Object.keys(e.data).reduce(function(
|
|
1366
|
-
return b.indexOf("video_") === 0 ? Object.assign(
|
|
1370
|
+
P(this, a), v(this, "_lastEventTime", void 0), e.on("before*", function(r, i) {
|
|
1371
|
+
var n = i.viewer_time, s = I.now(), u = t._lastEventTime;
|
|
1372
|
+
if (t._lastEventTime = s, u && s - u > ti) {
|
|
1373
|
+
var d = Object.keys(e.data).reduce(function(m, b) {
|
|
1374
|
+
return b.indexOf("video_") === 0 ? Object.assign(m, v({}, b, e.data[b])) : m;
|
|
1367
1375
|
}, {});
|
|
1368
1376
|
e.mux.log.info("Received event after at least an hour inactivity, creating a new view");
|
|
1369
|
-
var
|
|
1370
|
-
e._resetView(Object.assign({ viewer_time: n }, d)), e.playbackHeartbeat._playheadShouldBeProgressing =
|
|
1377
|
+
var l = e.playbackHeartbeat._playheadShouldBeProgressing;
|
|
1378
|
+
e._resetView(Object.assign({ viewer_time: n }, d)), e.playbackHeartbeat._playheadShouldBeProgressing = l, e.playbackHeartbeat._playheadShouldBeProgressing && r.type !== "play" && r.type !== "adbreakstart" && (e.emit("play", { viewer_time: n }), r.type !== "playing" && e.emit("playing", { viewer_time: n }));
|
|
1371
1379
|
}
|
|
1372
1380
|
});
|
|
1373
|
-
},
|
|
1374
|
-
|
|
1381
|
+
}, ii = ai, ri = function a(e) {
|
|
1382
|
+
P(this, a);
|
|
1375
1383
|
var t = function(u) {
|
|
1376
|
-
var d =
|
|
1377
|
-
if (d != null && !
|
|
1378
|
-
n = d,
|
|
1379
|
-
var
|
|
1380
|
-
e.emit("cdnchange",
|
|
1384
|
+
var d = ni(u), l = si(u);
|
|
1385
|
+
if (d != null && !Me(d, n) && s <= l) {
|
|
1386
|
+
n = d, s = l;
|
|
1387
|
+
var m = { video_cdn: d };
|
|
1388
|
+
e.emit("cdnchange", m);
|
|
1381
1389
|
}
|
|
1382
|
-
}, r = null, i = null, n = null,
|
|
1390
|
+
}, r = null, i = null, n = null, s = 0;
|
|
1383
1391
|
e.on("viewinit", function() {
|
|
1384
|
-
r = null, i = null, n = null,
|
|
1392
|
+
r = null, i = null, n = null, s = 0;
|
|
1385
1393
|
}), e.on("beforecdnchange", function(u, d) {
|
|
1386
|
-
var
|
|
1387
|
-
|
|
1394
|
+
var l = d?.video_cdn;
|
|
1395
|
+
l && (typeof d.video_previous_cdn > "u" || d.video_previous_cdn === null) && (Me(l, i) ? d.video_previous_cdn = r ?? void 0 : (d.video_previous_cdn = i ?? void 0, r = i, i = l));
|
|
1388
1396
|
}), e.on("requestcompleted", function(u, d) {
|
|
1389
1397
|
t(d);
|
|
1390
1398
|
});
|
|
1391
1399
|
};
|
|
1392
|
-
function
|
|
1400
|
+
function Me(a, e) {
|
|
1393
1401
|
return a?.toLowerCase() === e?.toLowerCase();
|
|
1394
1402
|
}
|
|
1395
|
-
function
|
|
1403
|
+
function ni(a) {
|
|
1396
1404
|
var e;
|
|
1397
1405
|
return a != null && a.request_type && (a.request_type === "media" || a.request_type === "video") && !((e = a.request_response_headers) === null || e === void 0) && e["x-cdn"] ? a.request_response_headers["x-cdn"] : a != null && a.video_cdn ? a.video_cdn : null;
|
|
1398
1406
|
}
|
|
1399
|
-
function
|
|
1407
|
+
function si(a) {
|
|
1400
1408
|
return a != null && a.request_start ? a.request_start : a != null && a.viewer_time ? a.viewer_time : Date.now();
|
|
1401
1409
|
}
|
|
1402
|
-
var
|
|
1410
|
+
var oi = ri, ui = function(a) {
|
|
1411
|
+
try {
|
|
1412
|
+
return JSON.parse(a), !0;
|
|
1413
|
+
} catch {
|
|
1414
|
+
return !1;
|
|
1415
|
+
}
|
|
1416
|
+
}, di = function a(e) {
|
|
1417
|
+
var t = this;
|
|
1418
|
+
P(this, a), v(this, "_emittingAutomaticEvent", !1), v(this, "_hasInitialized", !1), v(this, "_currentMode", "standard"), e.on("viewstart", function() {
|
|
1419
|
+
t._hasInitialized || (t._hasInitialized = !0, t._currentMode = e.data.player_playback_mode || "standard", t._emittingAutomaticEvent = !0, e.emit("playbackmodechange", { player_playback_mode: t._currentMode, player_playback_mode_data: "{}" }), t._emittingAutomaticEvent = !1);
|
|
1420
|
+
}), e.on("viewend", function() {
|
|
1421
|
+
t._hasInitialized = !1;
|
|
1422
|
+
}), e.on("playbackmodechange", function(r, i) {
|
|
1423
|
+
t._emittingAutomaticEvent || (i.player_playback_mode_data ? ui(i.player_playback_mode_data) || (e.mux.log.warn("Invalid JSON string for player_playback_mode_data"), i.player_playback_mode_data = "{}") : i.player_playback_mode_data = "{}", e.data.player_playback_mode_data = i.player_playback_mode_data, e.data.player_playback_mode = i.player_playback_mode, t._currentMode = i.player_playback_mode);
|
|
1424
|
+
});
|
|
1425
|
+
}, li = di, ci = (function() {
|
|
1426
|
+
function a(e) {
|
|
1427
|
+
P(this, a), v(this, "pm", void 0), v(this, "_currentRangeStart", void 0), v(this, "_lastPlayheadTime", void 0), this.pm = e, this._currentRangeStart = null, this._lastPlayheadTime = null, e.on("playbackheartbeat", this._updatePlaybackRange.bind(this)), e.on("playbackheartbeatend", this._endPlaybackRange.bind(this));
|
|
1428
|
+
}
|
|
1429
|
+
return U(a, [{ key: "_updateLastRangeEnd", value: function() {
|
|
1430
|
+
var e = this.pm.data.video_playback_ranges;
|
|
1431
|
+
if (e && e.length > 0) {
|
|
1432
|
+
var t = this.pm.data.player_playhead_time || 0;
|
|
1433
|
+
e[e.length - 1][1] = t;
|
|
1434
|
+
}
|
|
1435
|
+
} }, { key: "_updatePlaybackRange", value: function() {
|
|
1436
|
+
var e, t = this.pm.data.player_playhead_time || 0;
|
|
1437
|
+
if (!(!this.pm.disableAdPlaybackRangeFiltering && !((e = this.pm.adTracker) === null || e === void 0) && e.isAdBreak && this._lastPlayheadTime !== null && t < this._lastPlayheadTime)) {
|
|
1438
|
+
if (this._lastPlayheadTime !== null && this._currentRangeStart !== null) {
|
|
1439
|
+
var r = Math.abs(t - this._lastPlayheadTime);
|
|
1440
|
+
if (r > 1e3) {
|
|
1441
|
+
var i = this.pm.data.video_playback_ranges;
|
|
1442
|
+
i && i.length > 0 && (i[i.length - 1][1] = this._lastPlayheadTime), this._currentRangeStart = null;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
if (this._currentRangeStart === null) {
|
|
1446
|
+
var n = this.pm.data.video_playback_ranges || [];
|
|
1447
|
+
n.length > 0 && n[n.length - 1][1] === t ? this._currentRangeStart = n[n.length - 1][0] : (this._currentRangeStart = t, n.push([t, t])), this.pm.data.video_playback_ranges = n;
|
|
1448
|
+
} else this._updateLastRangeEnd();
|
|
1449
|
+
this._lastPlayheadTime = t;
|
|
1450
|
+
}
|
|
1451
|
+
} }, { key: "_endPlaybackRange", value: function() {
|
|
1452
|
+
this._currentRangeStart !== null && (this._updateLastRangeEnd(), this._currentRangeStart = null, this._lastPlayheadTime = null);
|
|
1453
|
+
} }]), a;
|
|
1454
|
+
})(), pi = ci, _i = ["viewstart", "ended", "loadstart", "pause", "play", "playing", "ratechange", "waiting", "adplay", "adpause", "adended", "aderror", "adplaying", "adrequest", "adresponse", "adbreakstart", "adbreakend", "adfirstquartile", "admidpoint", "adthirdquartile", "rebufferstart", "rebufferend", "seeked", "error", "hb", "requestcompleted", "requestfailed", "requestcanceled", "renditionchange", "cdnchange", "playbackmodechange"], hi = /* @__PURE__ */ new Set(["requestcompleted", "requestfailed", "requestcanceled"]), fi = (function(a) {
|
|
1403
1455
|
Ht(t, a);
|
|
1404
|
-
var e =
|
|
1456
|
+
var e = Gt(t);
|
|
1405
1457
|
function t(r, i, n) {
|
|
1406
|
-
|
|
1407
|
-
var
|
|
1408
|
-
|
|
1409
|
-
var u = { debug: !1, minimumRebufferDuration: 250, sustainedRebufferThreshold: 1e3, playbackHeartbeatTime: 25, beaconDomain: "litix.io", sampleRate: 1, disableCookies: !1, respectDoNotTrack: !1, disableRebufferTracking: !1, disablePlayheadRebufferTracking: !1, errorTranslator: function(
|
|
1410
|
-
return
|
|
1458
|
+
P(this, t);
|
|
1459
|
+
var s;
|
|
1460
|
+
s = e.call(this), v(T(s), "pageLoadEndTime", void 0), v(T(s), "pageLoadInitTime", void 0), v(T(s), "_destroyed", void 0), v(T(s), "_heartBeatTimeout", void 0), v(T(s), "adTracker", void 0), v(T(s), "dashjs", void 0), v(T(s), "data", void 0), v(T(s), "disablePlayheadRebufferTracking", void 0), v(T(s), "disableRebufferTracking", void 0), v(T(s), "disableAdPlaybackRangeFiltering", void 0), v(T(s), "errorTracker", void 0), v(T(s), "errorTranslator", void 0), v(T(s), "emitTranslator", void 0), v(T(s), "getAdData", void 0), v(T(s), "getPlayheadTime", void 0), v(T(s), "getStateData", void 0), v(T(s), "stateDataTranslator", void 0), v(T(s), "hlsjs", void 0), v(T(s), "id", void 0), v(T(s), "longResumeTracker", void 0), v(T(s), "minimumRebufferDuration", void 0), v(T(s), "mux", void 0), v(T(s), "playbackEventDispatcher", void 0), v(T(s), "playbackHeartbeat", void 0), v(T(s), "playbackHeartbeatTime", void 0), v(T(s), "playheadTime", void 0), v(T(s), "seekingTracker", void 0), v(T(s), "sustainedRebufferThreshold", void 0), v(T(s), "watchTimeTracker", void 0), v(T(s), "currentFragmentPDT", void 0), v(T(s), "currentFragmentStart", void 0), s.pageLoadInitTime = he.navigationStart(), s.pageLoadEndTime = he.domContentLoadedEventEnd();
|
|
1461
|
+
var u = { debug: !1, minimumRebufferDuration: 250, sustainedRebufferThreshold: 1e3, playbackHeartbeatTime: 25, beaconDomain: "litix.io", sampleRate: 1, disableCookies: !1, respectDoNotTrack: !1, disableRebufferTracking: !1, disablePlayheadRebufferTracking: !1, disableAdPlaybackRangeFiltering: !1, errorTranslator: function(c) {
|
|
1462
|
+
return c;
|
|
1411
1463
|
}, emitTranslator: function() {
|
|
1412
|
-
for (var
|
|
1413
|
-
return
|
|
1414
|
-
}, stateDataTranslator: function(
|
|
1415
|
-
return
|
|
1464
|
+
for (var c = arguments.length, o = new Array(c), p = 0; p < c; p++) o[p] = arguments[p];
|
|
1465
|
+
return o;
|
|
1466
|
+
}, stateDataTranslator: function(c) {
|
|
1467
|
+
return c;
|
|
1416
1468
|
} };
|
|
1417
|
-
|
|
1469
|
+
s.mux = r, s.id = i, n != null && n.beaconDomain && s.mux.log.warn("The `beaconDomain` setting has been deprecated in favor of `beaconCollectionDomain`. Please change your integration to use `beaconCollectionDomain` instead of `beaconDomain`."), n = Object.assign(u, n), n.data = n.data || {}, n.data.property_key && (n.data.env_key = n.data.property_key, delete n.data.property_key), q.level = n.debug ? Y.DEBUG : Y.WARN, s.getPlayheadTime = n.getPlayheadTime, s.getStateData = n.getStateData || function() {
|
|
1418
1470
|
return {};
|
|
1419
|
-
},
|
|
1420
|
-
},
|
|
1471
|
+
}, s.getAdData = n.getAdData || function() {
|
|
1472
|
+
}, s.minimumRebufferDuration = n.minimumRebufferDuration, s.sustainedRebufferThreshold = n.sustainedRebufferThreshold, s.playbackHeartbeatTime = n.playbackHeartbeatTime, s.disableRebufferTracking = n.disableRebufferTracking, s.disableRebufferTracking && s.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."), s.disablePlayheadRebufferTracking = n.disablePlayheadRebufferTracking, s.disableAdPlaybackRangeFiltering = n.disableAdPlaybackRangeFiltering, s.errorTranslator = n.errorTranslator, s.emitTranslator = n.emitTranslator, s.stateDataTranslator = n.stateDataTranslator, s.playbackEventDispatcher = new Za(r, n.data.env_key, n), s.data = { player_instance_id: de(), mux_sample_rate: n.sampleRate, beacon_domain: n.beaconCollectionDomain || n.beaconDomain }, s.data.view_sequence_number = 1, s.data.player_sequence_number = 1;
|
|
1421
1473
|
var d = (function() {
|
|
1422
|
-
typeof this.data.view_start > "u" && (this.data.view_start = this.mux.utils.now(), this.emit("viewstart"));
|
|
1423
|
-
}).bind(T(
|
|
1424
|
-
if (
|
|
1425
|
-
this._resetVideoData(), this._resetViewData(), this._resetErrorData(), this._updateStateData(), Object.assign(this.data,
|
|
1426
|
-
}),
|
|
1427
|
-
this._resetView(
|
|
1428
|
-
}),
|
|
1429
|
-
this.data.player_is_paused && this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."), this._resetView(Object.assign(
|
|
1430
|
-
}),
|
|
1431
|
-
this.currentFragmentPDT =
|
|
1432
|
-
}),
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1435
|
-
|
|
1474
|
+
typeof this.data.view_start > "u" && (this.data.view_start = this.mux.utils.now(), this.emit("viewstart"), this.emit("renditionchange"));
|
|
1475
|
+
}).bind(T(s));
|
|
1476
|
+
if (s.on("viewinit", function(c, o) {
|
|
1477
|
+
this._resetVideoData(), this._resetViewData(), this._resetErrorData(), this._updateStateData(), Object.assign(this.data, o), this._initializeViewData(), this.one("play", d), this.one("adbreakstart", d);
|
|
1478
|
+
}), s.on("videochange", function(c, o) {
|
|
1479
|
+
this._resetView(o);
|
|
1480
|
+
}), s.on("programchange", function(c, o) {
|
|
1481
|
+
this.data.player_is_paused && this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."), this._resetView(Object.assign(o, { view_program_changed: !0 })), d(), this.emit("play"), this.emit("playing");
|
|
1482
|
+
}), s.on("fragmentchange", function(c, o) {
|
|
1483
|
+
this.currentFragmentPDT = o.currentFragmentPDT, this.currentFragmentStart = o.currentFragmentStart;
|
|
1484
|
+
}), s.on("destroy", s.destroy), typeof window < "u" && typeof window.addEventListener == "function" && typeof window.removeEventListener == "function") {
|
|
1485
|
+
var l = function() {
|
|
1486
|
+
var c = typeof s.data.view_start < "u";
|
|
1487
|
+
s.mux.WINDOW_HIDDEN = document.visibilityState === "hidden", c && s.mux.WINDOW_HIDDEN && (s.data.player_is_paused || s.emit("hb"));
|
|
1436
1488
|
};
|
|
1437
|
-
window.addEventListener("visibilitychange",
|
|
1438
|
-
var
|
|
1439
|
-
|
|
1489
|
+
window.addEventListener("visibilitychange", l, !1);
|
|
1490
|
+
var m = function(c) {
|
|
1491
|
+
c.persisted || s.destroy();
|
|
1440
1492
|
};
|
|
1441
|
-
window.addEventListener("pagehide",
|
|
1442
|
-
window.removeEventListener("visibilitychange",
|
|
1493
|
+
window.addEventListener("pagehide", m, !1), s.on("destroy", function() {
|
|
1494
|
+
window.removeEventListener("visibilitychange", l), window.removeEventListener("pagehide", m);
|
|
1443
1495
|
});
|
|
1444
1496
|
}
|
|
1445
|
-
|
|
1446
|
-
Object.assign(this.data,
|
|
1447
|
-
}),
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
}),
|
|
1451
|
-
(
|
|
1497
|
+
s.on("playerready", function(c, o) {
|
|
1498
|
+
Object.assign(this.data, o);
|
|
1499
|
+
}), _i.forEach(function(c) {
|
|
1500
|
+
s.on(c, function(o, p) {
|
|
1501
|
+
c.indexOf("ad") !== 0 && this._updateStateData(), Object.assign(this.data, p), this._sanitizeData();
|
|
1502
|
+
}), s.on("after" + c, function() {
|
|
1503
|
+
(c !== "error" || this.errorTracker.viewErrored) && this.send(c);
|
|
1452
1504
|
});
|
|
1453
|
-
}),
|
|
1454
|
-
Object.assign(
|
|
1505
|
+
}), s.on("viewend", function(c, o) {
|
|
1506
|
+
Object.assign(s.data, o);
|
|
1455
1507
|
});
|
|
1456
|
-
var b = function(
|
|
1457
|
-
var
|
|
1458
|
-
this.data.player_init_time && (this.data.player_startup_time =
|
|
1508
|
+
var b = function(c) {
|
|
1509
|
+
var o = this.mux.utils.now();
|
|
1510
|
+
this.data.player_init_time && (this.data.player_startup_time = o - this.data.player_init_time), this.pageLoadInitTime = this.data.page_load_init_time || this.pageLoadInitTime, this.pageLoadEndTime = this.data.page_load_end_time || this.pageLoadEndTime, !this.mux.PLAYER_TRACKED && this.pageLoadInitTime && (this.mux.PLAYER_TRACKED = !0, (this.data.player_init_time || this.pageLoadEndTime) && (this.data.page_load_time = Math.min(this.data.player_init_time || 1 / 0, this.pageLoadEndTime || 1 / 0) - this.pageLoadInitTime)), this.send("playerready"), delete this.data.player_startup_time, delete this.data.page_load_time;
|
|
1459
1511
|
};
|
|
1460
|
-
return
|
|
1512
|
+
return s.one("playerready", b), s.longResumeTracker = new ii(T(s)), s.errorTracker = new oa(T(s)), new Aa(T(s)), s.seekingTracker = new Ea(T(s)), s.playheadTime = new _a(T(s)), s.playbackHeartbeat = new na(T(s)), new wa(T(s)), s.watchTimeTracker = new da(T(s)), new ca(T(s)), new pi(T(s)), s.adTracker = new Ra(T(s)), new ma(T(s)), new fa(T(s)), new ga(T(s)), new ei(T(s)), new oi(T(s)), new li(T(s)), n.hlsjs && s.addHLSJS(n), n.dashjs && s.addDashJS(n), s.emit("viewinit", n.data), s;
|
|
1461
1513
|
}
|
|
1462
|
-
return
|
|
1463
|
-
var n,
|
|
1514
|
+
return U(t, [{ key: "emit", value: function(r, i) {
|
|
1515
|
+
var n, s = Object.assign({ viewer_time: this.mux.utils.now() }, i), u = [r, s];
|
|
1464
1516
|
if (this.emitTranslator) try {
|
|
1465
|
-
u = this.emitTranslator(r,
|
|
1517
|
+
u = this.emitTranslator(r, s);
|
|
1466
1518
|
} catch (d) {
|
|
1467
1519
|
this.mux.log.warn("Exception in emit translator callback.", d);
|
|
1468
1520
|
}
|
|
1469
|
-
u != null && u.length && (n =
|
|
1521
|
+
u != null && u.length && (n = pe(te(t.prototype), "emit", this)).call.apply(n, [this].concat(B(u)));
|
|
1470
1522
|
} }, { key: "destroy", value: function() {
|
|
1471
1523
|
this._destroyed || (this._destroyed = !0, typeof this.data.view_start < "u" && (this.emit("viewend"), this.send("viewend")), this.playbackEventDispatcher.destroy(), this.removeHLSJS(), this.removeDashJS(), window.clearTimeout(this._heartBeatTimeout));
|
|
1472
1524
|
} }, { key: "send", value: function(r) {
|
|
1473
1525
|
if (this.data.view_id) {
|
|
1474
1526
|
var i = Object.assign({}, this.data), n = ["player_program_time", "player_manifest_newest_program_time", "player_live_edge_program_time", "player_program_time", "video_holdback", "video_part_holdback", "video_target_duration", "video_part_target_duration"];
|
|
1475
|
-
if (i.video_source_is_live === void 0 && (i.player_source_duration === 1 / 0 || i.video_source_duration === 1 / 0 ? i.video_source_is_live = !0 : (i.player_source_duration > 0 || i.video_source_duration > 0) && (i.video_source_is_live = !1)), i.video_source_is_live || n.forEach(function(
|
|
1476
|
-
i[
|
|
1527
|
+
if (i.video_source_is_live === void 0 && (i.player_source_duration === 1 / 0 || i.video_source_duration === 1 / 0 ? i.video_source_is_live = !0 : (i.player_source_duration > 0 || i.video_source_duration > 0) && (i.video_source_is_live = !1)), i.video_source_is_live || n.forEach(function(l) {
|
|
1528
|
+
i[l] = void 0;
|
|
1477
1529
|
}), i.video_source_url = i.video_source_url || i.player_source_url, i.video_source_url) {
|
|
1478
|
-
var
|
|
1530
|
+
var s = Q(le(i.video_source_url), 2), u = s[0], d = s[1];
|
|
1479
1531
|
i.video_source_domain = d, i.video_source_hostname = u;
|
|
1480
1532
|
}
|
|
1481
|
-
delete i.ad_request_id,
|
|
1533
|
+
delete i.ad_request_id, i.video_playback_ranges && (i.video_playback_range = JSON.stringify(i.video_playback_ranges.filter(function(l) {
|
|
1534
|
+
return l[0] !== l[1];
|
|
1535
|
+
}).map(function(l) {
|
|
1536
|
+
return "".concat(l[0], ":").concat(l[1]);
|
|
1537
|
+
})), delete i.video_playback_ranges), this.playbackEventDispatcher.send(r, i), this.data.view_sequence_number++, this.data.player_sequence_number++, hi.has(r) || this._restartHeartBeat(), r === "viewend" && delete this.data.view_id;
|
|
1482
1538
|
}
|
|
1483
1539
|
} }, { key: "_resetView", value: function(r) {
|
|
1484
1540
|
this.emit("viewend"), this.send("viewend"), this.emit("viewinit", r);
|
|
@@ -1486,26 +1542,26 @@ var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing"
|
|
|
1486
1542
|
var r, i = this.getStateData();
|
|
1487
1543
|
if (typeof this.stateDataTranslator == "function") try {
|
|
1488
1544
|
i = this.stateDataTranslator(i);
|
|
1489
|
-
} catch (
|
|
1490
|
-
this.mux.log.warn("Exception in stateDataTranslator translator callback.",
|
|
1545
|
+
} catch (s) {
|
|
1546
|
+
this.mux.log.warn("Exception in stateDataTranslator translator callback.", s);
|
|
1491
1547
|
}
|
|
1492
1548
|
if (!((r = this.data) === null || r === void 0) && r.video_cdn && i != null && i.video_cdn) {
|
|
1493
1549
|
i.video_cdn;
|
|
1494
|
-
var n =
|
|
1550
|
+
var n = Mt(i, ["video_cdn"]);
|
|
1495
1551
|
i = n;
|
|
1496
1552
|
}
|
|
1497
1553
|
Object.assign(this.data, i), this.playheadTime._updatePlayheadTime(), this._sanitizeData();
|
|
1498
1554
|
} }, { key: "_sanitizeData", value: function() {
|
|
1499
1555
|
var r = this, i = ["player_width", "player_height", "video_source_width", "video_source_height", "player_playhead_time", "video_source_bitrate"];
|
|
1500
|
-
i.forEach(function(
|
|
1501
|
-
var u = parseInt(r.data[
|
|
1502
|
-
r.data[
|
|
1556
|
+
i.forEach(function(s) {
|
|
1557
|
+
var u = parseInt(r.data[s], 10);
|
|
1558
|
+
r.data[s] = isNaN(u) ? void 0 : u;
|
|
1503
1559
|
});
|
|
1504
1560
|
var n = ["player_source_url", "video_source_url"];
|
|
1505
|
-
n.forEach(function(
|
|
1506
|
-
if (r.data[
|
|
1507
|
-
var u = r.data[
|
|
1508
|
-
(u.indexOf("data:") === 0 || u.indexOf("blob:") === 0) && (r.data[
|
|
1561
|
+
n.forEach(function(s) {
|
|
1562
|
+
if (r.data[s]) {
|
|
1563
|
+
var u = r.data[s].toLowerCase();
|
|
1564
|
+
(u.indexOf("data:") === 0 || u.indexOf("blob:") === 0) && (r.data[s] = "MSE style URL");
|
|
1509
1565
|
}
|
|
1510
1566
|
});
|
|
1511
1567
|
} }, { key: "_resetVideoData", value: function() {
|
|
@@ -1522,7 +1578,7 @@ var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing"
|
|
|
1522
1578
|
delete this.data.player_error_code, delete this.data.player_error_message, delete this.data.player_error_context, delete this.data.player_error_severity, delete this.data.player_error_business_exception;
|
|
1523
1579
|
} }, { key: "_initializeViewData", value: function() {
|
|
1524
1580
|
var r = this, i = this.data.view_id = de(), n = function() {
|
|
1525
|
-
i === r.data.view_id &&
|
|
1581
|
+
i === r.data.view_id && L(r.data, "player_view_count", 1);
|
|
1526
1582
|
};
|
|
1527
1583
|
this.data.player_is_paused ? this.one("play", n) : n();
|
|
1528
1584
|
} }, { key: "_restartHeartBeat", value: function() {
|
|
@@ -1555,21 +1611,21 @@ var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing"
|
|
|
1555
1611
|
} }, { key: "removeDashJS", value: function() {
|
|
1556
1612
|
this.dashjs && (ta(this.dashjs), this.dashjs = void 0);
|
|
1557
1613
|
} }]), t;
|
|
1558
|
-
})(
|
|
1559
|
-
function
|
|
1560
|
-
return
|
|
1614
|
+
})(ia), vi = fi, se = j(Ye());
|
|
1615
|
+
function xe() {
|
|
1616
|
+
return se.default && !!(se.default.fullscreenElement || se.default.webkitFullscreenElement || se.default.mozFullScreenElement || se.default.msFullscreenElement);
|
|
1561
1617
|
}
|
|
1562
|
-
var
|
|
1563
|
-
function
|
|
1564
|
-
var r = Q(
|
|
1618
|
+
var mi = ["loadstart", "pause", "play", "playing", "seeking", "seeked", "timeupdate", "ratechange", "stalled", "waiting", "error", "ended"], yi = { 1: "MEDIA_ERR_ABORTED", 2: "MEDIA_ERR_NETWORK", 3: "MEDIA_ERR_DECODE", 4: "MEDIA_ERR_SRC_NOT_SUPPORTED" };
|
|
1619
|
+
function gi(a, e, t) {
|
|
1620
|
+
var r = Q(_e(e), 3), i = r[0], n = r[1], s = r[2], u = a.log, d = a.utils.getComputedStyle, l = a.utils.secondsToMs, m = { automaticErrorTracking: !0 };
|
|
1565
1621
|
if (i) {
|
|
1566
|
-
if (
|
|
1622
|
+
if (s !== "video" && s !== "audio") return u.error("The element of `" + n + "` was not a media element.");
|
|
1567
1623
|
} else return u.error("No element was found with the `" + n + "` query selector.");
|
|
1568
1624
|
i.mux && (i.mux.destroy(), delete i.mux, u.warn("Already monitoring this video element, replacing existing event listeners"));
|
|
1569
1625
|
var b = { getPlayheadTime: function() {
|
|
1570
|
-
return
|
|
1626
|
+
return l(i.currentTime);
|
|
1571
1627
|
}, getStateData: function() {
|
|
1572
|
-
var
|
|
1628
|
+
var o, p, y, f = ((o = (p = this).getPlayheadTime) === null || o === void 0 ? void 0 : o.call(p)) || l(i.currentTime), g = this.hlsjs && this.hlsjs.url, _ = this.dashjs && typeof this.dashjs.getSource == "function" && this.dashjs.getSource(), h = { player_is_paused: i.paused, player_width: parseInt(d(i, "width")), player_height: parseInt(d(i, "height")), player_autoplay_on: i.autoplay, player_preload_on: i.preload, player_language_code: i.lang, player_is_fullscreen: xe(), video_poster_url: i.poster, video_source_url: g || _ || i.currentSrc, video_source_duration: l(i.duration), video_source_height: i.videoHeight, video_source_width: i.videoWidth, view_dropped_frame_count: i == null || (y = i.getVideoPlaybackQuality) === null || y === void 0 ? void 0 : y.call(i).droppedVideoFrames };
|
|
1573
1629
|
if (i.getStartDate && f > 0) {
|
|
1574
1630
|
var w = i.getStartDate();
|
|
1575
1631
|
if (w && typeof w.getTime == "function" && w.getTime()) {
|
|
@@ -1582,52 +1638,64 @@ function mr(a, e, t) {
|
|
|
1582
1638
|
}
|
|
1583
1639
|
return h;
|
|
1584
1640
|
} };
|
|
1585
|
-
t = Object.assign(
|
|
1586
|
-
a.emit(n,
|
|
1587
|
-
}, i.mux.updateData = function(
|
|
1588
|
-
i.mux.emit("hb",
|
|
1641
|
+
t = Object.assign(m, t, b), t.data = Object.assign({ player_software: "HTML5 Video Element", player_mux_plugin_name: "VideoElementMonitor", player_mux_plugin_version: a.VERSION }, t.data), i.mux = i.mux || {}, i.mux.deleted = !1, i.mux.emit = function(o, p) {
|
|
1642
|
+
a.emit(n, o, p);
|
|
1643
|
+
}, i.mux.updateData = function(o) {
|
|
1644
|
+
i.mux.emit("hb", o);
|
|
1589
1645
|
};
|
|
1590
|
-
var
|
|
1646
|
+
var c = function() {
|
|
1591
1647
|
u.error("The monitor for this video element has already been destroyed.");
|
|
1592
1648
|
};
|
|
1593
1649
|
i.mux.destroy = function() {
|
|
1594
|
-
Object.keys(i.mux.listeners).forEach(function(
|
|
1595
|
-
i.removeEventListener(
|
|
1596
|
-
}), delete i.mux.listeners, i.mux.destroy =
|
|
1597
|
-
}, i.mux.swapElement = function(
|
|
1598
|
-
var
|
|
1650
|
+
Object.keys(i.mux.listeners).forEach(function(o) {
|
|
1651
|
+
i.removeEventListener(o, i.mux.listeners[o], !1);
|
|
1652
|
+
}), delete i.mux.listeners, i.mux.fullscreenChangeListener && (document.removeEventListener("fullscreenchange", i.mux.fullscreenChangeListener, !1), delete i.mux.fullscreenChangeListener), i.mux.destroy = c, i.mux.swapElement = c, i.mux.emit = c, i.mux.addHLSJS = c, i.mux.addDashJS = c, i.mux.removeHLSJS = c, i.mux.removeDashJS = c, i.mux.updateData = c, i.mux.setEmitTranslator = c, i.mux.setStateDataTranslator = c, i.mux.setGetPlayheadTime = c, i.mux.deleted = !0, a.emit(n, "destroy");
|
|
1653
|
+
}, i.mux.swapElement = function(o) {
|
|
1654
|
+
var p = Q(_e(o), 3), y = p[0], f = p[1], g = p[2];
|
|
1599
1655
|
if (y) {
|
|
1600
1656
|
if (g !== "video" && g !== "audio") return a.log.error("The element of `" + f + "` was not a media element.");
|
|
1601
1657
|
} else return a.log.error("No element was found with the `" + f + "` query selector.");
|
|
1602
|
-
y.muxId = i.muxId, delete i.muxId, y.mux = y.mux || {}, y.mux.listeners = Object.assign({}, i.mux.listeners), delete i.mux.listeners, Object.keys(y.mux.listeners).forEach(function(
|
|
1603
|
-
i.removeEventListener(
|
|
1604
|
-
}), y.mux.swapElement = i.mux.swapElement, y.mux.destroy = i.mux.destroy, delete i.mux, i = y;
|
|
1605
|
-
}, i.mux.addHLSJS = function(
|
|
1606
|
-
a.addHLSJS(n,
|
|
1607
|
-
}, i.mux.addDashJS = function(
|
|
1608
|
-
a.addDashJS(n,
|
|
1658
|
+
y.muxId = i.muxId, delete i.muxId, y.mux = y.mux || {}, y.mux.listeners = Object.assign({}, i.mux.listeners), delete i.mux.listeners, Object.keys(y.mux.listeners).forEach(function(_) {
|
|
1659
|
+
i.removeEventListener(_, y.mux.listeners[_], !1), y.addEventListener(_, y.mux.listeners[_], !1);
|
|
1660
|
+
}), y.mux.fullscreenChangeListener = i.mux.fullscreenChangeListener, delete i.mux.fullscreenChangeListener, y.mux.swapElement = i.mux.swapElement, y.mux.destroy = i.mux.destroy, delete i.mux, i = y;
|
|
1661
|
+
}, i.mux.addHLSJS = function(o) {
|
|
1662
|
+
a.addHLSJS(n, o);
|
|
1663
|
+
}, i.mux.addDashJS = function(o) {
|
|
1664
|
+
a.addDashJS(n, o);
|
|
1609
1665
|
}, i.mux.removeHLSJS = function() {
|
|
1610
1666
|
a.removeHLSJS(n);
|
|
1611
1667
|
}, i.mux.removeDashJS = function() {
|
|
1612
1668
|
a.removeDashJS(n);
|
|
1613
|
-
}, i.mux.setEmitTranslator = function(
|
|
1614
|
-
a.setEmitTranslator(n,
|
|
1615
|
-
}, i.mux.setStateDataTranslator = function(
|
|
1616
|
-
a.setStateDataTranslator(n,
|
|
1617
|
-
}, i.mux.setGetPlayheadTime = function(
|
|
1618
|
-
|
|
1619
|
-
}, a.init(n, t), a.emit(n, "playerready"), i.paused || (a.emit(n, "play"), i.readyState > 2 && a.emit(n, "playing")), i.mux.listeners = {},
|
|
1620
|
-
|
|
1621
|
-
var
|
|
1622
|
-
if (
|
|
1669
|
+
}, i.mux.setEmitTranslator = function(o) {
|
|
1670
|
+
a.setEmitTranslator(n, o);
|
|
1671
|
+
}, i.mux.setStateDataTranslator = function(o) {
|
|
1672
|
+
a.setStateDataTranslator(n, o);
|
|
1673
|
+
}, i.mux.setGetPlayheadTime = function(o) {
|
|
1674
|
+
o || (o = t.getPlayheadTime), a.setGetPlayheadTime(n, o);
|
|
1675
|
+
}, a.init(n, t), a.emit(n, "playerready"), i.paused || (a.emit(n, "play"), i.readyState > 2 && a.emit(n, "playing")), i.mux.listeners = {}, mi.forEach(function(o) {
|
|
1676
|
+
o === "error" && !t.automaticErrorTracking || (i.mux.listeners[o] = function() {
|
|
1677
|
+
var p = {};
|
|
1678
|
+
if (o === "error") {
|
|
1623
1679
|
if (!i.error || i.error.code === 1) return;
|
|
1624
|
-
|
|
1680
|
+
p.player_error_code = i.error.code, p.player_error_message = yi[i.error.code] || i.error.message;
|
|
1625
1681
|
}
|
|
1626
|
-
a.emit(n,
|
|
1627
|
-
}, i.addEventListener(
|
|
1628
|
-
})
|
|
1682
|
+
a.emit(n, o, p);
|
|
1683
|
+
}, i.addEventListener(o, i.mux.listeners[o], !1));
|
|
1684
|
+
}), i.mux.listeners.enterpictureinpicture = function() {
|
|
1685
|
+
a.emit(n, "playbackmodechange", { player_playback_mode: "pip", player_playback_mode_data: "{}" });
|
|
1686
|
+
}, i.mux.listeners.leavepictureinpicture = function() {
|
|
1687
|
+
var o = xe() ? "fullscreen" : "standard";
|
|
1688
|
+
a.emit(n, "playbackmodechange", { player_playback_mode: o, player_playback_mode_data: "{}" });
|
|
1689
|
+
}, i.addEventListener("enterpictureinpicture", i.mux.listeners.enterpictureinpicture, !1), i.addEventListener("leavepictureinpicture", i.mux.listeners.leavepictureinpicture, !1), i.mux.fullscreenChangeListener = function() {
|
|
1690
|
+
var o = xe(), p = document.fullscreenElement;
|
|
1691
|
+
if (o && (p === i || p != null && p.contains(i))) a.emit(n, "playbackmodechange", { player_playback_mode: "fullscreen", player_playback_mode_data: "{}" });
|
|
1692
|
+
else if (!o) {
|
|
1693
|
+
var y = document.pictureInPictureElement === i, f = y ? "pip" : "standard";
|
|
1694
|
+
a.emit(n, "playbackmodechange", { player_playback_mode: f, player_playback_mode_data: "{}" });
|
|
1695
|
+
}
|
|
1696
|
+
}, document.addEventListener("fullscreenchange", i.mux.fullscreenChangeListener, !1);
|
|
1629
1697
|
}
|
|
1630
|
-
function
|
|
1698
|
+
function bi(a, e, t, r) {
|
|
1631
1699
|
var i = r;
|
|
1632
1700
|
if (a && typeof a[e] == "function") try {
|
|
1633
1701
|
i = a[e].apply(a, t);
|
|
@@ -1636,14 +1704,14 @@ function yr(a, e, t, r) {
|
|
|
1636
1704
|
}
|
|
1637
1705
|
return i;
|
|
1638
1706
|
}
|
|
1639
|
-
var ue =
|
|
1707
|
+
var ue = j(G()), ee;
|
|
1640
1708
|
ue.default && ue.default.WeakMap && (ee = /* @__PURE__ */ new WeakMap());
|
|
1641
|
-
function
|
|
1709
|
+
function wi(a, e) {
|
|
1642
1710
|
if (!a || !e || !ue.default || typeof ue.default.getComputedStyle != "function") return "";
|
|
1643
1711
|
var t;
|
|
1644
1712
|
return ee && ee.has(a) && (t = ee.get(a)), t || (t = ue.default.getComputedStyle(a, null), ee && ee.set(a, t)), t.getPropertyValue(e);
|
|
1645
1713
|
}
|
|
1646
|
-
function
|
|
1714
|
+
function Ti(a) {
|
|
1647
1715
|
return Math.floor(a * 1e3);
|
|
1648
1716
|
}
|
|
1649
1717
|
var K = { TARGET_DURATION: "#EXT-X-TARGETDURATION", PART_INF: "#EXT-X-PART-INF", SERVER_CONTROL: "#EXT-X-SERVER-CONTROL", INF: "#EXTINF", PROGRAM_DATE_TIME: "#EXT-X-PROGRAM-DATE-TIME", VERSION: "#EXT-X-VERSION", SESSION_DATA: "#EXT-X-SESSION-DATA" }, me = function(a) {
|
|
@@ -1656,7 +1724,7 @@ me.prototype.process = function(a) {
|
|
|
1656
1724
|
`)) this.processLine(this.buffer.substring(0, e)), this.buffer = this.buffer.substring(e + 1);
|
|
1657
1725
|
};
|
|
1658
1726
|
me.prototype.processLine = function(a) {
|
|
1659
|
-
var e = a.indexOf(":"), t =
|
|
1727
|
+
var e = a.indexOf(":"), t = Di(a, e), r = t[0], i = t.length === 2 ? Le(t[1]) : void 0;
|
|
1660
1728
|
if (r[0] !== "#") this.currentUri.uri = r, this.manifest.segments.push(this.currentUri), this.manifest.targetDuration && !("duration" in this.currentUri) && (this.currentUri.duration = this.manifest.targetDuration), this.currentUri = {};
|
|
1661
1729
|
else switch (r) {
|
|
1662
1730
|
case K.TARGET_DURATION: {
|
|
@@ -1665,11 +1733,11 @@ me.prototype.processLine = function(a) {
|
|
|
1665
1733
|
break;
|
|
1666
1734
|
}
|
|
1667
1735
|
case K.PART_INF: {
|
|
1668
|
-
|
|
1736
|
+
De(this.manifest, t), this.manifest.partInf.partTarget && (this.manifest.partTargetDuration = this.manifest.partInf.partTarget), this.setHoldBack();
|
|
1669
1737
|
break;
|
|
1670
1738
|
}
|
|
1671
1739
|
case K.SERVER_CONTROL: {
|
|
1672
|
-
|
|
1740
|
+
De(this.manifest, t), this.setHoldBack();
|
|
1673
1741
|
break;
|
|
1674
1742
|
}
|
|
1675
1743
|
case K.INF: {
|
|
@@ -1677,16 +1745,16 @@ me.prototype.processLine = function(a) {
|
|
|
1677
1745
|
break;
|
|
1678
1746
|
}
|
|
1679
1747
|
case K.PROGRAM_DATE_TIME: {
|
|
1680
|
-
var n = i,
|
|
1681
|
-
this.manifest.dateTimeString || (this.manifest.dateTimeString = n, this.manifest.dateTimeObject =
|
|
1748
|
+
var n = i, s = new Date(n);
|
|
1749
|
+
this.manifest.dateTimeString || (this.manifest.dateTimeString = n, this.manifest.dateTimeObject = s), this.currentUri.dateTimeString = n, this.currentUri.dateTimeObject = s;
|
|
1682
1750
|
break;
|
|
1683
1751
|
}
|
|
1684
1752
|
case K.VERSION: {
|
|
1685
|
-
|
|
1753
|
+
De(this.manifest, t);
|
|
1686
1754
|
break;
|
|
1687
1755
|
}
|
|
1688
1756
|
case K.SESSION_DATA: {
|
|
1689
|
-
var u =
|
|
1757
|
+
var u = Ri(t[1]), d = et(u);
|
|
1690
1758
|
Object.assign(this.manifest.sessionData, d);
|
|
1691
1759
|
}
|
|
1692
1760
|
}
|
|
@@ -1694,57 +1762,57 @@ me.prototype.processLine = function(a) {
|
|
|
1694
1762
|
me.prototype.setHoldBack = function() {
|
|
1695
1763
|
var a = this.manifest, e = a.serverControl, t = a.targetDuration, r = a.partTargetDuration;
|
|
1696
1764
|
if (e) {
|
|
1697
|
-
var i = "holdBack", n = "partHoldBack",
|
|
1698
|
-
t && !e.hasOwnProperty(i) && (e[i] =
|
|
1765
|
+
var i = "holdBack", n = "partHoldBack", s = t && t * 3, u = r && r * 2;
|
|
1766
|
+
t && !e.hasOwnProperty(i) && (e[i] = s), s && e[i] < s && (e[i] = s), r && !e.hasOwnProperty(n) && (e[n] = r * 3), r && e[n] < u && (e[n] = u);
|
|
1699
1767
|
}
|
|
1700
1768
|
};
|
|
1701
|
-
var
|
|
1769
|
+
var De = function(a, e) {
|
|
1702
1770
|
var t = dt(e[0].replace("#EXT-X-", "")), r;
|
|
1703
|
-
|
|
1771
|
+
xi(e[1]) ? (r = {}, r = Object.assign(Ei(e[1]), r)) : r = Le(e[1]), a[t] = r;
|
|
1704
1772
|
}, dt = function(a) {
|
|
1705
1773
|
return a.toLowerCase().replace(/-(\w)/g, function(e) {
|
|
1706
1774
|
return e[1].toUpperCase();
|
|
1707
1775
|
});
|
|
1708
|
-
},
|
|
1776
|
+
}, Le = function(a) {
|
|
1709
1777
|
if (a.toLowerCase() === "yes" || a.toLowerCase() === "no") return a.toLowerCase() === "yes";
|
|
1710
1778
|
var e = a.indexOf(":") !== -1 ? a : parseFloat(a);
|
|
1711
1779
|
return isNaN(e) ? a : e;
|
|
1712
|
-
},
|
|
1780
|
+
}, ki = function(a) {
|
|
1713
1781
|
var e = {}, t = a.split("=");
|
|
1714
1782
|
if (t.length > 1) {
|
|
1715
1783
|
var r = dt(t[0]);
|
|
1716
|
-
e[r] =
|
|
1784
|
+
e[r] = Le(t[1]);
|
|
1717
1785
|
}
|
|
1718
1786
|
return e;
|
|
1719
|
-
},
|
|
1787
|
+
}, Ei = function(a) {
|
|
1720
1788
|
for (var e = a.split(","), t = {}, r = 0; e.length > r; r++) {
|
|
1721
|
-
var i = e[r], n =
|
|
1789
|
+
var i = e[r], n = ki(i);
|
|
1722
1790
|
t = Object.assign(n, t);
|
|
1723
1791
|
}
|
|
1724
1792
|
return t;
|
|
1725
|
-
},
|
|
1793
|
+
}, xi = function(a) {
|
|
1726
1794
|
return a.indexOf("=") > -1;
|
|
1727
|
-
},
|
|
1795
|
+
}, Di = function(a, e) {
|
|
1728
1796
|
return e === -1 ? [a] : [a.substring(0, e), a.substring(e + 1)];
|
|
1729
|
-
},
|
|
1797
|
+
}, Ri = function(a) {
|
|
1730
1798
|
var e = {};
|
|
1731
1799
|
if (a) {
|
|
1732
1800
|
var t = a.search(","), r = a.slice(0, t), i = a.slice(t + 1), n = [r, i];
|
|
1733
|
-
return n.forEach(function(
|
|
1734
|
-
for (var d =
|
|
1801
|
+
return n.forEach(function(s, u) {
|
|
1802
|
+
for (var d = s.replace(/['"]+/g, "").split("="), l = 0; l < d.length; l++) d[l] === "DATA-ID" && (e["DATA-ID"] = d[1 - l]), d[l] === "VALUE" && (e.VALUE = d[1 - l]);
|
|
1735
1803
|
}), { data: e };
|
|
1736
1804
|
}
|
|
1737
|
-
},
|
|
1805
|
+
}, qi = me, Ai = { safeCall: bi, safeIncrement: L, getComputedStyle: wi, secondsToMs: Ti, assign: Object.assign, headersStringToObject: Pe, cdnHeadersToRequestId: ve, extractHostnameAndDomain: le, extractHostname: M, manifestParser: qi, generateShortID: Ze, generateUUID: de, now: I.now, findMediaElement: _e }, Si = Ai, Oi = { PLAYER_READY: "playerready", VIEW_INIT: "viewinit", VIDEO_CHANGE: "videochange", PLAY: "play", PAUSE: "pause", PLAYING: "playing", TIME_UPDATE: "timeupdate", SEEKING: "seeking", SEEKED: "seeked", REBUFFER_START: "rebufferstart", REBUFFER_END: "rebufferend", ERROR: "error", ENDED: "ended", RENDITION_CHANGE: "renditionchange", ORIENTATION_CHANGE: "orientationchange", PLAYBACK_MODE_CHANGE: "playbackmodechange", AD_REQUEST: "adrequest", AD_RESPONSE: "adresponse", AD_BREAK_START: "adbreakstart", AD_PLAY: "adplay", AD_PLAYING: "adplaying", AD_PAUSE: "adpause", AD_FIRST_QUARTILE: "adfirstquartile", AD_MID_POINT: "admidpoint", AD_THIRD_QUARTILE: "adthirdquartile", AD_ENDED: "adended", AD_BREAK_END: "adbreakend", AD_ERROR: "aderror", REQUEST_COMPLETED: "requestcompleted", REQUEST_FAILED: "requestfailed", REQUEST_CANCELLED: "requestcanceled", HEARTBEAT: "hb", DESTROY: "destroy" }, Pi = Oi, Li = "mux-embed", Ii = "5.17.10", Ni = "2.1", O = {}, J = function(a) {
|
|
1738
1806
|
var e = arguments;
|
|
1739
|
-
typeof a == "string" ? J.hasOwnProperty(a) ?
|
|
1807
|
+
typeof a == "string" ? J.hasOwnProperty(a) ? oe.default.setTimeout(function() {
|
|
1740
1808
|
e = Array.prototype.splice.call(e, 1), J[a].apply(null, e);
|
|
1741
|
-
}, 0) : q.warn("`" + a + "` is an unknown task") : typeof a == "function" ?
|
|
1809
|
+
}, 0) : q.warn("`" + a + "` is an unknown task") : typeof a == "function" ? oe.default.setTimeout(function() {
|
|
1742
1810
|
a(J);
|
|
1743
1811
|
}, 0) : q.warn("`" + a + "` is invalid.");
|
|
1744
|
-
},
|
|
1745
|
-
return
|
|
1812
|
+
}, Ci = { loaded: I.now(), NAME: Li, VERSION: Ii, API_VERSION: Ni, PLAYER_TRACKED: !1, monitor: function(a, e) {
|
|
1813
|
+
return gi(J, a, e);
|
|
1746
1814
|
}, destroyMonitor: function(a) {
|
|
1747
|
-
var e = Q(
|
|
1815
|
+
var e = Q(_e(a), 1), t = e[0];
|
|
1748
1816
|
t && t.mux && typeof t.mux.destroy == "function" ? t.mux.destroy() : q.error("A video element monitor for `" + a + "` has not been initialized via `mux.monitor`.");
|
|
1749
1817
|
}, addHLSJS: function(a, e) {
|
|
1750
1818
|
var t = H(a);
|
|
@@ -1761,7 +1829,7 @@ var xe = function(a, e) {
|
|
|
1761
1829
|
}, init: function(a, e) {
|
|
1762
1830
|
qe() && e && e.respectDoNotTrack && q.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");
|
|
1763
1831
|
var t = H(a);
|
|
1764
|
-
O[t] = new
|
|
1832
|
+
O[t] = new vi(J, t, e);
|
|
1765
1833
|
}, emit: function(a, e, t) {
|
|
1766
1834
|
var r = H(a);
|
|
1767
1835
|
O[r] ? (O[r].emit(e, t), e === "destroy" && delete O[r]) : q.error("A monitor for `" + r + "` has not been initialized.");
|
|
@@ -1777,12 +1845,12 @@ var xe = function(a, e) {
|
|
|
1777
1845
|
}, setGetPlayheadTime: function(a, e) {
|
|
1778
1846
|
var t = H(a);
|
|
1779
1847
|
O[t] ? O[t].getPlayheadTime = e : q.error("A monitor for `" + t + "` has not been initialized.");
|
|
1780
|
-
}, checkDoNotTrack: qe, log: q, utils:
|
|
1781
|
-
Object.assign(J,
|
|
1782
|
-
typeof
|
|
1848
|
+
}, checkDoNotTrack: qe, log: q, utils: Si, events: Pi, WINDOW_HIDDEN: !1, WINDOW_UNLOADING: !1 };
|
|
1849
|
+
Object.assign(J, Ci);
|
|
1850
|
+
typeof oe.default < "u" && typeof oe.default.addEventListener == "function" && oe.default.addEventListener("pagehide", function(a) {
|
|
1783
1851
|
a.persisted || (J.WINDOW_UNLOADING = !0);
|
|
1784
1852
|
}, !1);
|
|
1785
|
-
var
|
|
1853
|
+
var ji = J;
|
|
1786
1854
|
/*!
|
|
1787
1855
|
* JavaScript Cookie v2.1.3
|
|
1788
1856
|
* https://github.com/js-cookie/js-cookie
|
|
@@ -1790,7 +1858,7 @@ var Nr = J;
|
|
|
1790
1858
|
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
1791
1859
|
* Released under the MIT license
|
|
1792
1860
|
*/
|
|
1793
|
-
const
|
|
1861
|
+
const Hi = async ({
|
|
1794
1862
|
appName: a = "elv-player-js",
|
|
1795
1863
|
elvPlayer: e,
|
|
1796
1864
|
playoutUrl: t,
|
|
@@ -1798,7 +1866,7 @@ const Cr = async ({
|
|
|
1798
1866
|
disableCookies: i
|
|
1799
1867
|
}) => {
|
|
1800
1868
|
t = new URL(t);
|
|
1801
|
-
const n = await e.__Client(),
|
|
1869
|
+
const n = await e.__Client(), s = (await n.NetworkInfo()).name === "main" ? "aq4mdjn7qo5sbkf89pkvfv93j" : "2i5480sms8vdgj0sv9bv6lpk5", u = t.pathname.split("/").find((f) => f.startsWith("hq__")), d = n.utils.DecodeVersionHash(u).objectId, l = (t.toString().match(/\/rep\/playout|channel\/([^/]+)/) || [])[1] || "default", m = t.searchParams.get("sid");
|
|
1802
1870
|
let b = u;
|
|
1803
1871
|
try {
|
|
1804
1872
|
const f = await n.ContentObjectMetadata({
|
|
@@ -1814,24 +1882,24 @@ const Cr = async ({
|
|
|
1814
1882
|
b = (f.asset_metadata || {}).display_title || (f.asset_metadata || {}).title || f.name || u;
|
|
1815
1883
|
} catch {
|
|
1816
1884
|
}
|
|
1817
|
-
let
|
|
1885
|
+
let c;
|
|
1818
1886
|
try {
|
|
1819
|
-
|
|
1887
|
+
c = await n.ContentObjectTenantId({ versionHash: u });
|
|
1820
1888
|
} catch {
|
|
1821
1889
|
}
|
|
1822
|
-
let
|
|
1890
|
+
let o = await n.CurrentAccountAddress();
|
|
1823
1891
|
if (r || n.staticToken)
|
|
1824
1892
|
try {
|
|
1825
1893
|
const { payload: f } = n.utils.DecodeSignedToken(r);
|
|
1826
|
-
|
|
1894
|
+
o = f.adr || o;
|
|
1827
1895
|
} catch {
|
|
1828
1896
|
}
|
|
1829
|
-
let
|
|
1897
|
+
let p = n.utils.FormatAddress(o);
|
|
1830
1898
|
if (typeof crypto < "u")
|
|
1831
1899
|
try {
|
|
1832
1900
|
const f = new TextEncoder();
|
|
1833
|
-
|
|
1834
|
-
await crypto.subtle.digest("SHA-256", f.encode(
|
|
1901
|
+
p = Buffer.from(
|
|
1902
|
+
await crypto.subtle.digest("SHA-256", f.encode(o))
|
|
1835
1903
|
).toString("hex");
|
|
1836
1904
|
} catch {
|
|
1837
1905
|
}
|
|
@@ -1839,26 +1907,26 @@ const Cr = async ({
|
|
|
1839
1907
|
debug: !1,
|
|
1840
1908
|
disableCookies: i,
|
|
1841
1909
|
data: {
|
|
1842
|
-
env_key:
|
|
1910
|
+
env_key: s,
|
|
1843
1911
|
video_id: d,
|
|
1844
1912
|
video_variant_id: u,
|
|
1845
|
-
video_variant_name:
|
|
1913
|
+
video_variant_name: l,
|
|
1846
1914
|
video_title: b,
|
|
1847
1915
|
video_cdn: t.hostname,
|
|
1848
|
-
viewer_user_id:
|
|
1849
|
-
sub_property_id:
|
|
1916
|
+
viewer_user_id: p,
|
|
1917
|
+
sub_property_id: c,
|
|
1850
1918
|
player_name: a,
|
|
1851
1919
|
//player_version: version,
|
|
1852
1920
|
player_init_time: e.initTime
|
|
1853
1921
|
}
|
|
1854
1922
|
};
|
|
1855
|
-
|
|
1923
|
+
m && (y.data.view_session_id = m), e.player && (e.HLS ? (y.hlsjs = e.player, y.Hls = e.HLS) : e.Dash && (y.dashjs = e.dashPlayer));
|
|
1856
1924
|
try {
|
|
1857
|
-
|
|
1925
|
+
ji.monitor(e.video, y), e.Log("elv-player-js: Mux monitoring initialized"), e.Log(JSON.stringify({ ...y, hlsjs: {} }));
|
|
1858
1926
|
} catch (f) {
|
|
1859
1927
|
e.Log("elv-player-js: Failed to initialize mux monitoring:", !0), e.Log(JSON.stringify(y, null, 2), !0), e.Log(f, !0);
|
|
1860
1928
|
}
|
|
1861
1929
|
};
|
|
1862
1930
|
export {
|
|
1863
|
-
|
|
1931
|
+
Hi as InitializeMuxMonitoring
|
|
1864
1932
|
};
|