@besovideo/webrtc-player 0.8.51 → 0.8.53

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.
@@ -1,4 +1,4 @@
1
- /* sass-plugin-0:E:\codeGit\bvweb-player\node_modules\tippy.js\dist\tippy.css */
1
+ /* sass-plugin-0:G:\develop\bvweb-player\node_modules\tippy.js\dist\tippy.css */
2
2
  .tippy-box[data-animation=fade][data-state=hidden] {
3
3
  opacity: 0;
4
4
  }
@@ -81,7 +81,7 @@
81
81
  z-index: 1;
82
82
  }
83
83
 
84
- /* sass-plugin-0:E:\codeGit\bvweb-player\node_modules\tippy.js\animations\shift-away.css */
84
+ /* sass-plugin-0:G:\develop\bvweb-player\node_modules\tippy.js\animations\shift-away.css */
85
85
  .tippy-box[data-animation=shift-away][data-state=hidden] {
86
86
  opacity: 0;
87
87
  }
@@ -98,7 +98,7 @@
98
98
  transform: translateX(-10px);
99
99
  }
100
100
 
101
- /* sass-plugin-0:E:\codeGit\bvweb-player\src\styles\contextmenu.css */
101
+ /* sass-plugin-0:G:\develop\bvweb-player\src\styles\contextmenu.css */
102
102
  .cm_container {
103
103
  position: absolute;
104
104
  opacity: 0;
@@ -192,7 +192,7 @@
192
192
  background-color: inherit;
193
193
  }
194
194
 
195
- /* sass-plugin-0:E:\codeGit\bvweb-player\src\styles\main.scss */
195
+ /* sass-plugin-0:G:\develop\bvweb-player\src\styles\main.scss */
196
196
  .bvplayer-common-flex-space {
197
197
  display: inline-block;
198
198
  flex: 1;
@@ -105,7 +105,7 @@ var bvPlayerCore = (() => {
105
105
  var define_processenv_default;
106
106
  var init_define_processenv = __esm({
107
107
  "<define:processenv>"() {
108
- define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.50", PROJECT_NAMESPACE: "bvplayer" };
108
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.53", PROJECT_NAMESPACE: "bvplayer" };
109
109
  }
110
110
  });
111
111
 
@@ -11168,6 +11168,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
11168
11168
  }
11169
11169
 
11170
11170
  // src/templates/icons.tsx
11171
+ init_jsx();
11171
11172
  var Icon = ({ children, className, style: style2 }) => {
11172
11173
  const clsName = core_default.style.cls(["icon", className]);
11173
11174
  return /* @__PURE__ */ jsx.h("span", { className: clsName, style: style2, withNamespace: true }, children);
@@ -11479,7 +11480,8 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
11479
11480
  // src/components/subComponent/mikeButton.tsx
11480
11481
  init_define_processenv();
11481
11482
  init_jsx_shim();
11482
- var _onIcon, _offIcon, _talk, _intercom, _type, _onTalkStart, onTalkStart_fn, _onTalkEnd, onTalkEnd_fn;
11483
+ init_jsx();
11484
+ var _onIcon, _offIcon, _isBusy, _talk, _intercom, _type, _onTalkStart, onTalkStart_fn, _onTalkEnd, onTalkEnd_fn;
11483
11485
  var MikeButton = class extends HTMLElement {
11484
11486
  constructor() {
11485
11487
  super();
@@ -11488,6 +11490,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
11488
11490
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields weakmep实现的私有变量
11489
11491
  __privateAdd(this, _onIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOn, null)));
11490
11492
  __privateAdd(this, _offIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOff, null)));
11493
+ __privateAdd(this, _isBusy, false);
11491
11494
  //是否正在喊话
11492
11495
  __privateAdd(this, _talk, false);
11493
11496
  // 麦克风实例
@@ -11496,7 +11499,9 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
11496
11499
  __privateAdd(this, _type, void 0);
11497
11500
  this.attachShadow({ mode: "open" });
11498
11501
  this.addEventListener("click", () => {
11499
- this.talking = !this.talking;
11502
+ if (!__privateGet(this, _isBusy)) {
11503
+ this.talking = !this.talking;
11504
+ }
11500
11505
  });
11501
11506
  this.talking = false;
11502
11507
  }
