@volcengine/veplayer 2.6.0-rc.4 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,8 @@ var __publicField = (obj, key, value) => {
12
12
  const { VeError } = error;
13
13
  var LiveErrorCode = /* @__PURE__ */ ((LiveErrorCode2) => {
14
14
  LiveErrorCode2[LiveErrorCode2["INVALID_PARAMETER"] = 210] = "INVALID_PARAMETER";
15
+ LiveErrorCode2[LiveErrorCode2["EMPTY_RTM_FALLBACK_PARAMETER"] = 211] = "EMPTY_RTM_FALLBACK_PARAMETER";
16
+ LiveErrorCode2[LiveErrorCode2["INVALID_LOGGER"] = 220] = "INVALID_LOGGER";
15
17
  return LiveErrorCode2;
16
18
  })(LiveErrorCode || {});
17
19
  error.Level;
@@ -27,62 +29,107 @@ var __publicField = (obj, key, value) => {
27
29
  ]: {
28
30
  messageTextKey: "INVALID_PARAMETER",
29
31
  level: error.Level.Fatal
32
+ },
33
+ [
34
+ 211
35
+ /* EMPTY_RTM_FALLBACK_PARAMETER */
36
+ ]: {
37
+ messageTextKey: "EMPTY_RTM_FALLBACK_PARAMETER",
38
+ level: error.Level.Warn
39
+ },
40
+ [
41
+ 220
42
+ /* INVALID_LOGGER */
43
+ ]: {
44
+ messageTextKey: "INVALID_LOGGER",
45
+ level: error.Level.Warn
30
46
  }
31
47
  };
32
48
  function create(errorCode, i18n) {
33
- return new VeError(ERRORS[errorCode], i18n);
49
+ return new VeError(
50
+ {
51
+ errorCode,
52
+ ...ERRORS[errorCode]
53
+ },
54
+ i18n
55
+ );
34
56
  }
35
57
  const DynamicModule$4 = window["VePlayer"].DynamicModule;
36
- const load$4 = window["VePlayer"].load;
58
+ const load$5 = window["VePlayer"].load;
37
59
  async function isRTMSupported() {
38
- const { RtmPlugin } = await load$4(DynamicModule$4.PluginRtm);
60
+ const { RtmPlugin } = await load$5(DynamicModule$4.PluginRtm);
39
61
  return RtmPlugin.isSupported();
40
62
  }
41
63
  async function isRTMSupportCodec(codec = RTMCodec.H264) {
42
- const { RtmPlugin } = await load$4(DynamicModule$4.PluginRtm);
64
+ const { RtmPlugin } = await load$5(DynamicModule$4.PluginRtm);
43
65
  if (codec === RTMCodec.H264)
44
66
  return RtmPlugin.isSupportedH264();
45
67
  return false;
46
68
  }
47
- const strategy$1 = window["VePlayer"].strategy;
48
- const util$4 = window["VePlayer"].util;
69
+ const getUrlObject = (url) => {
70
+ if (!url) {
71
+ return;
72
+ }
73
+ const withoutProtocol = url.startsWith("//");
74
+ if (withoutProtocol) {
75
+ url = location.protocol + url;
76
+ }
77
+ try {
78
+ return new URL(url);
79
+ } catch (error2) {
80
+ return;
81
+ }
82
+ };
83
+ const strategy$2 = window["VePlayer"].strategy;
84
+ const util$6 = window["VePlayer"].util;
49
85
  const DynamicModule$3 = window["VePlayer"].DynamicModule;
50
- const load$3 = window["VePlayer"].load;
51
- const Codec$1 = window["VePlayer"].Codec;
52
- const Sniffer$3 = window["VePlayer"].Sniffer;
86
+ const load$4 = window["VePlayer"].load;
87
+ const Codec$3 = window["VePlayer"].Codec;
88
+ const Sniffer$4 = window["VePlayer"].Sniffer;
53
89
  const rtmStrategy = {
54
90
  options: {},
55
91
  module: DynamicModule$3.PluginRtm
56
92
  };
