@besovideo/webrtc-player 0.9.85 → 0.9.86

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.86", 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
  };
@@ -22307,7 +22319,9 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
22307
22319
  open(muted = false) {
22308
22320
  return __async(this, null, function* () {
22309
22321
  logger_default.debug("BvWebrtc open");
22310
- yield this.close();
22322
+ yield this.noDispathHandle(() => __async(this, null, function* () {
22323
+ yield this.close();
22324
+ }));
22311
22325
  this.player.mask.visible = false;
22312
22326
  this.player.mask.text = t("connecting");
22313
22327
  this.player.mute(!!muted);
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.86", 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
  };
@@ -22291,7 +22303,9 @@ var BvWebrtcInstance = class extends CommonInstance {
22291
22303
  open(muted = false) {
22292
22304
  return __async(this, null, function* () {
22293
22305
  logger_default.debug("BvWebrtc open");
22294
- yield this.close();
22306
+ yield this.noDispathHandle(() => __async(this, null, function* () {
22307
+ yield this.close();
22308
+ }));
22295
22309
  this.player.mask.visible = false;
22296
22310
  this.player.mask.text = t("connecting");
22297
22311
  this.player.mute(!!muted);
@@ -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;
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.86",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",