@@ -11506,11 +11511,14 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
11506
11511
  set talking(state) {
11507
11512
  if (__privateGet(this, _talk) === state)
11508
11513
  return;
11509
- __privateSet(this, _talk, state);
11510
- if (state) {
11511
- __privateMethod(this, _onTalkStart, onTalkStart_fn).call(this);
11512
- } else {
11513
- __privateMethod(this, _onTalkEnd, onTalkEnd_fn).call(this);
11514
+ if (!__privateGet(this, _isBusy)) {
11515
+ __privateSet(this, _isBusy, true);
11516
+ __privateSet(this, _talk, state);
11517
+ let pm;
11518
+ pm = state ? __privateMethod(this, _onTalkStart, onTalkStart_fn).call(this) : __privateMethod(this, _onTalkEnd, onTalkEnd_fn).call(this);
11519
+ pm.finally(() => {
11520
+ __privateSet(this, _isBusy, false);
11521
+ });
11514
11522
  }
11515
11523
  }
11516
11524
  set intercom(ins) {
@@ -11530,22 +11538,27 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
11530
11538
  };
11531
11539
  _onIcon = new WeakMap();
11532
11540
  _offIcon = new WeakMap();
11541
+ _isBusy = new WeakMap();
11533
11542
  _talk = new WeakMap();
11534
11543
  _intercom = new WeakMap();
11535
11544
  _type = new WeakMap();
11536
11545
  _onTalkStart = new WeakSet();
11537
11546
  onTalkStart_fn = function() {
11538
- var _a;
11539
- if (!__privateGet(this, _intercom))
11540
- return;
11541
- (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.open(void 0, __privateGet(this, _type));
11542
- __privateGet(this, _offIcon).replaceWith(__privateGet(this, _onIcon));
11547
+ return __async(this, null, function* () {
11548
+ var _a;
11549
+ if (!__privateGet(this, _intercom))
11550
+ return;
11551
+ yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.open(void 0, __privateGet(this, _type));
11552
+ __privateGet(this, _offIcon).replaceWith(__privateGet(this, _onIcon));
11553
+ });
11543
11554
  };
11544
11555
  _onTalkEnd = new WeakSet();
11545
11556
  onTalkEnd_fn = function() {
11546
- var _a;
11547
- (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.close();
11548
- __privateGet(this, _onIcon).replaceWith(__privateGet(this, _offIcon));
11557
+ return __async(this, null, function* () {
11558
+ var _a;
11559
+ yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.close();
11560
+ __privateGet(this, _onIcon).replaceWith(__privateGet(this, _offIcon));
11561
+ });
11549
11562
  };
11550
11563
  customElements.define("mike-button", MikeButton);
11551
11564
 
@@ -17784,15 +17797,17 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
17784
17797
  }
17785
17798
  };
17786
17799
  player.spinner.spin = false;
17787
- player.addEventListener("close", () => __async(void 0, null, function* () {
17800
+ const closeHandle = () => __async(void 0, null, function* () {
17788
17801
  if (!hplayer)
17789
17802
  return;
17803
+ player.removeEventListener("close", closeHandle);
17790
17804
  hplayer.close();
17791
17805
  yield dialog_default.closeDialogs(
17792
17806
  [hplayer.getDialogID()],
17793
17807
  sdpFetcher.token
17794
17808
  );
17795
- }));
17809
+ });
17810
+ player.addEventListener("close", closeHandle);
17796
17811
  } catch (e2) {
17797
17812
  console.error("\u51FA\u9519", e2);
17798
17813
  player.mask.visible = true;
@@ -18283,6 +18298,7 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
18283
18298
  };
18284
18299
 