57
93
  const generateFallbackUrl = (url) => {
58
- if (Sniffer$3.device === "pc") {
94
+ if (Sniffer$4.device === "pc") {
59
95
  return url.replace(".sdp", ".flv");
60
96
  } else {
61
97
  return url.replace(".sdp", ".m3u8");
62
98
  }
63
99
  };
64
- const getRtmStrategy = async (options, player) => {
65
- var _a;
100
+ const getRtmStrategy = async (options, player, i18n) => {
101
+ var _a, _b;
66
102
  let backupStrategy;
67
- const { url } = options;
68
- const {
69
- fallbackUrl,
70
- enableFallback = true,
71
- enableRTMAutoTranscode,
72
- ...ret
73
- } = options.rtm || {};
74
- const actualFallbackUrl = !enableFallback ? "" : !fallbackUrl && url ? generateFallbackUrl(url) : fallbackUrl;
75
- const backupType = actualFallbackUrl && util$4.getStreamType(actualFallbackUrl);
76
- if (backupType === "flv" && util$4.isMseSupported(Codec$1.H264)) {
77
- backupStrategy = strategy$1.createFlvMseStrategy(options);
78
- } else if (backupType === "hls" && (Sniffer$3.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE)) && util$4.isMseSupported(Codec$1.H264)) {
79
- backupStrategy = strategy$1.createHlsMseStrategy(options);
103
+ let actualFallbackUrl = "";
104
+ const { url, playlist } = options;
105
+ const { fallbackUrl, enableRTMAutoTranscode, ...ret } = options.rtm || {};
106
+ let { enableFallback = true } = options.rtm || {};
107
+ if (playlist == null ? void 0 : playlist.length) {
108
+ enableFallback = false;
109
+ }
110
+ const isRTMAutoTranscode = enableRTMAutoTranscode || ((_a = getUrlObject(url)) == null ? void 0 : _a.searchParams.get("enableRTMAutoTranscode")) === "true";
111
+ if (enableFallback) {
112
+ if (fallbackUrl) {
113
+ actualFallbackUrl = fallbackUrl;
114
+ } else if (isRTMAutoTranscode && url) {
115
+ actualFallbackUrl = generateFallbackUrl(url);
116
+ } else {
117
+ console.warn(
118
+ create(ErrorCode.EMPTY_RTM_FALLBACK_PARAMETER, i18n).message
119
+ );
120
+ }
121
+ }
122
+ const backupType = actualFallbackUrl && util$6.getStreamType(actualFallbackUrl);
123
+ if (backupType === "flv" && util$6.isMseSupported(Codec$3.H264)) {
124
+ backupStrategy = strategy$2.createFlvMseStrategy(options);
125
+ } else if (backupType === "hls" && (Sniffer$4.device !== "mobile" || ((_b = options == null ? void 0 : options.hls) == null ? void 0 : _b.enableMSE)) && util$6.isMseSupported(Codec$3.H264)) {
126
+ backupStrategy = strategy$2.createHlsMseStrategy(options);
80
127
  }
81
128
  const [rtmCdn, backupCdn] = await Promise.all([
82
- load$3(rtmStrategy.module).then((module2) => {
129
+ load$4(rtmStrategy.module).then((module2) => {
83
130
  return module2.RtmPlugin;
84
131
  }).catch(() => void 0),
85
- backupStrategy && load$3(backupStrategy.module).then((module2) => {
132
+ backupStrategy && load$4(backupStrategy.module).then((module2) => {
86
133
  if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule$3.PluginFlv) {
87
134
  return module2.FlvPlugin;
88
135
  } else if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule$3.PluginHls) {
@@ -90,38 +137,40 @@ var __publicField = (obj, key, value) => {
90
137
  }
91
138
  }).catch(() => void 0)
92
139
  ]);
93
- const [RTMSupported, RTMSupportCodec] = await Promise.all([
94
- isRTMSupported(),
95
- isRTMSupportCodec()
96
- ]);
97
- if (!RTMSupported || !RTMSupportCodec) {
98
- if (player) {
99
- player.emit("degrade", {
100
- url: actualFallbackUrl,
101
- originRtmUrl: url,
102
- code: "NOT_SUPPORT",
103
- message: "not support rtm or h264",
104
- isRTMSupported: RTMSupported,
105
- isRTMSupportCodec: RTMSupportCodec
106
- });
140
+ if (actualFallbackUrl) {
141
+ const [RTMSupported, RTMSupportCodec] = await Promise.all([
142
+ isRTMSupported(),
143
+ isRTMSupportCodec()
144
+ ]);
145
+ if (!RTMSupported || !RTMSupportCodec) {
146
+ if (player) {
147
+ player.emit("degrade", {
148
+ url: actualFallbackUrl,
149
+ originRtmUrl: url,
150
+ code: "NOT_SUPPORT",
151
+ message: "not support rtm or h264",
152
+ isRTMSupported: RTMSupported,
153
+ isRTMSupportCodec: RTMSupportCodec
154
+ });
155
+ }
156
+ return {
157
+ options: {
158
+ ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
159
+ url: actualFallbackUrl,
160
+ _RTMdegrade: {
161
+ _originRtmUrl: url,
162
+ _isRTMSupported: RTMSupported,
163
+ _isRTMSupportCodec: RTMSupportCodec
164
+ }
165
+ },
166
+ plugins: backupCdn ? [backupCdn] : []
167
+ };
107
168
  }
108
- return {
109
- options: {
110
- ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
111
- url: actualFallbackUrl,
112
- _RTMdegrade: {
113
- _originRtmUrl: url,
114
- _isRTMSupported: RTMSupported,
115
- _isRTMSupportCodec: RTMSupportCodec
116
- }
117
- },
118
- plugins: backupCdn ? [backupCdn] : []
119
- };
120
169
  }
121
170
  return {
122
171
  options: {
123
172
  ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
124
- url: enableRTMAutoTranscode ? util$4.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
173
+ url: enableRTMAutoTranscode ? util$6.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
125
174
  _RTMdegrade: void 0,
126
175
  rts: {
127
176
  retryCount: 0,
@@ -133,13 +182,13 @@ var __publicField = (obj, key, value) => {
133
182
  plugins: rtmCdn ? [rtmCdn] : []
134
183
  };
135
184
  };
136
- const Sniffer$2 = window["VePlayer"].Sniffer;
185
+ const Sniffer$3 = window["VePlayer"].Sniffer;
137
186
  var DrmType = /* @__PURE__ */ ((DrmType2) => {
138
187
  DrmType2["Fairplay"] = "fairplay";
139
188
  return DrmType2;
140
189
  })(DrmType || {});
141
190
  function getDrmType(drm) {
142
- if ((drm == null ? void 0 : drm.fairplay) && (Sniffer$2.browser === "safari" || Sniffer$2.os.isIos)) {
191
+ if ((drm == null ? void 0 : drm.fairplay) && (Sniffer$3.browser === "safari" || Sniffer$3.os.isIos)) {
143
192
  return "fairplay";
144
193
  }
145
194
  return;
@@ -157,18 +206,74 @@ var __publicField = (obj, key, value) => {
157
206
  }
158
207
  return true;
159
208
  }
209
+ const Sniffer$2 = window["VePlayer"].Sniffer;
210
+ const Codec$2 = window["VePlayer"].Codec;
211
+ const util$5 = window["VePlayer"].util;
212
+ const { isMMSSupported: isMMSSupported$1, isMseSupported: isMseSupported$1 } = util$5;
213
+ function enableMMS() {
214
+ return Sniffer$2.os.isIos;
215
+ }
216
+ function isFLVSupported(codec = Codec$2.H264) {
217
+ const isMediaSourceSupported = enableMMS() ? isMMSSupported$1 : isMseSupported$1;
218
+ return isMediaSourceSupported(codec);
219
+ }
220
+ const strategy$1 = window["VePlayer"].strategy;
221
+ const load$3 = window["VePlayer"].load;
222
+ const Codec$1 = window["VePlayer"].Codec;
223
+ const util$4 = window["VePlayer"].util;
224
+ const { appendSearchParams } = util$4;
225
+ const getFlvStrategy = async (options) => {
226
+ var _a, _b, _c, _d, _e, _f;
227
+ let mseStrategy;
228
+ let softStrategy;
229
+ const enableLowLatency = (_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.enableLowLatency;
230
+ const enableFrameChasing = ((_c = (_b = options == null ? void 0 : options.flv) == null ? void 0 : _b.lowLatency) == null ? void 0 : _c.enableFrameChasing) ?? true;
231
+ const abrPts = ((_e = (_d = options == null ? void 0 : options.flv) == null ? void 0 : _d.lowLatency) == null ? void 0 : _e.abrPts) ?? "-800";
232
+ const codec = await strategy$1.getCodec(options);
233
+ const isSoftDecode = await strategy$1.isSoftDecode(options, codec);
234
+ if (isSoftDecode) {
235
+ softStrategy = codec === Codec$1.H265 ? strategy$1.createSoftDecodeH265Strategy() : strategy$1.createSoftDecodeH264Strategy();
236
+ mseStrategy = strategy$1.createFlvMseStrategy(options);
237
+ }
238
+ if (codec === "unknown" ? isFLVSupported(Codec$1.H264) : isFLVSupported(codec)) {
239
+ mseStrategy = enableMMS() ? strategy$1.createFlvMssStrategy(options) : strategy$1.createFlvMseStrategy(options);
240
+ }
241
+ if (!mseStrategy && !softStrategy) {
242
+ return {};
243
+ }
244
+ const [mseModule, softModule] = await Promise.all([
245
+ (mseStrategy == null ? void 0 : mseStrategy.module) && load$3(mseStrategy.module).catch(() => void 0),
246
+ (softStrategy == null ? void 0 : softStrategy.module) && load$3(softStrategy.module).catch(() => void 0)
247
+ ]);
248
+ (softModule == null ? void 0 : softModule.XGVideoPlugin) && ((_f = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _f.call(softStrategy, softModule == null ? void 0 : softModule.XGVideoPlugin));
249
+ const combineOptions = strategy$1.combineOptions([mseStrategy, softStrategy]);
250
+ const plugins = [];
251
+ if (enableLowLatency) {
252
+ combineOptions.url = appendSearchParams(options.url, { abr_pts: abrPts });
253
+ }
254
+ if (mseModule) {
255
+ plugins.push(mseModule.FlvPlugin);
256
+ if (enableLowLatency && enableFrameChasing) {
257
+ plugins.push(mseModule.Adaptive);
258
+ }
259
+ }
260
+ return {
261
+ options: combineOptions,
262
+ plugins
263
+ };
264
+ };
160
265
  const util$3 = window["VePlayer"].util;
161
266
  const strategy = window["VePlayer"].strategy;
162
- const getTypeStrategy = async (options, player) => {
267
+ const getTypeStrategy = async (options, player, i18n) => {
163
268
  const type = options.url ? util$3.getStreamType(options.url) : "";
164
269
  if (!type || type === "unknown") {
165
270
  return { options: {}, plugins: [] };
166
271
  }
167
272
  if (type === "rtm") {
168
- return await getRtmStrategy(options, player);
273
+ return await getRtmStrategy(options, player, i18n);
169
274
  }
170
275
  if (type === "flv") {
171
- return await strategy.getFlvStrategy(options);
276
+ return await getFlvStrategy(options);
172
277
  }
173
278
  if (type === "hls") {
174
279
  if (!isMseSupportedWithDrm({ drm: options.drm, streamType: type })) {
@@ -182,33 +287,33 @@ var __publicField = (obj, key, value) => {
182
287
  function getDefaultExportFromCjs(x2) {
183
288
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
184
289
  }
185
- var FUNC_ERROR_TEXT = "Expected a function";
186
- var NAN = 0 / 0;
187
- var symbolTag = "[object Symbol]";
188
- var reTrim = /^\s+|\s+$/g;
189
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
190
- var reIsBinary = /^0b[01]+$/i;
191
- var reIsOctal = /^0o[0-7]+$/i;
192
- var freeParseInt = parseInt;
193
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
194
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
195
- var root = freeGlobal || freeSelf || Function("return this")();
196
- var objectProto = Object.prototype;
197
- var objectToString = objectProto.toString;
198
- var nativeMax = Math.max, nativeMin = Math.min;
290
+ var FUNC_ERROR_TEXT$1 = "Expected a function";
291
+ var NAN$1 = 0 / 0;
292
+ var symbolTag$1 = "[object Symbol]";
293
+ var reTrim$1 = /^\s+|\s+$/g;
294
+ var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i;
295
+ var reIsBinary$1 = /^0b[01]+$/i;
296
+ var reIsOctal$1 = /^0o[0-7]+$/i;
297
+ var freeParseInt$1 = parseInt;
298
+ var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
299
+ var freeSelf$1 = typeof self == "object" && self && self.Object === Object && self;
300
+ var root$1 = freeGlobal$1 || freeSelf$1 || Function("return this")();
301
+ var objectProto$1 = Object.prototype;
302
+ var objectToString$1 = objectProto$1.toString;
303
+ var nativeMax$1 = Math.max, nativeMin$1 = Math.min;
199
304
  var now = function() {
200
- return root.Date.now();
305
+ return root$1.Date.now();
201
306
  };
202
307
  function debounce(func, wait, options) {
203
308
  var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
204
309
  if (typeof func != "function") {
205
- throw new TypeError(FUNC_ERROR_TEXT);
310
+ throw new TypeError(FUNC_ERROR_TEXT$1);
206
311
  }
207
- wait = toNumber(wait) || 0;
208
- if (isObject(options)) {
312
+ wait = toNumber$1(wait) || 0;
313
+ if (isObject$1(options)) {
209
314
  leading = !!options.leading;
210
315
  maxing = "maxWait" in options;
211
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
316
+ maxWait = maxing ? nativeMax$1(toNumber$1(options.maxWait) || 0, wait) : maxWait;
212
317
  trailing = "trailing" in options ? !!options.trailing : trailing;
213
318
  }
214
319
  function invokeFunc(time) {
@@ -225,7 +330,7 @@ var __publicField = (obj, key, value) => {
225
330
  }
226
331
  function remainingWait(time) {
227
332
  var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result2 = wait - timeSinceLastCall;
228
- return maxing ? nativeMin(result2, maxWait - timeSinceLastInvoke) : result2;
333
+ return maxing ? nativeMin$1(result2, maxWait - timeSinceLastInvoke) : result2;
229
334
  }
230
335
  function shouldInvoke(time) {
231
336
  var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
@@ -279,33 +384,33 @@ var __publicField = (obj, key, value) => {
279
384
  debounced.flush = flush;
280
385
  return debounced;
281
386
  }
282
- function isObject(value) {
387
+ function isObject$1(value) {
283
388
  var type = typeof value;
284
389
  return !!value && (type == "object" || type == "function");
285
390
  }
286
- function isObjectLike(value) {
391
+ function isObjectLike$1(value) {
287
392
  return !!value && typeof value == "object";
288
393
  }
289
- function isSymbol(value) {
290
- return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
394
+ function isSymbol$1(value) {
395
+ return typeof value == "symbol" || isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1;
291
396
  }
292
- function toNumber(value) {
397
+ function toNumber$1(value) {
293
398
  if (typeof value == "number") {
294
399
  return value;
295
400
  }
296
- if (isSymbol(value)) {
297
- return NAN;
401
+ if (isSymbol$1(value)) {
402
+ return NAN$1;
298
403
  }
299
- if (isObject(value)) {
404
+ if (isObject$1(value)) {
300
405
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
301
- value = isObject(other) ? other + "" : other;
406
+ value = isObject$1(other) ? other + "" : other;
302
407
  }
303
408
  if (typeof value != "string") {
304
409
  return value === 0 ? value : +value;
305
410
  }
306
- value = value.replace(reTrim, "");
307
- var isBinary = reIsBinary.test(value);
308
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
411
+ value = value.replace(reTrim$1, "");
412
+ var isBinary = reIsBinary$1.test(value);
413
+ return isBinary || reIsOctal$1.test(value) ? freeParseInt$1(value.slice(2), isBinary ? 2 : 8) : reIsBadHex$1.test(value) ? NAN$1 : +value;
309
414
  }
310
415
  var lodash_debounce = debounce;
311
416
  var debounce$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_debounce);
@@ -779,9 +884,9 @@ var __publicField = (obj, key, value) => {
779
884
  // render_fps: this.render_fps, //帧率
780
885
  decode_fps: 0,
781
886
  render_fps: 0,
782
- drop_count: 0,
887
+ drop_count: -1,
783
888
  // 丢帧数
784
- drop_percent: 0,
889
+ drop_percent: -1,
785
890
  // 丢帧率
786
891
  sei_source: "",
787
892
  sei_delay: 0,
@@ -887,7 +992,7 @@ var __publicField = (obj, key, value) => {
887
992
  live_sdk_version: getPlayerCore(player) || player.hlsOps ? "2" : "-1",
888
993
  player_sdk_version: player.version,
889
994
  // eslint-disable-next-line no-undef
890
- logger_version: "1.1.0-alpha.10",
995
+ logger_version: "1.1.0-alpha.12",
891
996
  // 由rollup 在编译时注入
892
997
  report_version: "5",
893
998
  product_line: options.product_line,
@@ -1543,10 +1648,14 @@ var __publicField = (obj, key, value) => {
1543
1648
  if (video.getVideoPlaybackQuality) {
1544
1649
  var quality = video.getVideoPlaybackQuality();
1545
1650
  this.log.playing.drop_count = quality.droppedVideoFrames - this.tempDroppedFrameCount;
1546
- this.log.playing.drop_percent = Number.parseFloat(this.tempTotalFrameCount / quality.totalVideoFrames).toFixed(1);
1651
+ this.log.playing.drop_percent = Number.parseFloat((quality.droppedVideoFrames - this.tempDroppedFrameCount) / (quality.totalVideoFrames - this.tempTotalFrameCount)).toFixed(1);
1547
1652
  this.log.play_stop.drop_percent = Number.parseFloat(quality.droppedVideoFrames / quality.totalVideoFrames).toFixed(1);
1548
1653
  this.tempDroppedFrameCount = quality.droppedVideoFrames;
1549
1654
  this.tempTotalFrameCount = quality.totalVideoFrames;
1655
+ } else if (video.webkitDroppedFrameCount != void 0) {
1656
+ var droppedVideoFrames = video.webkitDroppedFrameCount;
1657
+ this.log.playing.drop_count = droppedVideoFrames - this.tempDroppedFrameCount;
1658
+ this.tempDroppedFrameCount = droppedVideoFrames;
1550
1659
  }
1551
1660
  };
1552
1661
  _proto2.getRtcStats = function getRtcStats(duration, first) {
@@ -1733,7 +1842,7 @@ var __publicField = (obj, key, value) => {
1733
1842
  }
1734
1843
  _this9.player.off("playing", _this9.handlePlayerPlaying);
1735
1844
  _this9.player.off("timeupdate", _this9.handlePlayerPlaying);
1736
- if (_this9.core) {
1845
+ if (_this9.core && _this9.core.getStats) {
1737
1846
  var _ref5 = _this9.core.getStats() || {}, fps = _ref5.fps;
1738
1847
  _this9.commonParams.fps = fps;
1739
1848
  }
@@ -2034,7 +2143,7 @@ var __publicField = (obj, key, value) => {
2034
2143
  if (this.firstFrameViewed) {
2035
2144
  return;
2036
2145
  }
2037
- if (this.core) {
2146
+ if (this.core && this.core.getStats) {
2038
2147
  var _ref6 = this.core.getStats() || {}, fps = _ref6.fps;
2039
2148
  this.commonParams.fps = fps;
2040
2149
  }
@@ -2932,22 +3041,23 @@ var __publicField = (obj, key, value) => {
2932
3041
  }
2933
3042
  static get defaultConfig() {
2934
3043
  return {
2935
- appId: "",
3044
+ appId: 654925,
2936
3045
  enable: true,
2937
3046
  showUserIdInErrorPanel: true
2938
3047
  };
2939
3048
  }
2940
- afterCreate() {
3049
+ beforeCreate(args) {
2941
3050
  var _a, _b;
2942
- if (!this.config.enable) {
3051
+ if (!args.config.enable) {
2943
3052
  return;
2944
3053
  }
2945
- if (!this.config.appId) {
2946
- console.info("not found appId, please generate an appId");
3054
+ args.config.userId = ((_a = args.config) == null ? void 0 : _a.userId) || getUserId();
3055
+ args.config.deviceId = ((_b = args.config) == null ? void 0 : _b.deviceId) || getDeviceID();
3056
+ }
3057
+ afterCreate() {
3058
+ if (!this.config.enable) {
2947
3059
  return;
2948
3060
  }
2949
- this._userId = ((_a = this.config) == null ? void 0 : _a.userId) || getUserId();
2950
- this._deviceId = ((_b = this.config) == null ? void 0 : _b.deviceId) || getDeviceID();
2951
3061
  this.open();
2952
3062
  }
2953
3063
  destroy() {
@@ -2988,16 +3098,17 @@ var __publicField = (obj, key, value) => {
2988
3098
  this._liveLogger = new LoggerControl({
2989
3099
  Tea: q,
2990
3100
  player: this.player,
2991
- aid: this.config.appId,
3101
+ aid: this.config.appId || 654925,
2992
3102
  project_key: this.config.appId,
2993
3103
  app_name: this.config.appName || this.config.appId,
2994
3104
  user_id: this._userId,
2995
3105
  device_id: this._deviceId,
3106
+ error_report_stop: true,
2996
3107
  ext: {
2997
- veplayer_version: "2.3.1-rc.1",
2998
- flv_version: "3.0.21-rc.3",
2999
- hls_version: "3.0.21-rc.3",
3000
- rts_version: "0.2.1-alpha.0"
3108
+ veplayer_version: "2.3.0",
3109
+ flv_version: "3.0.21-rc.5",
3110
+ hls_version: "3.0.21-rc.5",
3111
+ rts_version: "0.2.1-alpha.14"
3001
3112
  }
3002
3113
  });
3003
3114
  }
@@ -3229,10 +3340,17 @@ var __publicField = (obj, key, value) => {
3229
3340
  return rowDom;
3230
3341
  }
3231
3342
  }
3343
+ const logDoc = (
3344
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3345
+ // @ts-ignore
3346
+ "https://www.volcengine.com/docs/6469/138655#日志上报"
3347
+ );
3232
3348
  const BaseEN = window["VePlayer"].EN;
3233
3349
  const EN$1 = {
3234
3350
  ...BaseEN,
3235
3351
  INVALID_PARAMETER: "The imported parameter is empty, please pass in necessary parameters such as the stream address",
3352
+ INVALID_LOGGER: `Log options not configured correctly. Please refer to this document ${logDoc} to configure the logs.`,
3353
+ EMPTY_RTM_FALLBACK_PARAMETER: "Fallback URL for RTM is not configured. Please set enableFallback: false to disable fallback, or configure fallbackUrl for FLV and HLS formats based on the browser environment.",
3236
3354
  // info-panel
3237
3355
  FORMAT: "format",
3238
3356
  FPS: "fps",
@@ -3251,6 +3369,8 @@ var __publicField = (obj, key, value) => {
3251
3369
  const ZH_CN$1 = {
3252
3370
  ...BaseZH_CN,
3253
3371
  INVALID_PARAMETER: "入参为空,请传入流地址等必要参数",
3372
+ INVALID_LOGGER: `未正确配置质量日志参数, 请参考 ${logDoc} 配置`,
3373
+ EMPTY_RTM_FALLBACK_PARAMETER: "未配置 RTM 降级地址 fallbackUrl,请设置 enableFallback: false 取消降级或根据浏览器环境配置 FLV、HLS 格式降级地址",
3254
3374
  // info-panel
3255
3375
  FORMAT: "格式",
3256
3376
  FPS: "帧率",
@@ -3298,11 +3418,498 @@ var __publicField = (obj, key, value) => {
3298
3418
  }
3299
3419
  return {};
3300
3420
  };
3301
- function isType(suffix) {
3302
- return function(url) {
3303
- return url == null ? void 0 : url.split("?")[0].toLowerCase().includes(suffix);
3421
+ var FUNC_ERROR_TEXT = "Expected a function";
3422
+ var PLACEHOLDER = "__lodash_placeholder__";
3423
+ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, CURRY_FLAG = 8, CURRY_RIGHT_FLAG = 16, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64, ARY_FLAG = 128, REARG_FLAG = 256, FLIP_FLAG = 512;
3424
+ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
3425
+ var wrapFlags = [
3426
+ ["ary", ARY_FLAG],
3427
+ ["bind", BIND_FLAG],
3428
+ ["bindKey", BIND_KEY_FLAG],
3429
+ ["curry", CURRY_FLAG],
3430
+ ["curryRight", CURRY_RIGHT_FLAG],
3431
+ ["flip", FLIP_FLAG],
3432
+ ["partial", PARTIAL_FLAG],
3433
+ ["partialRight", PARTIAL_RIGHT_FLAG],
3434
+ ["rearg", REARG_FLAG]
3435
+ ];
3436
+ var funcTag = "[object Function]", genTag = "[object GeneratorFunction]", symbolTag = "[object Symbol]";
3437
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
3438
+ var reTrim = /^\s+|\s+$/g;
3439
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
3440
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
3441
+ var reIsBinary = /^0b[01]+$/i;
3442
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
3443
+ var reIsOctal = /^0o[0-7]+$/i;
3444
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
3445
+ var freeParseInt = parseInt;
3446
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
3447
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
3448
+ var root = freeGlobal || freeSelf || Function("return this")();
3449
+ function apply(func, thisArg, args) {
3450
+ switch (args.length) {
3451
+ case 0:
3452
+ return func.call(thisArg);
3453
+ case 1:
3454
+ return func.call(thisArg, args[0]);
3455
+ case 2:
3456
+ return func.call(thisArg, args[0], args[1]);
3457
+ case 3:
3458
+ return func.call(thisArg, args[0], args[1], args[2]);
3459
+ }
3460
+ return func.apply(thisArg, args);
3461
+ }
3462
+ function arrayEach(array, iteratee) {
3463
+ var index = -1, length = array ? array.length : 0;
3464
+ while (++index < length) {
3465
+ if (iteratee(array[index], index, array) === false) {
3466
+ break;
3467
+ }
3468
+ }
3469
+ return array;
3470
+ }
3471
+ function arrayIncludes(array, value) {
3472
+ var length = array ? array.length : 0;
3473
+ return !!length && baseIndexOf(array, value, 0) > -1;
3474
+ }
3475
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
3476
+ var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
3477
+ while (fromRight ? index-- : ++index < length) {
3478
+ if (predicate(array[index], index, array)) {
3479
+ return index;
3480
+ }
3481
+ }
3482
+ return -1;
3483
+ }
3484
+ function baseIndexOf(array, value, fromIndex) {
3485
+ if (value !== value) {
3486
+ return baseFindIndex(array, baseIsNaN, fromIndex);
3487
+ }
3488
+ var index = fromIndex - 1, length = array.length;
3489
+ while (++index < length) {
3490
+ if (array[index] === value) {
3491
+ return index;
3492
+ }
3493
+ }
3494
+ return -1;
3495
+ }
3496
+ function baseIsNaN(value) {
3497
+ return value !== value;
3498
+ }
3499
+ function countHolders(array, placeholder) {
3500
+ var length = array.length, result = 0;
3501
+ while (length--) {
3502
+ if (array[length] === placeholder) {
3503
+ result++;
3504
+ }
3505
+ }
3506
+ return result;
3507
+ }
3508
+ function getValue(object, key) {
3509
+ return object == null ? void 0 : object[key];
3510
+ }
3511
+ function isHostObject(value) {
3512
+ var result = false;
3513
+ if (value != null && typeof value.toString != "function") {
3514
+ try {
3515
+ result = !!(value + "");
3516
+ } catch (e2) {
3517
+ }
3518
+ }
3519
+ return result;
3520
+ }
3521
+ function replaceHolders(array, placeholder) {
3522
+ var index = -1, length = array.length, resIndex = 0, result = [];
3523
+ while (++index < length) {
3524
+ var value = array[index];
3525
+ if (value === placeholder || value === PLACEHOLDER) {
3526
+ array[index] = PLACEHOLDER;
3527
+ result[resIndex++] = index;
3528
+ }
3529
+ }
3530
+ return result;
3531
+ }
3532
+ var funcProto = Function.prototype, objectProto = Object.prototype;
3533
+ var coreJsData = root["__core-js_shared__"];
3534
+ var maskSrcKey = function() {
3535
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
3536
+ return uid ? "Symbol(src)_1." + uid : "";
3537
+ }();
3538
+ var funcToString = funcProto.toString;
3539
+ var hasOwnProperty = objectProto.hasOwnProperty;
3540
+ var objectToString = objectProto.toString;
3541
+ var reIsNative = RegExp(
3542
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3543
+ );
3544
+ var objectCreate = Object.create;
3545
+ var nativeMax = Math.max, nativeMin = Math.min;
3546
+ var defineProperty = function() {
3547
+ var func = getNative(Object, "defineProperty"), name = getNative.name;
3548
+ return name && name.length > 2 ? func : void 0;
3549
+ }();
3550
+ function baseCreate(proto) {
3551
+ return isObject(proto) ? objectCreate(proto) : {};
3552
+ }
3553
+ function baseIsNative(value) {
3554
+ if (!isObject(value) || isMasked(value)) {
3555
+ return false;
3556
+ }
3557
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
3558
+ return pattern.test(toSource(value));
3559
+ }
3560
+ function composeArgs(args, partials, holders, isCurried) {
3561
+ var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried;
3562
+ while (++leftIndex < leftLength) {
3563
+ result[leftIndex] = partials[leftIndex];
3564
+ }
3565
+ while (++argsIndex < holdersLength) {
3566
+ if (isUncurried || argsIndex < argsLength) {
3567
+ result[holders[argsIndex]] = args[argsIndex];
3568
+ }
3569
+ }
3570
+ while (rangeLength--) {
3571
+ result[leftIndex++] = args[argsIndex++];
3572
+ }
3573
+ return result;
3574
+ }
3575
+ function composeArgsRight(args, partials, holders, isCurried) {
3576
+ var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried;
3577
+ while (++argsIndex < rangeLength) {
3578
+ result[argsIndex] = args[argsIndex];
3579
+ }
3580
+ var offset = argsIndex;
3581
+ while (++rightIndex < rightLength) {
3582
+ result[offset + rightIndex] = partials[rightIndex];
3583
+ }
3584
+ while (++holdersIndex < holdersLength) {
3585
+ if (isUncurried || argsIndex < argsLength) {
3586
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
3587
+ }
3588
+ }
3589
+ return result;
3590
+ }
3591
+ function copyArray(source, array) {
3592
+ var index = -1, length = source.length;
3593
+ array || (array = Array(length));
3594
+ while (++index < length) {
3595
+ array[index] = source[index];
3596
+ }
3597
+ return array;
3598
+ }
3599
+ function createBind(func, bitmask, thisArg) {
3600
+ var isBind = bitmask & BIND_FLAG, Ctor = createCtor(func);
3601
+ function wrapper() {
3602
+ var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
3603
+ return fn.apply(isBind ? thisArg : this, arguments);
3604
+ }
3605
+ return wrapper;
3606
+ }
3607
+ function createCtor(Ctor) {
3608
+ return function() {
3609
+ var args = arguments;
3610
+ switch (args.length) {
3611
+ case 0:
3612
+ return new Ctor();
3613
+ case 1:
3614
+ return new Ctor(args[0]);
3615
+ case 2:
3616
+ return new Ctor(args[0], args[1]);
3617
+ case 3:
3618
+ return new Ctor(args[0], args[1], args[2]);
3619
+ case 4:
3620
+ return new Ctor(args[0], args[1], args[2], args[3]);
3621
+ case 5:
3622
+ return new Ctor(args[0], args[1], args[2], args[3], args[4]);
3623
+ case 6:
3624
+ return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
3625
+ case 7:
3626
+ return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
3627
+ }
3628
+ var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args);
3629
+ return isObject(result) ? result : thisBinding;
3630
+ };
3631
+ }
3632
+ function createCurry(func, bitmask, arity) {
3633
+ var Ctor = createCtor(func);
3634
+ function wrapper() {
3635
+ var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper);
3636
+ while (index--) {
3637
+ args[index] = arguments[index];
3638
+ }
3639
+ var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
3640
+ length -= holders.length;
3641
+ if (length < arity) {
3642
+ return createRecurry(
3643
+ func,
3644
+ bitmask,
3645
+ createHybrid,
3646
+ wrapper.placeholder,
3647
+ void 0,
3648
+ args,
3649
+ holders,
3650
+ void 0,
3651
+ void 0,
3652
+ arity - length
3653
+ );
3654
+ }
3655
+ var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
3656
+ return apply(fn, this, args);
3657
+ }
3658
+ return wrapper;
3659
+ }
3660
+ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
3661
+ var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), isFlip = bitmask & FLIP_FLAG, Ctor = isBindKey ? void 0 : createCtor(func);
3662
+ function wrapper() {
3663
+ var length = arguments.length, args = Array(length), index = length;
3664
+ while (index--) {
3665
+ args[index] = arguments[index];
3666
+ }
3667
+ if (isCurried) {
3668
+ var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
3669
+ }
3670
+ if (partials) {
3671
+ args = composeArgs(args, partials, holders, isCurried);
3672
+ }
3673
+ if (partialsRight) {
3674
+ args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
3675
+ }
3676
+ length -= holdersCount;
3677
+ if (isCurried && length < arity) {
3678
+ var newHolders = replaceHolders(args, placeholder);
3679
+ return createRecurry(
3680
+ func,
3681
+ bitmask,
3682
+ createHybrid,
3683
+ wrapper.placeholder,
3684
+ thisArg,
3685
+ args,
3686
+ newHolders,
3687
+ argPos,
3688
+ ary,
3689
+ arity - length
3690
+ );
3691
+ }
3692
+ var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
3693
+ length = args.length;
3694
+ if (argPos) {
3695
+ args = reorder(args, argPos);
3696
+ } else if (isFlip && length > 1) {
3697
+ args.reverse();
3698
+ }
3699
+ if (isAry && ary < length) {
3700
+ args.length = ary;
3701
+ }
3702
+ if (this && this !== root && this instanceof wrapper) {
3703
+ fn = Ctor || createCtor(fn);
3704
+ }
3705
+ return fn.apply(thisBinding, args);
3706
+ }
3707
+ return wrapper;
3708
+ }
3709
+ function createPartial(func, bitmask, thisArg, partials) {
3710
+ var isBind = bitmask & BIND_FLAG, Ctor = createCtor(func);
3711
+ function wrapper() {
3712
+ var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
3713
+ while (++leftIndex < leftLength) {
3714
+ args[leftIndex] = partials[leftIndex];
3715
+ }
3716
+ while (argsLength--) {
3717
+ args[leftIndex++] = arguments[++argsIndex];
3718
+ }
3719
+ return apply(fn, isBind ? thisArg : this, args);
3720
+ }
3721
+ return wrapper;
3722
+ }
3723
+ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
3724
+ var isCurry = bitmask & CURRY_FLAG, newHolders = isCurry ? holders : void 0, newHoldersRight = isCurry ? void 0 : holders, newPartials = isCurry ? partials : void 0, newPartialsRight = isCurry ? void 0 : partials;
3725
+ bitmask |= isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG;
3726
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
3727
+ if (!(bitmask & CURRY_BOUND_FLAG)) {
3728
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
3729
+ }
3730
+ var result = wrapFunc(func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity);
3731
+ result.placeholder = placeholder;
3732
+ return setWrapToString(result, func, bitmask);
3733
+ }
3734
+ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
3735
+ var isBindKey = bitmask & BIND_KEY_FLAG;
3736
+ if (!isBindKey && typeof func != "function") {
3737
+ throw new TypeError(FUNC_ERROR_TEXT);
3738
+ }
3739
+ var length = partials ? partials.length : 0;
3740
+ if (!length) {
3741
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
3742
+ partials = holders = void 0;
3743
+ }
3744
+ ary = ary === void 0 ? ary : nativeMax(toInteger(ary), 0);
3745
+ arity = arity === void 0 ? arity : toInteger(arity);
3746
+ length -= holders ? holders.length : 0;
3747
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
3748
+ var partialsRight = partials, holdersRight = holders;
3749
+ partials = holders = void 0;
3750
+ }
3751
+ var newData = [
3752
+ func,
3753
+ bitmask,
3754
+ thisArg,
3755
+ partials,
3756
+ holders,
3757
+ partialsRight,
3758
+ holdersRight,
3759
+ argPos,
3760
+ ary,
3761
+ arity
3762
+ ];
3763
+ func = newData[0];
3764
+ bitmask = newData[1];
3765
+ thisArg = newData[2];
3766
+ partials = newData[3];
3767
+ holders = newData[4];
3768
+ arity = newData[9] = newData[9] == null ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
3769
+ if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) {
3770
+ bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG);
3771
+ }
3772
+ if (!bitmask || bitmask == BIND_FLAG) {
3773
+ var result = createBind(func, bitmask, thisArg);
3774
+ } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) {
3775
+ result = createCurry(func, bitmask, arity);
3776
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
3777
+ result = createPartial(func, bitmask, thisArg, partials);
3778
+ } else {
3779
+ result = createHybrid.apply(void 0, newData);
3780
+ }
3781
+ return setWrapToString(result, func, bitmask);
3782
+ }
3783
+ function getHolder(func) {
3784
+ var object = func;
3785
+ return object.placeholder;
3786
+ }
3787
+ function getNative(object, key) {
3788
+ var value = getValue(object, key);
3789
+ return baseIsNative(value) ? value : void 0;
3790
+ }
3791
+ function getWrapDetails(source) {
3792
+ var match = source.match(reWrapDetails);
3793
+ return match ? match[1].split(reSplitDetails) : [];
3794
+ }
3795
+ function insertWrapDetails(source, details) {
3796
+ var length = details.length, lastIndex = length - 1;
3797
+ details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
3798
+ details = details.join(length > 2 ? ", " : " ");
3799
+ return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
3800
+ }
3801
+ function isIndex(value, length) {
3802
+ length = length == null ? MAX_SAFE_INTEGER : length;
3803
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
3804
+ }
3805
+ function isMasked(func) {
3806
+ return !!maskSrcKey && maskSrcKey in func;
3807
+ }
3808
+ function reorder(array, indexes) {
3809
+ var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
3810
+ while (length--) {
3811
+ var index = indexes[length];
3812
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : void 0;
3813
+ }
3814
+ return array;
3815
+ }
3816
+ var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) {
3817
+ var source = reference + "";
3818
+ return defineProperty(wrapper, "toString", {
3819
+ "configurable": true,
3820
+ "enumerable": false,
3821
+ "value": constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)))
3822
+ });
3823
+ };
3824
+ function toSource(func) {
3825
+ if (func != null) {
3826
+ try {
3827
+ return funcToString.call(func);
3828
+ } catch (e2) {
3829
+ }
3830
+ try {
3831
+ return func + "";
3832
+ } catch (e2) {
3833
+ }
3834
+ }
3835
+ return "";
3836
+ }
3837
+ function updateWrapDetails(details, bitmask) {
3838
+ arrayEach(wrapFlags, function(pair) {
3839
+ var value = "_." + pair[0];
3840
+ if (bitmask & pair[1] && !arrayIncludes(details, value)) {
3841
+ details.push(value);
3842
+ }
3843
+ });
3844
+ return details.sort();
3845
+ }
3846
+ function curry(func, arity, guard) {
3847
+ arity = guard ? void 0 : arity;
3848
+ var result = createWrap(func, CURRY_FLAG, void 0, void 0, void 0, void 0, void 0, arity);
3849
+ result.placeholder = curry.placeholder;
3850
+ return result;
3851
+ }
3852
+ function isFunction(value) {
3853
+ var tag = isObject(value) ? objectToString.call(value) : "";
3854
+ return tag == funcTag || tag == genTag;
3855
+ }
3856
+ function isObject(value) {
3857
+ var type = typeof value;
3858
+ return !!value && (type == "object" || type == "function");
3859
+ }
3860
+ function isObjectLike(value) {
3861
+ return !!value && typeof value == "object";
3862
+ }
3863
+ function isSymbol(value) {
3864
+ return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
3865
+ }
3866
+ function toFinite(value) {
3867
+ if (!value) {
3868
+ return value === 0 ? value : 0;
3869
+ }
3870
+ value = toNumber(value);
3871
+ if (value === INFINITY || value === -INFINITY) {
3872
+ var sign = value < 0 ? -1 : 1;
3873
+ return sign * MAX_INTEGER;
3874
+ }
3875
+ return value === value ? value : 0;
3876
+ }
3877
+ function toInteger(value) {
3878
+ var result = toFinite(value), remainder = result % 1;
3879
+ return result === result ? remainder ? result - remainder : result : 0;
3880
+ }
3881
+ function toNumber(value) {
3882
+ if (typeof value == "number") {
3883
+ return value;
3884
+ }
3885
+ if (isSymbol(value)) {
3886
+ return NAN;
3887
+ }
3888
+ if (isObject(value)) {
3889
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
3890
+ value = isObject(other) ? other + "" : other;
3891
+ }
3892
+ if (typeof value != "string") {
3893
+ return value === 0 ? value : +value;
3894
+ }
3895
+ value = value.replace(reTrim, "");
3896
+ var isBinary = reIsBinary.test(value);
3897
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
3898
+ }
3899
+ function constant(value) {
3900
+ return function() {
3901
+ return value;
3304
3902
  };
3305
3903
  }
3904
+ function identity(value) {
3905
+ return value;
3906
+ }
3907
+ curry.placeholder = {};
3908
+ var lodash_curry = curry;
3909
+ var curry$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_curry);
3910
+ const isType = curry$1(function(suffix, url) {
3911
+ return url == null ? void 0 : url.split("?")[0].toLowerCase().includes(suffix);
3912
+ });
3306
3913
  const isHls = isType(".m3u8");
3307
3914
  const isMp4 = isType(".mp4");
3308
3915
  const isFlv = isType(".flv");
@@ -3406,6 +4013,10 @@ var __publicField = (obj, key, value) => {
3406
4013
  }
3407
4014
  return time;
3408
4015
  }
4016
+ get ad() {
4017
+ var _a, _b;
4018
+ return (_b = (_a = this._player.plugins) == null ? void 0 : _a.ad) == null ? void 0 : _b.adManager;
4019
+ }
3409
4020
  /** {zh}
3410
4021
  * @brief 调用此方法开启直播日志上报。
3411
4022
  */
@@ -3556,15 +4167,18 @@ var __publicField = (obj, key, value) => {
3556
4167
  }
3557
4168
  }
3558
4169
  async function createLivePlayer(options) {
3559
- var _a, _b;
4170
+ var _a, _b, _c, _d;
3560
4171
  let player = void 0;
3561
- if (!options || !options.url && !options.playlist) {
3562
- throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
3563
- }
3564
4172
  const i18n = new VeI18n({
3565
4173
  lang: options == null ? void 0 : options.lang,
3566
4174
  i18n: options == null ? void 0 : options.i18n
3567
4175
  });
4176
+ if (!options || !options.url && !options.playlist) {
4177
+ throw create(ErrorCode.INVALID_PARAMETER, i18n);
4178
+ }
4179
+ if (!((_a = options.logger) == null ? void 0 : _a.appId) && ((_b = options == null ? void 0 : options.logger) == null ? void 0 : _b.enable) !== false) {
4180
+ console.warn(create(ErrorCode.INVALID_LOGGER, i18n).message);
4181
+ }
3568
4182
  const finalOptions = {
3569
4183
  ...options,
3570
4184
  plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
@@ -3576,18 +4190,23 @@ var __publicField = (obj, key, value) => {
3576
4190
  isLive: true,
3577
4191
  i18nManager: i18n,
3578
4192
  preProcessUrl: (url) => {
4193
+ if (isType(".ts", url)) {
4194
+ return { url };
4195
+ }
3579
4196
  return {
3580
4197
  url: generateUrlWithSessionId(url)
3581
4198
  };
3582
4199
  },
3583
4200
  async preparePlugins(url) {
4201
+ var _a2;
3584
4202
  const [typeStrategy, drmStrategy, abrStrategy] = await Promise.all([
3585
4203
  getTypeStrategy(
3586
4204
  {
3587
4205
  ...finalOptions,
3588
4206
  url
3589
4207
  },
3590
- player
4208
+ player,
4209
+ i18n
3591
4210
  ),
3592
4211
  getDrmStrategy(
3593
4212
  {
@@ -3610,14 +4229,15 @@ var __publicField = (obj, key, value) => {
3610
4229
  ...plugins ?? [],
3611
4230
  ...drmPlugins ?? [],
3612
4231
  ...abrPlugins ?? []
3613
- ]
4232
+ ],
4233
+ useSrc: !((_a2 = typeStrategy.plugins) == null ? void 0 : _a2.length)
3614
4234
  };
3615
4235
  }
3616
4236
  },
3617
4237
  VePlayerLive
3618
4238
  );
3619
4239
  if (player) {
3620
- const RTMDegrade = (_b = (_a = player == null ? void 0 : player._player) == null ? void 0 : _a.config) == null ? void 0 : _b._RTMdegrade;
4240
+ const RTMDegrade = (_d = (_c = player == null ? void 0 : player._player) == null ? void 0 : _c.config) == null ? void 0 : _d._RTMdegrade;
3621
4241
  if (RTMDegrade) {
3622
4242
  player.emit("degrade", {
3623
4243
  originRtmUrl: RTMDegrade._originRtmUrl,
@@ -3653,6 +4273,7 @@ var __publicField = (obj, key, value) => {
3653
4273
  setModuleSystem("umd");
3654
4274
  const isMseSupported = util.isMseSupported;
3655
4275
  const isSoftDecodeSupported = util.isSoftDecodeSupported;
4276
+ const isMMSSupported = util.isMMSSupported;
3656
4277
  if (typeof VePlayer.registerPlugin !== "undefined") {
3657
4278
  VePlayer.registerPlugin(DynamicModule.BizLive, {
3658
4279
  createLivePlayer
@@ -3674,6 +4295,8 @@ var __publicField = (obj, key, value) => {
3674
4295
  exports2.Sniffer = Sniffer;
3675
4296
  exports2.ZH_CN = ZH_CN;
3676
4297
  exports2.createLivePlayer = createLivePlayer;
4298
+ exports2.isFLVSupported = isFLVSupported;
4299
+ exports2.isMMSSupported = isMMSSupported;
3677
4300
  exports2.isMseSupported = isMseSupported;
3678
4301
  exports2.isRTMSupportCodec = isRTMSupportCodec;
3679
4302
  exports2.isRTMSupported = isRTMSupported;