@besovideo/webrtc-player 0.9.85 → 0.9.87

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.
@@ -117,7 +117,7 @@ var bvPlayerCore = (() => {
117
117
  var define_processenv_default;
118
118
  var init_define_processenv = __esm({
119
119
  "<define:processenv>"() {
120
- define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.85", PROJECT_NAMESPACE: "bvplayer" };
120
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.87", PROJECT_NAMESPACE: "bvplayer" };
121
121
  }
122
122
  });
123
123
 
@@ -13416,6 +13416,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
13416
13416
  };
13417
13417
  var Events = class {
13418
13418
  constructor() {
13419
+ this.isDisable = false;
13419
13420
  this._notifier = new Notifier();
13420
13421
  }
13421
13422
  addEventListener(name, callBack) {
@@ -13433,11 +13434,22 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
13433
13434
  }
13434
13435
  dispatch(name, event) {
13435
13436
  var _a;
13436
- (_a = this._notifier) == null ? void 0 : _a.publish(name, event);
13437
+ if (!this.isDisable) {
13438
+ (_a = this._notifier) == null ? void 0 : _a.publish(name, event);
13439
+ }
13437
13440
  }
13438
13441
  dispatchSync(name, event) {
13439
13442
  return __async(this, null, function* () {
13440
- yield this._notifier.publishSync(name, event);
13443
+ if (!this.isDisable) {
13444
+ yield this._notifier.publishSync(name, event);
13445
+ }
13446
+ });
13447
+ }
13448
+ noDispathHandle(handle2) {
13449
+ return __async(this, null, function* () {
13450
+ this.isDisable = true;
13451
+ yield handle2();
13452
+ this.isDisable = false;
13441
13453
  });
13442
13454
  }
13443
13455
  };
@@ -22096,7 +22108,8 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
22096
22108
  "lian-jie-yi-wai-guan-bi": "Unexpected closure",
22097
22109
  "da-kai-chuan-shu-tong-dao-shi-bai": "Failed to open transmission channel",
22098
22110
  "hui-fang-wen-jian-bu-cun-zai": "File Not Found",
22099
- "shi-pin-jie-ma-shi-bai": "Video decode fail"
22111
+ "shi-pin-jie-ma-shi-bai": "Video decode fail",
22112
+ "hui-fang-chu-xian-wen-ti": "There is a problem with playback:"
22100
22113
  };
22101
22114
 
22102
22115
  // src/locales/zh.json
@@ -22156,7 +22169,8 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
22156
22169
  "lian-jie-yi-wai-guan-bi": "\u8FDE\u63A5\u610F\u5916\u5173\u95ED",
22157
22170
  "da-kai-chuan-shu-tong-dao-shi-bai": "\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25",
22158
22171
  "hui-fang-wen-jian-bu-cun-zai": "\u56DE\u653E\u6587\u4EF6\u4E0D\u5B58\u5728",
22159
- "shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25"
22172
+ "shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25",
22173
+ "hui-fang-chu-xian-wen-ti": "\u56DE\u653E\u51FA\u73B0\u95EE\u9898\uFF1A"
22160
22174
  };
22161
22175
 
22162
22176
  // src/locales/i18n.ts
@@ -22307,7 +22321,9 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
22307
22321
  open(muted = false) {
22308
22322
  return __async(this, null, function* () {
22309
22323
  logger_default.debug("BvWebrtc open");
22310
- yield this.close();
22324
+ yield this.noDispathHandle(() => __async(this, null, function* () {
22325
+ yield this.close();
22326
+ }));
22311
22327
  this.player.mask.visible = false;
22312
22328
  this.player.mask.text = t("connecting");
22313
22329
  this.player.mute(!!muted);
@@ -24427,6 +24443,14 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
24427
24443
  svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><g fill="none" stroke="black" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity="0.3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg>`;
24428
24444
  return svgLoading;
24429
24445
  }
24446
+ function CreateLoadingSvgWhite() {
24447
+ const svgLoading = document.createElement("div");
24448
+ svgLoading.style.position = "absolute";
24449
+ svgLoading.style.top = "calc(50% - 48px)";
24450
+ svgLoading.style.left = "calc(50% - 48px)";
24451
+ svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><rect width="24" height="24" fill="none"/><g fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity="0.45" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"/></path></g></svg>`;
24452
+ return svgLoading;
24453
+ }
24430
24454
  var PlaybackBar = class extends Plugin {
24431
24455
  constructor() {
24432
24456
  super(PLUGIN_NAME_PLAYBAR, "div", core_default.style.cls("blaybackbar"));
@@ -24437,6 +24461,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
24437
24461
  this.isShowControls = true;
24438
24462
  this.svgPause = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, /* @__PURE__ */ jsx_default.h("path", { fill: "currentColor", d: "M6 5h2v14H6zm10 0h2v14h-2z" })));
24439
24463
  this.svgPlay = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 32 32" }, /* @__PURE__ */ jsx_default.h("path", { fill: "white", d: "M6.684 25.682L24.316 15.5L6.684 5.318z" })));
24464
+ this.svgLoadingWhite = CreateLoadingSvgWhite();
24440
24465
  this.svgLoading = CreateLoadingSvg();
24441
24466
  this.volumeCurrent = 100;
24442
24467
  this.svgSoundZero = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", onclick: () => {
@@ -24587,6 +24612,16 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
24587
24612
  });