18285
18300
  // src/components/puPlayer.tsx
18301
+ init_jsx();
18286
18302
  var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescription) => __async(void 0, null, function* () {
18287
18303
  if (localDescription.type !== "offer")
18288
18304
  return void 0;
@@ -18704,8 +18720,9 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
18704
18720
  });
18705
18721
  };
18706
18722
  player.spinner.spin = false;
18707
- player.addEventListener("close", () => __async(this, null, function* () {
18723
+ const closeHandle = () => __async(this, null, function* () {
18708
18724
  var _a3;
18725
+ player.removeEventListener("close", closeHandle);
18709
18726
  (_a3 = player.panel) == null ? void 0 : _a3.controller.removeEventListener(
18710
18727
  "volume",
18711
18728
  updateVolumeWrapper
@@ -18721,7 +18738,8 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
18721
18738
  yield new Promise((r) => {
18722
18739
  setTimeout(r, 100);
18723
18740
  });
18724
- }));
18741
+ });
18742
+ player.addEventListener("close", closeHandle);
18725
18743
  onConnected && onConnected();
18726
18744
  reconnectMgr == null ? void 0 : reconnectMgr.cancelReconnect();
18727
18745
  dialog_default.closeDialogs([dialogId || ""], tempToken || "");
package/dist/main.es.css CHANGED
@@ -1,4 +1,4 @@
1
- /* sass-plugin-1:E:\codeGit\bvweb-player\node_modules\tippy.js\dist\tippy.css */
1
+ /* sass-plugin-1:G:\develop\bvweb-player\node_modules\tippy.js\dist\tippy.css */
2
2
  .tippy-box[data-animation=fade][data-state=hidden] {
3
3
  opacity: 0;
4
4
  }
@@ -81,7 +81,7 @@
81
81
  z-index: 1;
82
82
  }
83
83
 
84
- /* sass-plugin-1:E:\codeGit\bvweb-player\node_modules\tippy.js\animations\shift-away.css */
84
+ /* sass-plugin-1:G:\develop\bvweb-player\node_modules\tippy.js\animations\shift-away.css */
85
85
  .tippy-box[data-animation=shift-away][data-state=hidden] {
86
86
  opacity: 0;
87
87
  }
@@ -98,7 +98,7 @@
98
98
  transform: translateX(-10px);
99
99
  }
100
100
 
101
- /* sass-plugin-1:E:\codeGit\bvweb-player\src\styles\contextmenu.css */
101
+ /* sass-plugin-1:G:\develop\bvweb-player\src\styles\contextmenu.css */
102
102
  .cm_container {
103
103
  position: absolute;
104
104
  opacity: 0;
@@ -192,7 +192,7 @@
192
192
  background-color: inherit;
193
193
  }
194
194
 
