@volcengine/veplayer 2.6.0-rc.3 → 2.6.0-rc.5

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