24588
24613
  }
24589
24614
  }
24615
+ showInitLoading(isShow) {
24616
+ var _a;
24617
+ if (isShow) {
24618
+ core_default.dom.append(this._container, this.svgLoadingWhite);
24619
+ } else {
24620
+ if ((_a = this.svgLoadingWhite) == null ? void 0 : _a.parentNode) {
24621
+ core_default.dom.removeSelf(this.svgLoadingWhite);
24622
+ }
24623
+ }
24624
+ }
24590
24625
  showLoading(isShow) {
24591
24626
  var _a;
24592
24627
  if (isShow) {
@@ -25319,14 +25354,17 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25319
25354
  let hplayer = void 0;
25320
25355
  const handle2 = {};
25321
25356
  let type = type1;
25357
+ let onOpenHandleOver = null;
25322
25358
  const instance2 = {
25359
+ inBusy: false,
25323
25360
  videoFit: "contain",
25324
25361
  open() {
25325
25362
  return __async(this, null, function* () {
25326
25363
  var _a2, _b;
25327
- if (hplayer) {
25364
+ if (instance2.inBusy) {
25328
25365
  return;
25329
25366
  }
25367
+ instance2.inBusy = true;
25330
25368
  const audioWaveShow = new MediaStreamAudioWavePlaybackShow();
25331
25369
  const markerHandle = new MarkerHandle({
25332
25370
  token,
@@ -25422,6 +25460,21 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25422
25460
  player.mask.visible = true;
25423
25461
  return r(false);
25424
25462
  }
25463
+ videoEle.onerror = () => __async(this, null, function* () {
25464
+ var _a3;
25465
+ player.mask.text = t("hui-fang-chu-xian-wen-ti") + ((_a3 = videoEle.error) == null ? void 0 : _a3.code);
25466
+ player.mask.visible = true;
25467
+ if (instance2.protocol == "auto") {
25468
+ instance2.inBusy = true;
25469
+ barHandle.showInitLoading(true);
25470
+ yield RunHandle("ws-bvrtc");
25471
+ barHandle.showInitLoading(false);
25472
+ instance2.inBusy = false;
25473
+ }
25474
+ });
25475
+ removeHooks.push(() => {
25476
+ videoEle.onerror = null;
25477
+ });
25425
25478
  videoEle.src = srcFile;
25426
25479
  videoEle.controls = false;
25427
25480
  removeHooks.push(
@@ -25676,6 +25729,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25676
25729
  }
25677
25730
  return false;
25678
25731
  }
25732
+ barHandle.showInitLoading(true);
25679
25733
  if (this.protocol == "auto") {
25680
25734
  if (!(yield RunHandle("web"))) {
25681
25735
  yield RunHandle("ws-bvrtc");
@@ -25683,12 +25737,30 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25683
25737
  } else {
25684
25738
  yield RunHandle(this.protocol);
25685
25739
  }
25740
+ barHandle.showInitLoading(false);
25741
+ instance2.inBusy = false;
25686
25742
  });
25687
25743
  },
25688
25744
  close() {
25689
25745
  return __async(this, null, function* () {
25690
25746
  var _a2;
25691
- (_a2 = handle2.close) == null ? void 0 : _a2.call(handle2);
25747
+ if (!instance2.inBusy) {
25748
+ (_a2 = handle2.close) == null ? void 0 : _a2.call(handle2);
25749
+ } else if (instance2.inBusy) {
25750
+ yield new Promise((r) => {
25751
+ const oriOnOpenHandleOver = onOpenHandleOver;
25752
+ onOpenHandleOver = () => {
25753
+ var _a3;
25754
+ onOpenHandleOver = null;
25755
+ try {
25756
+ oriOnOpenHandleOver == null ? void 0 : oriOnOpenHandleOver();
25757
+ (_a3 = handle2.close) == null ? void 0 : _a3.call(handle2);
25758
+ } catch (e) {
25759
+ }
25760
+ r();
25761
+ };
25762
+ });
25763
+ }
25692
25764
  });
25693
25765
  },
25694
25766
  pause() {
@@ -25717,6 +25789,9 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25717
25789
  this.videoFit = fit;
25718
25790
  },
25719
25791
  setProtocol: function(protocol) {
25792
+ if (this.protocol == protocol || this.inBusy) {
25793
+ return;
25794
+ }
25720
25795
  this.close();
25721
25796
  this.protocol = (puOption == null ? void 0 : puOption.puId) ? protocol : protocol;
25722
25797
  this.open();
package/dist/main.es.js CHANGED
@@ -111,7 +111,7 @@ var __async = (__this, __arguments, generator) => {
111
111
  var define_processenv_default;
112
112
  var init_define_processenv = __esm({
113
113
  "<define:processenv>"() {
114
- define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.85", PROJECT_NAMESPACE: "bvplayer" };
114
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.87", PROJECT_NAMESPACE: "bvplayer" };
115
115
  }
116
116
  });
117
117
 
@@ -13400,6 +13400,7 @@ var IDataHandle = class {
13400
13400
  };
13401
13401
  var Events = class {
13402
13402
  constructor() {
13403
+ this.isDisable = false;
13403
13404
  this._notifier = new Notifier();
13404
13405
  }
13405
13406
  addEventListener(name, callBack) {
@@ -13417,11 +13418,22 @@ var Events = class {
13417
13418
  }
13418
13419
  dispatch(name, event) {
13419
13420
  var _a;
13420
- (_a = this._notifier) == null ? void 0 : _a.publish(name, event);
13421
+ if (!this.isDisable) {
13422
+ (_a = this._notifier) == null ? void 0 : _a.publish(name, event);
13423
+ }
13421
13424
  }
13422
13425
  dispatchSync(name, event) {
13423
13426
  return __async(this, null, function* () {
13424
- yield this._notifier.publishSync(name, event);
13427
+ if (!this.isDisable) {
13428
+ yield this._notifier.publishSync(name, event);
13429
+ }
13430
+ });
13431
+ }
13432
+ noDispathHandle(handle2) {
13433
+ return __async(this, null, function* () {
13434
+ this.isDisable = true;
13435
+ yield handle2();
13436
+ this.isDisable = false;
13425
13437
  });
13426
13438
  }
13427
13439
  };
@@ -22080,7 +22092,8 @@ var en_default = {
22080
22092
  "lian-jie-yi-wai-guan-bi": "Unexpected closure",
22081
22093
  "da-kai-chuan-shu-tong-dao-shi-bai": "Failed to open transmission channel",
22082
22094
  "hui-fang-wen-jian-bu-cun-zai": "File Not Found",
22083
- "shi-pin-jie-ma-shi-bai": "Video decode fail"
22095
+ "shi-pin-jie-ma-shi-bai": "Video decode fail",
22096
+ "hui-fang-chu-xian-wen-ti": "There is a problem with playback:"
22084
22097
  };
22085
22098
 
22086
22099
  // src/locales/zh.json
@@ -22140,7 +22153,8 @@ var zh_default = {
22140
22153
  "lian-jie-yi-wai-guan-bi": "\u8FDE\u63A5\u610F\u5916\u5173\u95ED",
22141
22154
  "da-kai-chuan-shu-tong-dao-shi-bai": "\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25",
22142
22155
  "hui-fang-wen-jian-bu-cun-zai": "\u56DE\u653E\u6587\u4EF6\u4E0D\u5B58\u5728",
22143
- "shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25"
22156
+ "shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25",
22157
+ "hui-fang-chu-xian-wen-ti": "\u56DE\u653E\u51FA\u73B0\u95EE\u9898\uFF1A"
22144
22158
  };
22145
22159
 
22146
22160
  // src/locales/i18n.ts
@@ -22291,7 +22305,9 @@ var BvWebrtcInstance = class extends CommonInstance {
22291
22305
  open(muted = false) {
22292
22306
  return __async(this, null, function* () {
22293
22307
  logger_default.debug("BvWebrtc open");
22294
- yield this.close();
22308
+ yield this.noDispathHandle(() => __async(this, null, function* () {
22309
+ yield this.close();
22310
+ }));
22295
22311
  this.player.mask.visible = false;
22296
22312
  this.player.mask.text = t("connecting");
22297
22313
  this.player.mute(!!muted);
@@ -24411,6 +24427,14 @@ function CreateLoadingSvg() {
24411
24427
  svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><g fill="none" stroke="black" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity="0.3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg>`;
24412
24428
  return svgLoading;
24413
24429
  }
24430
+ function CreateLoadingSvgWhite() {
24431
+ const svgLoading = document.createElement("div");
24432
+ svgLoading.style.position = "absolute";
24433
+ svgLoading.style.top = "calc(50% - 48px)";
24434
+ svgLoading.style.left = "calc(50% - 48px)";
24435
+ svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><rect width="24" height="24" fill="none"/><g fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity="0.45" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"/></path></g></svg>`;
24436
+ return svgLoading;
24437
+ }
24414
24438
  var PlaybackBar = class extends Plugin {
24415
24439
  constructor() {
24416
24440
  super(PLUGIN_NAME_PLAYBAR, "div", core_default.style.cls("blaybackbar"));
@@ -24421,6 +24445,7 @@ var PlaybackBar = class extends Plugin {
24421
24445
  this.isShowControls = true;
24422
24446
  this.svgPause = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, /* @__PURE__ */ jsx_default.h("path", { fill: "currentColor", d: "M6 5h2v14H6zm10 0h2v14h-2z" })));
24423
24447
  this.svgPlay = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 32 32" }, /* @__PURE__ */ jsx_default.h("path", { fill: "white", d: "M6.684 25.682L24.316 15.5L6.684 5.318z" })));
24448
+ this.svgLoadingWhite = CreateLoadingSvgWhite();
24424
24449
  this.svgLoading = CreateLoadingSvg();
24425
24450
  this.volumeCurrent = 100;
24426
24451
  this.svgSoundZero = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", onclick: () => {
@@ -24571,6 +24596,16 @@ var PlaybackBar = class extends Plugin {
24571
24596
  });
24572
24597
  }
24573
24598
  }
24599
+ showInitLoading(isShow) {
24600
+ var _a;
24601
+ if (isShow) {
24602
+ core_default.dom.append(this._container, this.svgLoadingWhite);
24603
+ } else {
24604
+ if ((_a = this.svgLoadingWhite) == null ? void 0 : _a.parentNode) {
24605
+ core_default.dom.removeSelf(this.svgLoadingWhite);
24606
+ }
24607
+ }
24608
+ }
24574
24609
  showLoading(isShow) {
24575
24610
  var _a;
24576
24611
  if (isShow) {
@@ -25303,14 +25338,17 @@ var PlayBack = (props) => {
25303
25338
  let hplayer = void 0;
25304
25339
  const handle2 = {};
25305
25340
  let type = type1;
25341
+ let onOpenHandleOver = null;
25306
25342
  const instance2 = {
25343
+ inBusy: false,
25307
25344
  videoFit: "contain",
25308
25345
  open() {
25309
25346
  return __async(this, null, function* () {
25310
25347
  var _a2, _b;
25311
- if (hplayer) {
25348
+ if (instance2.inBusy) {
25312
25349
  return;
25313
25350
  }
25351
+ instance2.inBusy = true;
25314
25352
  const audioWaveShow = new MediaStreamAudioWavePlaybackShow();
25315
25353
  const markerHandle = new MarkerHandle({
25316
25354
  token,
@@ -25406,6 +25444,21 @@ var PlayBack = (props) => {
25406
25444
  player.mask.visible = true;
25407
25445
  return r(false);
25408
25446
  }
25447
+ videoEle.onerror = () => __async(this, null, function* () {
25448
+ var _a3;
25449
+ player.mask.text = t("hui-fang-chu-xian-wen-ti") + ((_a3 = videoEle.error) == null ? void 0 : _a3.code);
25450
+ player.mask.visible = true;
25451
+ if (instance2.protocol == "auto") {
25452
+ instance2.inBusy = true;
25453
+ barHandle.showInitLoading(true);
25454
+ yield RunHandle("ws-bvrtc");
25455
+ barHandle.showInitLoading(false);
25456
+ instance2.inBusy = false;
25457
+ }
25458
+ });
25459
+ removeHooks.push(() => {
25460
+ videoEle.onerror = null;
25461
+ });
25409
25462
  videoEle.src = srcFile;
25410
25463
  videoEle.controls = false;
25411
25464
  removeHooks.push(
@@ -25660,6 +25713,7 @@ var PlayBack = (props) => {
25660
25713
  }
25661
25714
  return false;
25662
25715
  }
25716
+ barHandle.showInitLoading(true);
25663
25717
  if (this.protocol == "auto") {
25664
25718
  if (!(yield RunHandle("web"))) {
25665
25719
  yield RunHandle("ws-bvrtc");
@@ -25667,12 +25721,30 @@ var PlayBack = (props) => {
25667
25721
  } else {
25668
25722
  yield RunHandle(this.protocol);
25669
25723
  }
25724
+ barHandle.showInitLoading(false);
25725
+ instance2.inBusy = false;
25670
25726
  });
25671
25727
  },
25672
25728
  close() {
25673
25729
  return __async(this, null, function* () {
25674
25730
  var _a2;
25675
- (_a2 = handle2.close) == null ? void 0 : _a2.call(handle2);
25731
+ if (!instance2.inBusy) {
25732
+ (_a2 = handle2.close) == null ? void 0 : _a2.call(handle2);
25733
+ } else if (instance2.inBusy) {
25734
+ yield new Promise((r) => {
25735
+ const oriOnOpenHandleOver = onOpenHandleOver;
25736
+ onOpenHandleOver = () => {
25737
+ var _a3;
25738
+ onOpenHandleOver = null;
25739
+ try {
25740
+ oriOnOpenHandleOver == null ? void 0 : oriOnOpenHandleOver();
25741
+ (_a3 = handle2.close) == null ? void 0 : _a3.call(handle2);
25742
+ } catch (e) {
25743
+ }
25744
+ r();
25745
+ };
25746
+ });
25747
+ }
25676
25748
  });
25677
25749
  },
25678
25750
  pause() {
@@ -25701,6 +25773,9 @@ var PlayBack = (props) => {
25701
25773
  this.videoFit = fit;
25702
25774
  },
25703
25775
  setProtocol: function(protocol) {
25776
+ if (this.protocol == protocol || this.inBusy) {
25777
+ return;
25778
+ }
25704
25779
  this.close();
25705
25780
  this.protocol = (puOption == null ? void 0 : puOption.puId) ? protocol : protocol;
25706
25781
  this.open();
@@ -36,6 +36,7 @@ interface IPlaybackInstance extends IComponentInstance {
36
36
  setProtocol: (protocol: IPlaybackPlayType) => void;
37
37
  videoFit: keyof IVideoFits;
38
38
  protocol: IPlaybackPlayType;
39
+ inBusy: boolean;
39
40
  }
40
41
  declare type helperFunc = {
41
42
  getDefaultProps: () => Partial<IPlaybackProps>;
@@ -53,6 +53,8 @@ export declare class Events<M extends IEventMap> {
53
53
  clearEventListener<K extends keyof M>(name?: K): void;
54
54
  dispatch<K extends keyof M>(name: K, event?: M[K]): void;
55
55
  dispatchSync<K extends keyof M>(name: K, event?: M[K]): Promise<void>;
56
+ private isDisable;
57
+ noDispathHandle(handle: () => (Promise<void> | void)): Promise<void>;
56
58
  }
57
59
  export declare class DomEventStore {
58
60
  private _store;
@@ -40,8 +40,10 @@ declare class PlaybackBar extends Plugin<HTMLDivElement, IPlaybackBarEventMap> {
40
40
  private onClickJump;
41
41
  private svgPause;
42
42
  private svgPlay;
43
+ private svgLoadingWhite;
44
+ showInitLoading(isShow: boolean): void;
43
45
  private svgLoading;
44
- private showLoading;
46
+ showLoading(isShow: boolean): void;
45
47
  jumpToTargetSeconds(params: IJumpEventParams): void;
46
48
  private onSooundClick;
47
49
  private onVolumeChange;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.9.85",
3
+ "version": "0.9.87",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",