195
- /* sass-plugin-1:E:\codeGit\bvweb-player\src\styles\main.scss */
195
+ /* sass-plugin-1:G:\develop\bvweb-player\src\styles\main.scss */
196
196
  .bvplayer-common-flex-space {
197
197
  display: inline-block;
198
198
  flex: 1;
package/dist/main.es.js CHANGED
@@ -99,7 +99,7 @@ var __async = (__this, __arguments, generator) => {
99
99
  var define_processenv_default;
100
100
  var init_define_processenv = __esm({
101
101
  "<define:processenv>"() {
102
- define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.50", PROJECT_NAMESPACE: "bvplayer" };
102
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.53", PROJECT_NAMESPACE: "bvplayer" };
103
103
  }
104
104
  });
105
105
 
@@ -11154,6 +11154,7 @@ function SvgElementbvPlayerCoreMikeOff({ className }) {
11154
11154
  }
11155
11155
 
11156
11156
  // src/templates/icons.tsx
11157
+ init_jsx();
11157
11158
  var Icon = ({ children, className, style: style2 }) => {
11158
11159
  const clsName = core_default.style.cls(["icon", className]);
11159
11160
  return /* @__PURE__ */ jsx.h("span", { className: clsName, style: style2, withNamespace: true }, children);
@@ -11465,7 +11466,8 @@ init_logger();
11465
11466
  // src/components/subComponent/mikeButton.tsx
11466
11467
  init_define_processenv();
11467
11468
  init_jsx_shim();
11468
- var _onIcon, _offIcon, _talk, _intercom, _type, _onTalkStart, onTalkStart_fn, _onTalkEnd, onTalkEnd_fn;
11469
+ init_jsx();
11470
+ var _onIcon, _offIcon, _isBusy, _talk, _intercom, _type, _onTalkStart, onTalkStart_fn, _onTalkEnd, onTalkEnd_fn;
11469
11471
  var MikeButton = class extends HTMLElement {
11470
11472
  constructor() {
11471
11473
  super();
@@ -11474,6 +11476,7 @@ var MikeButton = class extends HTMLElement {
11474
11476
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields weakmep实现的私有变量
11475
11477
  __privateAdd(this, _onIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOn, null)));
11476
11478
  __privateAdd(this, _offIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOff, null)));
11479
+ __privateAdd(this, _isBusy, false);
11477
11480
  //是否正在喊话
11478
11481
  __privateAdd(this, _talk, false);
11479
11482
  // 麦克风实例
@@ -11482,7 +11485,9 @@ var MikeButton = class extends HTMLElement {
11482
11485
  __privateAdd(this, _type, void 0);
11483
11486
  this.attachShadow({ mode: "open" });
11484
11487
  this.addEventListener("click", () => {
11485
- this.talking = !this.talking;
11488
+ if (!__privateGet(this, _isBusy)) {
11489
+ this.talking = !this.talking;
11490
+ }
11486
11491
  });
11487
11492
  this.talking = false;
11488
11493
  }
@@ -11492,11 +11497,14 @@ var MikeButton = class extends HTMLElement {
11492
11497
  set talking(state) {
11493
11498
  if (__privateGet(this, _talk) === state)
11494
11499
  return;
11495
- __privateSet(this, _talk, state);
11496
- if (state) {
11497
- __privateMethod(this, _onTalkStart, onTalkStart_fn).call(this);
11498
- } else {
11499
- __privateMethod(this, _onTalkEnd, onTalkEnd_fn).call(this);
11500
+ if (!__privateGet(this, _isBusy)) {
11501
+ __privateSet(this, _isBusy, true);
11502
+ __privateSet(this, _talk, state);
11503
+ let pm;
11504
+ pm = state ? __privateMethod(this, _onTalkStart, onTalkStart_fn).call(this) : __privateMethod(this, _onTalkEnd, onTalkEnd_fn).call(this);
11505
+ pm.finally(() => {
11506
+ __privateSet(this, _isBusy, false);
11507
+ });
11500
11508
  }
11501
11509
  }
11502
11510
  set intercom(ins) {
@@ -11516,22 +11524,27 @@ var MikeButton = class extends HTMLElement {
11516
11524
  };
11517
11525
  _onIcon = new WeakMap();
11518
11526
  _offIcon = new WeakMap();
11527
+ _isBusy = new WeakMap();
11519
11528
  _talk = new WeakMap();
11520
11529
  _intercom = new WeakMap();
11521
11530
  _type = new WeakMap();
11522
11531
  _onTalkStart = new WeakSet();
11523
11532
  onTalkStart_fn = function() {
11524
- var _a;
11525
- if (!__privateGet(this, _intercom))
11526
- return;
11527
- (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.open(void 0, __privateGet(this, _type));
11528
- __privateGet(this, _offIcon).replaceWith(__privateGet(this, _onIcon));
11533
+ return __async(this, null, function* () {
11534
+ var _a;
11535
+ if (!__privateGet(this, _intercom))
11536
+ return;
11537
+ yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.open(void 0, __privateGet(this, _type));
11538
+ __privateGet(this, _offIcon).replaceWith(__privateGet(this, _onIcon));
11539
+ });
11529
11540
  };
11530
11541
  _onTalkEnd = new WeakSet();
11531
11542
  onTalkEnd_fn = function() {
11532
- var _a;
11533
- (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.close();
11534
- __privateGet(this, _onIcon).replaceWith(__privateGet(this, _offIcon));
11543
+ return __async(this, null, function* () {
11544
+ var _a;
11545
+ yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.close();
11546
+ __privateGet(this, _onIcon).replaceWith(__privateGet(this, _offIcon));
11547
+ });
11535
11548
  };
11536
11549
  customElements.define("mike-button", MikeButton);
11537
11550
 
@@ -17770,15 +17783,17 @@ var AudioPlayer = (props) => {
17770
17783
  }
17771
17784
  };
17772
17785
  player.spinner.spin = false;
17773
- player.addEventListener("close", () => __async(void 0, null, function* () {
17786
+ const closeHandle = () => __async(void 0, null, function* () {
17774
17787
  if (!hplayer)
17775
17788
  return;
17789
+ player.removeEventListener("close", closeHandle);
17776
17790
  hplayer.close();
17777
17791
  yield dialog_default.closeDialogs(
17778
17792
  [hplayer.getDialogID()],
17779
17793
  sdpFetcher.token
17780
17794
  );
17781
- }));
17795
+ });
17796
+ player.addEventListener("close", closeHandle);
17782
17797
  } catch (e2) {
17783
17798
  console.error("\u51FA\u9519", e2);
17784
17799
  player.mask.visible = true;
@@ -18269,6 +18284,7 @@ var MediaStreamAudioWaveShowBVRtc = class {
18269
18284
  };
18270
18285
 
18271
18286
  // src/components/puPlayer.tsx
18287
+ init_jsx();
18272
18288
  var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescription) => __async(void 0, null, function* () {
18273
18289
  if (localDescription.type !== "offer")
18274
18290
  return void 0;
@@ -18690,8 +18706,9 @@ var PuPlayer = (props) => {
18690
18706
  });
18691
18707
  };
18692
18708
  player.spinner.spin = false;
18693
- player.addEventListener("close", () => __async(this, null, function* () {
18709
+ const closeHandle = () => __async(this, null, function* () {
18694
18710
  var _a3;
18711
+ player.removeEventListener("close", closeHandle);
18695
18712
  (_a3 = player.panel) == null ? void 0 : _a3.controller.removeEventListener(
18696
18713
  "volume",
18697
18714
  updateVolumeWrapper
@@ -18707,7 +18724,8 @@ var PuPlayer = (props) => {
18707
18724
  yield new Promise((r) => {
18708
18725
  setTimeout(r, 100);
18709
18726
  });
18710
- }));
18727
+ });
18728
+ player.addEventListener("close", closeHandle);
18711
18729
  onConnected && onConnected();
18712
18730
  reconnectMgr == null ? void 0 : reconnectMgr.cancelReconnect();
18713
18731
  dialog_default.closeDialogs([dialogId || ""], tempToken || "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.8.51",
3
+ "version": "0.8.53",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",
@@ -71,5 +71,6 @@
71
71
  "last 1 version",
72
72
  "> 1%",
73
73
  "not dead"
74
- ]
74
+ ],
75
+ "license": "MIT"
75
76
  }
@@ -1,12 +0,0 @@
1
- import { ShLogger } from "@shirtiny/logger";
2
- declare class EmbedLogger extends ShLogger {
3
- http(_message: string, ..._data: any[]): void;
4
- info: (message: string, ...data: any[]) => void;
5
- debug: (message: string, ...data: any[]) => void;
6
- test: (message: string, ...data: any[]) => void;
7
- gc: (message: string, ...data: any[]) => void;
8
- libWarn: (message: string, ...data: any[]) => void;
9
- libError: (message: string, ...data: any[]) => void;
10
- }
11
- declare const logger: EmbedLogger;
12
- export default logger;