@volcengine/veplayer 2.5.0 → 2.6.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/veplayer",
3
- "version": "2.5.0",
3
+ "version": "2.6.0-rc.1",
4
4
  "main": "./umd/veplayer.production.js",
5
5
  "module": "./esm/veplayer.production.js",
6
6
  "browser": "./umd/veplayer.production.js",
package/umd/index.d.ts CHANGED
@@ -3994,7 +3994,6 @@ declare namespace strategy {
3994
3994
  }
3995
3995
  type StrategyCreator<T, R extends keyof ModulesMap = any> = (options?: T) => Strategy<T, R>;
3996
3996
  const createFlvMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginFlv>;
3997
- const createFlvMssStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginFlv>;
3998
3997
  const createHlsMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginHls>;
3999
3998
  const createSoftDecodeH264Strategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginXgvideo>;
4000
3999
  const createSoftDecodeH265Strategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginXgvideo>;
@@ -48,7 +48,7 @@ var __publicField = (obj, key, value) => {
48
48
  const util$4 = window["VePlayer"].util;
49
49
  const DynamicModule$3 = window["VePlayer"].DynamicModule;
50
50
  const load$3 = window["VePlayer"].load;
51
- const Codec$2 = window["VePlayer"].Codec;
51
+ const Codec$1 = window["VePlayer"].Codec;
52
52
  const Sniffer$3 = window["VePlayer"].Sniffer;
53
53
  const rtmStrategy = {
54
54
  options: {},
@@ -73,9 +73,9 @@ var __publicField = (obj, key, value) => {
73
73
  } = options.rtm || {};
74
74
  const actualFallbackUrl = !enableFallback ? "" : !fallbackUrl && url ? generateFallbackUrl(url) : fallbackUrl;
75
75
  const backupType = actualFallbackUrl && util$4.getStreamType(actualFallbackUrl);
76
- if (backupType === "flv" && util$4.isMseSupported(Codec$2.H264)) {
76
+ if (backupType === "flv" && util$4.isMseSupported(Codec$1.H264)) {
77
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$2.H264)) {
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
79
  backupStrategy = strategy$1.createHlsMseStrategy(options);
80
80
  }
81
81
  const [rtmCdn, backupCdn] = await Promise.all([
@@ -546,9 +546,9 @@ var __publicField = (obj, key, value) => {
546
546
  }
547
547
  return browserInfo;
548
548
  }
549
- var sniffer$1 = {
549
+ var sniffer = {
550
550
  get device() {
551
- var r2 = sniffer$1.os;
551
+ var r2 = sniffer.os;
552
552
  return r2.isPc ? "pc" : "mobile";
553
553
  },
554
554
  get browser() {
@@ -904,7 +904,7 @@ var __publicField = (obj, key, value) => {
904
904
  codec_type: options.codec_type || "h264",
905
905
  width: Math.floor(player.config.width),
906
906
  height: Math.floor(player.config.height),
907
- browser: sniffer$1.browser,
907
+ browser: sniffer.browser,
908
908
  ua: navigator.userAgent,
909
909
  href: window.location.href,
910
910
  timestamp: 0,
@@ -1046,7 +1046,7 @@ var __publicField = (obj, key, value) => {
1046
1046
  var getNetStat = function getNetStat2() {
1047
1047
  if (navgatorOnlineSupported()) {
1048
1048
  if (navigator.onLine) {
1049
- return navigatorConnectionType() || sniffer$1.device;
1049
+ return navigatorConnectionType() || sniffer.device;
1050
1050
  } else {
1051
1051
  return "none";
1052
1052
  }
@@ -1060,7 +1060,7 @@ var __publicField = (obj, key, value) => {
1060
1060
  this.logger = new XgLiveLogger(options);
1061
1061
  this.restart = this.restart.bind(this);
1062
1062
  this.bindUrlChange();
1063
- sniffer$1.browser.includes("Chrome");
1063
+ sniffer.browser.includes("Chrome");
1064
1064
  }
1065
1065
  var _proto = LoggerControl2.prototype;
1066
1066
  _proto.restart = function restart(report_stop) {
@@ -1182,7 +1182,7 @@ var __publicField = (obj, key, value) => {
1182
1182
  var player = options.player;
1183
1183
  var isHLS = player.hlsOps !== void 0;
1184
1184
  this.commonParams = _objectSpread2({
1185
- os: sniffer$1.operation_os
1185
+ os: sniffer.operation_os
1186
1186
  }, getCommonLog(options));
1187
1187
  this.log = Object.assign({}, getDefaultLog());
1188
1188
  var self2 = this;
@@ -1254,17 +1254,17 @@ var __publicField = (obj, key, value) => {
1254
1254
  }
1255
1255
  };
1256
1256
  _proto2.initWindowListener = function initWindowListener() {
1257
- if (sniffer$1.device === "pc") {
1257
+ if (sniffer.device === "pc") {
1258
1258
  window.addEventListener("beforeunload", this.handleUserLeave);
1259
- } else if (sniffer$1.device === "mobile") {
1259
+ } else if (sniffer.device === "mobile") {
1260
1260
  window.addEventListener("beforeunload", this.handleUserLeave);
1261
1261
  window.addEventListener("pagehide", this.handleUserLeave);
1262
1262
  }
1263
1263
  };
1264
1264
  _proto2.removeWindowListener = function removeWindowListener() {
1265
- if (sniffer$1.device === "pc") {
1265
+ if (sniffer.device === "pc") {
1266
1266
  window.removeEventListener("beforeunload", this.handleUserLeave);
1267
- } else if (sniffer$1.device === "mobile") {
1267
+ } else if (sniffer.device === "mobile") {
1268
1268
  window.removeEventListener("beforeunload", this.handleUserLeave);
1269
1269
  window.removeEventListener("pagehide", this.handleUserLeave);
1270
1270
  }
@@ -1948,9 +1948,9 @@ var __publicField = (obj, key, value) => {
1948
1948
  this.handleUserLeave();
1949
1949
  }
1950
1950
  this.destroyed = true;
1951
- if (sniffer$1.device === "pc") {
1951
+ if (sniffer.device === "pc") {
1952
1952
  window.removeEventListener("beforeunload", this.handleUserLeave);
1953
- } else if (sniffer$1.device === "mobile") {
1953
+ } else if (sniffer.device === "mobile") {
1954
1954
  window.removeEventListener("pagehide", this.handleUserLeave);
1955
1955
  }
1956
1956
  videoEvts.forEach(function(name) {
@@ -2994,10 +2994,10 @@ var __publicField = (obj, key, value) => {
2994
2994
  user_id: this._userId,
2995
2995
  device_id: this._deviceId,
2996
2996
  ext: {
2997
- veplayer_version: "2.3.0",
2998
- flv_version: "3.0.21-rc.2",
2999
- hls_version: "3.0.21-rc.2",
3000
- rts_version: "0.2.1-alpha.12"
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"
3001
3001
  }
3002
3002
  });
3003
3003
  }
@@ -3298,160 +3298,6 @@ var __publicField = (obj, key, value) => {
3298
3298
  }
3299
3299
  return {};
3300
3300
  };
3301
- var VERSION_REG = {
3302
- android: /(Android)\s([\d.]+)/,
3303
- ios: /(Version)\/([\d.]+)/
3304
- };
3305
- var H264_MIMETYPES = ["avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "avc1.42E01E", "mp4v.20.8", "mp4v.20.8, mp4a.40.2", "mp4v.20.240, mp4a.40.2"];
3306
- var sniffer = {
3307
- get device() {
3308
- var r2 = sniffer.os;
3309
- return r2.isPc ? "pc" : "mobile";
3310
- },
3311
- get browser() {
3312
- if (typeof navigator === "undefined") {
3313
- return "";
3314
- }
3315
- var ua = navigator.userAgent.toLowerCase();
3316
- var reg = {
3317
- ie: /rv:([\d.]+)\) like gecko/,
3318
- firefox: /firefox\/([\d.]+)/,
3319
- chrome: /chrome\/([\d.]+)/,
3320
- opera: /opera.([\d.]+)/,
3321
- safari: /version\/([\d.]+).*safari/
3322
- };
3323
- return [].concat(Object.keys(reg).filter(function(key) {
3324
- return reg[key].test(ua);
3325
- }))[0];
3326
- },
3327
- get os() {
3328
- if (typeof navigator === "undefined") {
3329
- return {};
3330
- }
3331
- var ua = navigator.userAgent;
3332
- var isWindowsPhone = /(?:Windows Phone)/.test(ua);
3333
- var isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone;
3334
- var isAndroid = /(?:Android)/.test(ua);
3335
- var isFireFox = /(?:Firefox)/.test(ua);
3336
- var isIpad = /(?:iPad|PlayBook)/.test(ua) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
3337
- var isTablet = isIpad || isAndroid && !/(?:Mobile)/.test(ua) || isFireFox && /(?:Tablet)/.test(ua);
3338
- var isPhone = /(?:iPhone)/.test(ua) && !isTablet;
3339
- var isPc = !isPhone && !isAndroid && !isSymbian && !isTablet;
3340
- return {
3341
- isTablet,
3342
- isPhone,
3343
- isIpad,
3344
- isIos: isPhone || isIpad,
3345
- isAndroid,
3346
- isPc,
3347
- isSymbian,
3348
- isWindowsPhone,
3349
- isFireFox
3350
- };
3351
- },
3352
- get osVersion() {
3353
- if (typeof navigator === "undefined") {
3354
- return 0;
3355
- }
3356
- var ua = navigator.userAgent;
3357
- var reg = "";
3358
- if (/(?:iPhone)|(?:iPad|PlayBook)/.test(ua)) {
3359
- reg = VERSION_REG.ios;
3360
- } else {
3361
- reg = VERSION_REG.android;
3362
- }
3363
- var _match = reg ? reg.exec(ua) : [];
3364
- if (_match && _match.length >= 3) {
3365
- var version = _match[2].split(".");
3366
- return version.length > 0 ? parseInt(version[0]) : 0;
3367
- }
3368
- return 0;
3369
- },
3370
- get isWeixin() {
3371
- if (typeof navigator === "undefined") {
3372
- return false;
3373
- }
3374
- var reg = /(micromessenger)\/([\d.]+)/;
3375
- var match = reg.exec(navigator.userAgent.toLocaleLowerCase());
3376
- if (match) {
3377
- return true;
3378
- }
3379
- return false;
3380
- },
3381
- isSupportMP4: function isSupportMP4() {
3382
- var result = {
3383
- isSupport: false,
3384
- mime: ""
3385
- };
3386
- if (typeof document === "undefined") {
3387
- return result;
3388
- }
3389
- if (this.supportResult) {
3390
- return this.supportResult;
3391
- }
3392
- var a2 = document.createElement("video");
3393
- if (typeof a2.canPlayType === "function") {
3394
- H264_MIMETYPES.map(function(key) {
3395
- if (a2.canPlayType('video/mp4; codecs="'.concat(key, '"')) === "probably") {
3396
- result.isSupport = true;
3397
- result.mime += "||".concat(key);
3398
- }
3399
- });
3400
- }
3401
- this.supportResult = result;
3402
- a2 = null;
3403
- return result;
3404
- },
3405
- isMSESupport: function isMSESupport() {
3406
- var mime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';
3407
- if (typeof MediaSource === "undefined" || !MediaSource)
3408
- return false;
3409
- try {
3410
- return MediaSource.isTypeSupported(mime);
3411
- } catch (error2) {
3412
- this._logger.error(mime, error2);
3413
- return false;
3414
- }
3415
- },
3416
- isHevcSupported: function isHevcSupported() {
3417
- if (typeof MediaSource === "undefined" || !MediaSource.isTypeSupported) {
3418
- return false;
3419
- }
3420
- return MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"') || MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"') || MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"') || MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"');
3421
- },
3422
- probeConfigSupported: function probeConfigSupported(info) {
3423
- var defaults = {
3424
- supported: false,
3425
- smooth: false,
3426
- powerEfficient: false
3427
- };
3428
- if (!info || typeof navigator === "undefined") {
3429
- return Promise.resolve(defaults);
3430
- }
3431
- if (navigator.mediaCapabilities && navigator.mediaCapabilities.decodingInfo) {
3432
- return navigator.mediaCapabilities.decodingInfo(info);
3433
- } else {
3434
- var videoConfig = info.video || {};
3435
- var audioConfig = info.audio || {};
3436
- try {
3437
- var videoSupported = MediaSource.isTypeSupported(videoConfig.contentType);
3438
- var audioSupported = MediaSource.isTypeSupported(audioConfig.contentType);
3439
- return Promise.resolve({
3440
- supported: videoSupported && audioSupported,
3441
- smooth: false,
3442
- powerEfficient: false
3443
- });
3444
- } catch (e2) {
3445
- return Promise.resolve(defaults);
3446
- }
3447
- }
3448
- }
3449
- };
3450
- var Codec$1 = /* @__PURE__ */ ((Codec2) => {
3451
- Codec2["H265"] = "h265";
3452
- Codec2["H264"] = "h264";
3453
- return Codec2;
3454
- })(Codec$1 || {});
3455
3301
  function isType(suffix) {
3456
3302
  return function(url) {
3457
3303
  return url == null ? void 0 : url.split("?")[0].toLowerCase().includes(suffix);
@@ -3480,15 +3326,6 @@ var __publicField = (obj, key, value) => {
3480
3326
  }
3481
3327
  return "unknown";
3482
3328
  }
3483
- function isMseSupported$1(codec = Codec$1.H264) {
3484
- if (codec === Codec$1.H265) {
3485
- return sniffer.isHevcSupported();
3486
- }
3487
- return sniffer.isMSESupport();
3488
- }
3489
- function isMMSSupported$1() {
3490
- return typeof ManagedMediaSource !== "undefined";
3491
- }
3492
3329
  const DynamicModule$1 = window["VePlayer"].DynamicModule;
3493
3330
  const load$1 = window["VePlayer"].load;
3494
3331
  const getAbrStrategy = async (options) => {
@@ -3793,9 +3630,6 @@ var __publicField = (obj, key, value) => {
3793
3630
  }
3794
3631
  return player;
3795
3632
  }
3796
- function isFLVSupported() {
3797
- return isMseSupported$1() || isMMSSupported$1();
3798
- }
3799
3633
  var live = /* @__PURE__ */ Object.freeze({
3800
3634
  __proto__: null,
3801
3635
  ErrorCode,
@@ -3819,7 +3653,6 @@ var __publicField = (obj, key, value) => {
3819
3653
  setModuleSystem("umd");
3820
3654
  const isMseSupported = util.isMseSupported;
3821
3655
  const isSoftDecodeSupported = util.isSoftDecodeSupported;
3822
- const isMMSSupported = util.isMMSSupported;
3823
3656
  if (typeof VePlayer.registerPlugin !== "undefined") {
3824
3657
  VePlayer.registerPlugin(DynamicModule.BizLive, {
3825
3658
  createLivePlayer
@@ -3841,8 +3674,6 @@ var __publicField = (obj, key, value) => {
3841
3674
  exports2.Sniffer = Sniffer;
3842
3675
  exports2.ZH_CN = ZH_CN;
3843
3676
  exports2.createLivePlayer = createLivePlayer;
3844
- exports2.isFLVSupported = isFLVSupported;
3845
- exports2.isMMSSupported = isMMSSupported;
3846
3677
  exports2.isMseSupported = isMseSupported;
3847
3678
  exports2.isRTMSupportCodec = isRTMSupportCodec;
3848
3679
  exports2.isRTMSupported = isRTMSupported;