kucservice 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@
22
22
  const s = t._opt.debugUuid ? `[${t._opt.debugUuid}]` : "";
23
23
  for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
24
24
  a[n - 1] = arguments[n];
25
- console.error(`JbPro${s}[❌❌❌][${i}]`, ...a);
25
+ console.error(`JbPro${s}[❌❌❌1][${i}]`, ...a);
26
26
  };
27
27
  }
28
28
  }
@@ -25597,6 +25597,8 @@
25597
25597
  }), Object.keys(P).forEach((d) => {
25598
25598
  a.on(P[d], (p) => {
25599
25599
  a.debug.warn("player event error", P[d], p);
25600
+ // 报错处理
25601
+ i.callBack && i.callBack({ type: P[d], dom: t })
25600
25602
  });
25601
25603
  });
25602
25604
  }
@@ -26880,7 +26882,7 @@
26880
26882
  class gr extends Ue {
26881
26883
  constructor() {
26882
26884
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
26883
- super(), this._opt = {}, this.$container = null, Object.keys(t).forEach((d) => {
26885
+ super(), this._opt = {}, this.$container = null, this.$callBack = null, Object.keys(t).forEach((d) => {
26884
26886
  if (t[d] === void 0)
26885
26887
  throw new Error(`JbPro option "${d}" can not be undefined`);
26886
26888
  }), this.originalOptions = t;
@@ -26891,6 +26893,7 @@
26891
26893
  return (d == "x" ? p : 3 & p | 8).toString(16);
26892
26894
  })), this.debug = new dn(this);
26893
26895
  let r = t.container;
26896
+ this.$callBack = t.callBack;
26894
26897
  if (typeof t.container == "string" && (r = document.querySelector(t.container)), !r)
26895
26898
  throw this.debug.error("JbPro", "JbPro need container option and now container is", t.container), new Error("JbPro need container option");
26896
26899
  if (s.decoder && ee(s.decoder.indexOf("decoder-pro.js") !== -1 || s.decoder.indexOf("decoder-pro-simd.js") !== -1))
@@ -28375,6 +28378,8 @@ class SA {
28375
28378
  }
28376
28379
  let Xe = document.getElementById(De), Ne = this, Ie = new JessibucaPro({
28377
28380
  container: Xe,
28381
+ callBack: Ne.callBack,
28382
+ //回调函数
28378
28383
  decoder: Ne.decUrl,
28379
28384
  videoBuffer: 0.2,
28380
28385
  // 缓存时长
@@ -28412,6 +28417,7 @@ class SA {
28412
28417
  }
28413
28418
  wbrtc256pull(we, De, at) {
28414
28419
  let Xe = "";
28420
+ let that = this
28415
28421
  if (at)
28416
28422
  Xe = at;
28417
28423
  else {
@@ -28424,12 +28430,14 @@ class SA {
28424
28430
  let Pe = new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP");
28425
28431
  Pe.timeout = 1e3 * 30;
28426
28432
  let Xt = at || Xe, Ji = we + `/api/rtsp/pull?target=${escape(De.rtsp)}&streamPath=path_${Xt}/t${Xt}`;
28427
- Pe.open("get", Ji), Pe.send(null), Pe.onerror = function() {
28433
+ Pe.open("get", Ji), Pe.send(null), Pe.onerror = function(e) {
28428
28434
  console.log("请求失败"), Ie();
28435
+ that.callBack(e || {code: '1006', msg: '视频流请求失败'})
28429
28436
  }, Pe.onprogress = function() {
28430
28437
  console.log("上传中...");
28431
28438
  }, Pe.ontimeout = function() {
28432
28439
  Ie(), console.log("请求超时");
28440
+ that.callBack(e || {code: '1005', msg: '视频流请求超时'})
28433
28441
  }, Pe.onreadystatechange = function() {
28434
28442
  Pe.readyState === 4 && Pe.status == "200" && Ne(Pe.responseText);
28435
28443
  };
@@ -28458,6 +28466,7 @@ class SA {
28458
28466
  console.log("then-->", Rt);
28459
28467
  }).catch((Rt) => {
28460
28468
  console.log("播放错误"), console.log(Rt);
28469
+ this.callBack(Rt)
28461
28470
  });
28462
28471
  }, 100);
28463
28472
  }
@@ -28502,5 +28511,5 @@ class SA {
28502
28511
  await this.pullYt(we, Xt, "post", !0);
28503
28512
  }
28504
28513
  }
28505
-
28514
+
28506
28515
  window.h265 = SA
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kucservice",
3
3
  "private": false,
4
- "version": "1.2.8",
4
+ "version": "1.3.0",
5
5
  "description": "KFT统一通信服务",
6
6
  "main": "dist/kucservice.common.js",
7
7
  "style": "kucservice.css",