@besovideo/webrtc-player 0.8.58 → 0.8.59

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:G:\develop\bvweb-player\node_modules\tippy.js\dist\tippy.css */
1
+ /* sass-plugin-0:E:\codeGit\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:G:\develop\bvweb-player\node_modules\tippy.js\animations\shift-away.css */
84
+ /* sass-plugin-0:E:\codeGit\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:G:\develop\bvweb-player\src\styles\contextmenu.css */
101
+ /* sass-plugin-0:E:\codeGit\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:G:\develop\bvweb-player\src\styles\main.scss */
195
+ /* sass-plugin-0:E:\codeGit\bvweb-player\src\styles\main.scss */
196
196
  .bvplayer-common-flex-space {
197
197
  display: inline-block;
198
198
  flex: 1;
@@ -9188,10 +9188,16 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
9188
9188
  init_logger();
9189
9189
  var request = (url, config) => __async(void 0, null, function* () {
9190
9190
  const abortController = new AbortController();
9191
+ if (config.cancel) {
9192
+ abortController.abort();
9193
+ logger_default.http("\u8BF7\u6C42\u53D6\u6D88\u53D1\u9001");
9194
+ }
9191
9195
  if (config.signal) {
9192
9196
  config.signal.addEventListener("abort", () => {
9197
+ logger_default.http("\u624B\u52A8\u8BF7\u6C42\u53D6\u6D88\u53D1\u9001");
9193
9198
  abortController.abort();
9194
9199
  });
9200
+ console.log("@", config.signal);
9195
9201
  }
9196
9202
  if (config.timeout) {
9197
9203
  const timeoutId = setTimeout(() => {
@@ -9240,12 +9246,13 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
9240
9246
  });
9241
9247
  return data;
9242
9248
  });
9243
- var post = (url, param, option) => __async(void 0, null, function* () {
9249
+ var post = (url, param, option, signal) => __async(void 0, null, function* () {
9244
9250
  const data = yield request(url, {
9245
9251
  method: "POST" /* POST */,
9246
9252
  headers: __spreadValues({
9247
9253
  "Content-Type": "application/json;charset=UTF-8"
9248
9254
  }, option == null ? void 0 : option.headers),
9255
+ signal,
9249
9256
  bodyData: param
9250
9257
  });
9251
9258
  return data;
@@ -9778,7 +9785,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
9778
9785
  }
9779
9786
  };
9780
9787
  var DialogIdsKey = core_default.field.createPrefixStorageField("DialogIds");
9781
- var getDeviceWebrtc = (param, token) => __async(void 0, null, function* () {
9788
+ var getDeviceWebrtc = (param, token, signal) => __async(void 0, null, function* () {
9782
9789
  var _a;
9783
9790
  const headers = {
9784
9791
  Authorization: token || ""
@@ -9791,7 +9798,8 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
9791
9798
  const resData = yield http_default.post(
9792
9799
  `${apiUrls.bvscpV1()}/dialog/device/webrtc`,
9793
9800
  params,
9794
- { headers }
9801
+ { headers },
9802
+ signal
9795
9803
  );
9796
9804
  logger_default.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ", { params, resData });
9797
9805
  if (!resData || resData.code !== 0 || !((_a = resData.data) == null ? void 0 : _a.dialogid))
@@ -9807,7 +9815,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
9807
9815
  sdp: dialog.sdp
9808
9816
  };
9809
9817
  });
9810
- var getDeviceBvrtc = (param, token) => __async(void 0, null, function* () {
9818
+ var getDeviceBvrtc = (param, token, signal) => __async(void 0, null, function* () {
9811
9819
  var _a;
9812
9820
  const headers = {
9813
9821
  Authorization: token || ""
@@ -9820,7 +9828,8 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
9820
9828
  const resData = yield http_default.post(
9821
9829
  `${apiUrls.bvscpV1()}/dialog/device/bvrtc`,
9822
9830
  params,
9823
- { headers }
9831
+ { headers },
9832
+ signal
9824
9833
  );
9825
9834
  logger_default.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 bvrtc\u65B9\u5F0F\u6253\u5F00dialog: ", { params, resData });
9826
9835
  if (!resData || resData.code !== 0 || !((_a = resData.data) == null ? void 0 : _a.dialogid))
@@ -18839,7 +18848,7 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
18839
18848
 
18840
18849
  // src/components/puPlayer.tsx
18841
18850
  init_jsx();
18842
- var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescription) => __async(void 0, null, function* () {
18851
+ var createProductRemoteSdp = (puOption, tempToken, callBack, signal) => (localDescription) => __async(void 0, null, function* () {
18843
18852
  if (localDescription.type !== "offer")
18844
18853
  return void 0;
18845
18854
  logger_default.debug(
@@ -18857,7 +18866,8 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
18857
18866
  index,
18858
18867
  sdp: localDescription.sdp
18859
18868
  },
18860
- tempToken
18869
+ tempToken,
18870
+ signal
18861
18871
  );
18862
18872
  callBack && callBack(dialog.dialogId);
18863
18873
  return dialog.sdp;
@@ -19049,6 +19059,8 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19049
19059
  let intercom;
19050
19060
  const audioWaveShow = new MediaStreamAudioWaveShow();
19051
19061
  const audioWaveShowBVRtc = new MediaStreamAudioWaveShowBVRtc();
19062
+ const abortController = new AbortController();
19063
+ const { signal } = abortController;
19052
19064
  refreshIntercom();
19053
19065
  setBvcspV1ApiPrefix(apiPrefix);
19054
19066
  const player = new player_default({
@@ -19068,7 +19080,8 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19068
19080
  tempToken,
19069
19081
  (newDialogId) => {
19070
19082
  dialogId = newDialogId;
19071
- }
19083
+ },
19084
+ signal
19072
19085
  );
19073
19086
  return product(localDescription);
19074
19087
  }),
@@ -19116,8 +19129,9 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19116
19129
  });
19117
19130
  }
19118
19131
  const handleClose = () => __async(void 0, null, function* () {
19119
- if (!dialogId)
19132
+ if (!dialogId) {
19120
19133
  return;
19134
+ }
19121
19135
  logger_default.debug("PuPlayer close", dialogId);
19122
19136
  player.mask.visible = true;
19123
19137
  player.mask.text = t("video-closed");
@@ -19155,7 +19169,11 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19155
19169
  `type\u4E3A${protocol} type\u6682\u65F6\u53EA\u6709auto \u548C webrtc`
19156
19170
  );
19157
19171
  yield handleClose();
19158
- player.addEventListener("close", handleClose);
19172
+ player.addEventListener("close", () => __async(this, null, function* () {
19173
+ console.log("\u5173\u95ED\u89C6\u9891");
19174
+ abortController.abort();
19175
+ yield handleClose();
19176
+ }));
19159
19177
  logger_default.debug("PuPlayer close before open");
19160
19178
  player.mask.visible = false;
19161
19179
  player.mask.text = t("connecting");
@@ -19177,6 +19195,13 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19177
19195
  player.mikeBtn.type = this.protocol;
19178
19196
  }
19179
19197
  } catch (e) {
19198
+ if (signal.aborted) {
19199
+ player.mask.visible = true;
19200
+ player.mask.text = t("connect-failed");
19201
+ onConnectedFailed && onConnectedFailed();
19202
+ return;
19203
+ }
19204
+ ;
19180
19205
  try {
19181
19206
  let DisplayVolumn2 = function(volume) {
19182
19207
  var _a3;
@@ -19245,7 +19270,8 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19245
19270
  index,
19246
19271
  sdp: (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.sdp
19247
19272
  },
19248
- tempToken
19273
+ tempToken,
19274
+ signal
19249
19275
  );
19250
19276
  logger_default.info("ws-bvrtc remoteSDP: ", dialog.sdp);
19251
19277
  hplayer.setRemoteSDP(dialog.dialogId, dialog.sdp);
@@ -19299,46 +19325,53 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19299
19325
  dialog_default.closeDialogs([dialogId || ""], tempToken || "");
19300
19326
  if (!(player == null ? void 0 : player.panel))
19301
19327
  return;
19302
- const removeRefresh = player.addEventListener("refreshInfoModal", (e2) => __async(this, null, function* () {
19303
- if (!e2 || !hplayer)
19304
- return;
19305
- yield hplayer.getPlayerStatistic();
19306
- const staticInfo = hplayer.mediaStatisticInfo;
19307
- e2.target.showMediaStaticInfo({
19308
- meta: {
19309
- lastSeconds: Number(staticInfo.timeDaily) / 1e3,
19310
- transType: "bvrtc"
19311
- },
19312
- audio: staticInfo.audioStatistic.codec != "none" ? {
19313
- codec: {
19314
- clockRate: staticInfo.audioStatistic.sampleRate,
19315
- mimeType: staticInfo.audioStatistic.codec + `${staticInfo.audioStatistic.webcodecs ? "(webcodec)" : ""}`
19316
- },
19317
- rtp: {
19318
- sampleRates: `${staticInfo.audioStatistic.framerate} fps`,
19319
- bitRate: staticInfo.audioStatistic.bitrate,
19320
- packageLostTotal: Number(staticInfo.audioStatistic.lostpackcount),
19321
- avaragePackageLostRate: Number(staticInfo.audioStatistic.lostpackcount) / (Number(staticInfo.audioStatistic.packetcount) + Number(staticInfo.audioStatistic.lostpackcount)),
19322
- packageLostRate: staticInfo.audioStatistic.lostpackrate
19323
- }
19324
- } : void 0,
19325
- video: staticInfo.videoStatistic.codec != "none" ? {
19326
- codec: {
19327
- type: staticInfo.videoStatistic.codec + `${staticInfo.videoStatistic.webcodecs ? "(webcodec)" : ""}`,
19328
- sampleRates: staticInfo.videoStatistic.framerate,
19329
- width: staticInfo.videoStatistic.width,
19330
- height: staticInfo.videoStatistic.height
19328
+ const removeRefresh = player.addEventListener(
19329
+ "refreshInfoModal",
19330
+ (e2) => __async(this, null, function* () {
19331
+ if (!e2 || !hplayer)
19332
+ return;
19333
+ yield hplayer.getPlayerStatistic();
19334
+ const staticInfo = hplayer.mediaStatisticInfo;
19335
+ e2.target.showMediaStaticInfo({
19336
+ meta: {
19337
+ lastSeconds: Number(staticInfo.timeDaily) / 1e3,
19338
+ transType: "bvrtc"
19331
19339
  },
19332
- rtp: {
19333
- sampleRates: staticInfo.videoStatistic.framerate,
19334
- bitRate: staticInfo.videoStatistic.bitrate,
19335
- packageLostTotal: Number(staticInfo.videoStatistic.lostpackcount),
19336
- avaragePackageLostRate: Number(staticInfo.videoStatistic.lostpackcount) / (Number(staticInfo.videoStatistic.packetcount) + Number(staticInfo.videoStatistic.lostpackcount)),
19337
- packageLostRate: staticInfo.videoStatistic.lostpackrate
19338
- }
19339
- } : void 0
19340
- });
19341
- }));
19340
+ audio: staticInfo.audioStatistic.codec != "none" ? {
19341
+ codec: {
19342
+ clockRate: staticInfo.audioStatistic.sampleRate,
19343
+ mimeType: staticInfo.audioStatistic.codec + `${staticInfo.audioStatistic.webcodecs ? "(webcodec)" : ""}`
19344
+ },
19345
+ rtp: {
19346
+ sampleRates: `${staticInfo.audioStatistic.framerate} fps`,
19347
+ bitRate: staticInfo.audioStatistic.bitrate,
19348
+ packageLostTotal: Number(
19349
+ staticInfo.audioStatistic.lostpackcount
19350
+ ),
19351
+ avaragePackageLostRate: Number(staticInfo.audioStatistic.lostpackcount) / (Number(staticInfo.audioStatistic.packetcount) + Number(staticInfo.audioStatistic.lostpackcount)),
19352
+ packageLostRate: staticInfo.audioStatistic.lostpackrate
19353
+ }
19354
+ } : void 0,
19355
+ video: staticInfo.videoStatistic.codec != "none" ? {
19356
+ codec: {
19357
+ type: staticInfo.videoStatistic.codec + `${staticInfo.videoStatistic.webcodecs ? "(webcodec)" : ""}`,
19358
+ sampleRates: staticInfo.videoStatistic.framerate,
19359
+ width: staticInfo.videoStatistic.width,
19360
+ height: staticInfo.videoStatistic.height
19361
+ },
19362
+ rtp: {
19363
+ sampleRates: staticInfo.videoStatistic.framerate,
19364
+ bitRate: staticInfo.videoStatistic.bitrate,
19365
+ packageLostTotal: Number(
19366
+ staticInfo.videoStatistic.lostpackcount
19367
+ ),
19368
+ avaragePackageLostRate: Number(staticInfo.videoStatistic.lostpackcount) / (Number(staticInfo.videoStatistic.packetcount) + Number(staticInfo.videoStatistic.lostpackcount)),
19369
+ packageLostRate: staticInfo.videoStatistic.lostpackrate
19370
+ }
19371
+ } : void 0
19372
+ });
19373
+ })
19374
+ );
19342
19375
  const updateVolumeButton = (isInit = false) => {
19343
19376
  var _a3;
19344
19377
  const button = (_a3 = player.panel) == null ? void 0 : _a3.controller.VolumeButton;
package/dist/main.es.css CHANGED
@@ -1,4 +1,4 @@
1
- /* sass-plugin-1:G:\develop\bvweb-player\node_modules\tippy.js\dist\tippy.css */
1
+ /* sass-plugin-1:E:\codeGit\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:G:\develop\bvweb-player\node_modules\tippy.js\animations\shift-away.css */
84
+ /* sass-plugin-1:E:\codeGit\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:G:\develop\bvweb-player\src\styles\contextmenu.css */
101
+ /* sass-plugin-1:E:\codeGit\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:G:\develop\bvweb-player\src\styles\main.scss */
195
+ /* sass-plugin-1:E:\codeGit\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
@@ -9174,10 +9174,16 @@ init_jsx_shim();
9174
9174
  init_logger();
9175
9175
  var request = (url, config) => __async(void 0, null, function* () {
9176
9176
  const abortController = new AbortController();
9177
+ if (config.cancel) {
9178
+ abortController.abort();
9179
+ logger_default.http("\u8BF7\u6C42\u53D6\u6D88\u53D1\u9001");
9180
+ }
9177
9181
  if (config.signal) {
9178
9182
  config.signal.addEventListener("abort", () => {
9183
+ logger_default.http("\u624B\u52A8\u8BF7\u6C42\u53D6\u6D88\u53D1\u9001");
9179
9184
  abortController.abort();
9180
9185
  });
9186
+ console.log("@", config.signal);
9181
9187
  }
9182
9188
  if (config.timeout) {
9183
9189
  const timeoutId = setTimeout(() => {
@@ -9226,12 +9232,13 @@ var get3 = (url, param, option) => __async(void 0, null, function* () {
9226
9232
  });
9227
9233
  return data;
9228
9234
  });
9229
- var post = (url, param, option) => __async(void 0, null, function* () {
9235
+ var post = (url, param, option, signal) => __async(void 0, null, function* () {
9230
9236
  const data = yield request(url, {
9231
9237
  method: "POST" /* POST */,
9232
9238
  headers: __spreadValues({
9233
9239
  "Content-Type": "application/json;charset=UTF-8"
9234
9240
  }, option == null ? void 0 : option.headers),
9241
+ signal,
9235
9242
  bodyData: param
9236
9243
  });
9237
9244
  return data;
@@ -9764,7 +9771,7 @@ var OpenDialogError = class extends CustomError {
9764
9771
  }
9765
9772
  };
9766
9773
  var DialogIdsKey = core_default.field.createPrefixStorageField("DialogIds");
9767
- var getDeviceWebrtc = (param, token) => __async(void 0, null, function* () {
9774
+ var getDeviceWebrtc = (param, token, signal) => __async(void 0, null, function* () {
9768
9775
  var _a;
9769
9776
  const headers = {
9770
9777
  Authorization: token || ""
@@ -9777,7 +9784,8 @@ var getDeviceWebrtc = (param, token) => __async(void 0, null, function* () {
9777
9784
  const resData = yield http_default.post(
9778
9785
  `${apiUrls.bvscpV1()}/dialog/device/webrtc`,
9779
9786
  params,
9780
- { headers }
9787
+ { headers },
9788
+ signal
9781
9789
  );
9782
9790
  logger_default.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ", { params, resData });
9783
9791
  if (!resData || resData.code !== 0 || !((_a = resData.data) == null ? void 0 : _a.dialogid))
@@ -9793,7 +9801,7 @@ var getDeviceWebrtc = (param, token) => __async(void 0, null, function* () {
9793
9801
  sdp: dialog.sdp
9794
9802
  };
9795
9803
  });
9796
- var getDeviceBvrtc = (param, token) => __async(void 0, null, function* () {
9804
+ var getDeviceBvrtc = (param, token, signal) => __async(void 0, null, function* () {
9797
9805
  var _a;
9798
9806
  const headers = {
9799
9807
  Authorization: token || ""
@@ -9806,7 +9814,8 @@ var getDeviceBvrtc = (param, token) => __async(void 0, null, function* () {
9806
9814
  const resData = yield http_default.post(
9807
9815
  `${apiUrls.bvscpV1()}/dialog/device/bvrtc`,
9808
9816
  params,
9809
- { headers }
9817
+ { headers },
9818
+ signal
9810
9819
  );
9811
9820
  logger_default.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 bvrtc\u65B9\u5F0F\u6253\u5F00dialog: ", { params, resData });
9812
9821
  if (!resData || resData.code !== 0 || !((_a = resData.data) == null ? void 0 : _a.dialogid))
@@ -18825,7 +18834,7 @@ var MediaStreamAudioWaveShowBVRtc = class {
18825
18834
 
18826
18835
  // src/components/puPlayer.tsx
18827
18836
  init_jsx();
18828
- var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescription) => __async(void 0, null, function* () {
18837
+ var createProductRemoteSdp = (puOption, tempToken, callBack, signal) => (localDescription) => __async(void 0, null, function* () {
18829
18838
  if (localDescription.type !== "offer")
18830
18839
  return void 0;
18831
18840
  logger_default.debug(
@@ -18843,7 +18852,8 @@ var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescriptio
18843
18852
  index,
18844
18853
  sdp: localDescription.sdp
18845
18854
  },
18846
- tempToken
18855
+ tempToken,
18856
+ signal
18847
18857
  );
18848
18858
  callBack && callBack(dialog.dialogId);
18849
18859
  return dialog.sdp;
@@ -19035,6 +19045,8 @@ var PuPlayer = (props) => {
19035
19045
  let intercom;
19036
19046
  const audioWaveShow = new MediaStreamAudioWaveShow();
19037
19047
  const audioWaveShowBVRtc = new MediaStreamAudioWaveShowBVRtc();
19048
+ const abortController = new AbortController();
19049
+ const { signal } = abortController;
19038
19050
  refreshIntercom();
19039
19051
  setBvcspV1ApiPrefix(apiPrefix);
19040
19052
  const player = new player_default({
@@ -19054,7 +19066,8 @@ var PuPlayer = (props) => {
19054
19066
  tempToken,
19055
19067
  (newDialogId) => {
19056
19068
  dialogId = newDialogId;
19057
- }
19069
+ },
19070
+ signal
19058
19071
  );
19059
19072
  return product(localDescription);
19060
19073
  }),
@@ -19102,8 +19115,9 @@ var PuPlayer = (props) => {
19102
19115
  });
19103
19116
  }
19104
19117
  const handleClose = () => __async(void 0, null, function* () {
19105
- if (!dialogId)
19118
+ if (!dialogId) {
19106
19119
  return;
19120
+ }
19107
19121
  logger_default.debug("PuPlayer close", dialogId);
19108
19122
  player.mask.visible = true;
19109
19123
  player.mask.text = t("video-closed");
@@ -19141,7 +19155,11 @@ var PuPlayer = (props) => {
19141
19155
  `type\u4E3A${protocol} type\u6682\u65F6\u53EA\u6709auto \u548C webrtc`
19142
19156
  );
19143
19157
  yield handleClose();
19144
- player.addEventListener("close", handleClose);
19158
+ player.addEventListener("close", () => __async(this, null, function* () {
19159
+ console.log("\u5173\u95ED\u89C6\u9891");
19160
+ abortController.abort();
19161
+ yield handleClose();
19162
+ }));
19145
19163
  logger_default.debug("PuPlayer close before open");
19146
19164
  player.mask.visible = false;
19147
19165
  player.mask.text = t("connecting");
@@ -19163,6 +19181,13 @@ var PuPlayer = (props) => {
19163
19181
  player.mikeBtn.type = this.protocol;
19164
19182
  }
19165
19183
  } catch (e) {
19184
+ if (signal.aborted) {
19185
+ player.mask.visible = true;
19186
+ player.mask.text = t("connect-failed");
19187
+ onConnectedFailed && onConnectedFailed();
19188
+ return;
19189
+ }
19190
+ ;
19166
19191
  try {
19167
19192
  let DisplayVolumn2 = function(volume) {
19168
19193
  var _a3;
@@ -19231,7 +19256,8 @@ var PuPlayer = (props) => {
19231
19256
  index,
19232
19257
  sdp: (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.sdp
19233
19258
  },
19234
- tempToken
19259
+ tempToken,
19260
+ signal
19235
19261
  );
19236
19262
  logger_default.info("ws-bvrtc remoteSDP: ", dialog.sdp);
19237
19263
  hplayer.setRemoteSDP(dialog.dialogId, dialog.sdp);
@@ -19285,46 +19311,53 @@ var PuPlayer = (props) => {
19285
19311
  dialog_default.closeDialogs([dialogId || ""], tempToken || "");
19286
19312
  if (!(player == null ? void 0 : player.panel))
19287
19313
  return;
19288
- const removeRefresh = player.addEventListener("refreshInfoModal", (e2) => __async(this, null, function* () {
19289
- if (!e2 || !hplayer)
19290
- return;
19291
- yield hplayer.getPlayerStatistic();
19292
- const staticInfo = hplayer.mediaStatisticInfo;
19293
- e2.target.showMediaStaticInfo({
19294
- meta: {
19295
- lastSeconds: Number(staticInfo.timeDaily) / 1e3,
19296
- transType: "bvrtc"
19297
- },
19298
- audio: staticInfo.audioStatistic.codec != "none" ? {
19299
- codec: {
19300
- clockRate: staticInfo.audioStatistic.sampleRate,
19301
- mimeType: staticInfo.audioStatistic.codec + `${staticInfo.audioStatistic.webcodecs ? "(webcodec)" : ""}`
19302
- },
19303
- rtp: {
19304
- sampleRates: `${staticInfo.audioStatistic.framerate} fps`,
19305
- bitRate: staticInfo.audioStatistic.bitrate,
19306
- packageLostTotal: Number(staticInfo.audioStatistic.lostpackcount),
19307
- avaragePackageLostRate: Number(staticInfo.audioStatistic.lostpackcount) / (Number(staticInfo.audioStatistic.packetcount) + Number(staticInfo.audioStatistic.lostpackcount)),
19308
- packageLostRate: staticInfo.audioStatistic.lostpackrate
19309
- }
19310
- } : void 0,
19311
- video: staticInfo.videoStatistic.codec != "none" ? {
19312
- codec: {
19313
- type: staticInfo.videoStatistic.codec + `${staticInfo.videoStatistic.webcodecs ? "(webcodec)" : ""}`,
19314
- sampleRates: staticInfo.videoStatistic.framerate,
19315
- width: staticInfo.videoStatistic.width,
19316
- height: staticInfo.videoStatistic.height
19314
+ const removeRefresh = player.addEventListener(
19315
+ "refreshInfoModal",
19316
+ (e2) => __async(this, null, function* () {
19317
+ if (!e2 || !hplayer)
19318
+ return;
19319
+ yield hplayer.getPlayerStatistic();
19320
+ const staticInfo = hplayer.mediaStatisticInfo;
19321
+ e2.target.showMediaStaticInfo({
19322
+ meta: {
19323
+ lastSeconds: Number(staticInfo.timeDaily) / 1e3,
19324
+ transType: "bvrtc"
19317
19325
  },
19318
- rtp: {
19319
- sampleRates: staticInfo.videoStatistic.framerate,
19320
- bitRate: staticInfo.videoStatistic.bitrate,
19321
- packageLostTotal: Number(staticInfo.videoStatistic.lostpackcount),
19322
- avaragePackageLostRate: Number(staticInfo.videoStatistic.lostpackcount) / (Number(staticInfo.videoStatistic.packetcount) + Number(staticInfo.videoStatistic.lostpackcount)),
19323
- packageLostRate: staticInfo.videoStatistic.lostpackrate
19324
- }
19325
- } : void 0
19326
- });
19327
- }));
19326
+ audio: staticInfo.audioStatistic.codec != "none" ? {
19327
+ codec: {
19328
+ clockRate: staticInfo.audioStatistic.sampleRate,
19329
+ mimeType: staticInfo.audioStatistic.codec + `${staticInfo.audioStatistic.webcodecs ? "(webcodec)" : ""}`
19330
+ },
19331
+ rtp: {
19332
+ sampleRates: `${staticInfo.audioStatistic.framerate} fps`,
19333
+ bitRate: staticInfo.audioStatistic.bitrate,
19334
+ packageLostTotal: Number(
19335
+ staticInfo.audioStatistic.lostpackcount
19336
+ ),
19337
+ avaragePackageLostRate: Number(staticInfo.audioStatistic.lostpackcount) / (Number(staticInfo.audioStatistic.packetcount) + Number(staticInfo.audioStatistic.lostpackcount)),
19338
+ packageLostRate: staticInfo.audioStatistic.lostpackrate
19339
+ }
19340
+ } : void 0,
19341
+ video: staticInfo.videoStatistic.codec != "none" ? {
19342
+ codec: {
19343
+ type: staticInfo.videoStatistic.codec + `${staticInfo.videoStatistic.webcodecs ? "(webcodec)" : ""}`,
19344
+ sampleRates: staticInfo.videoStatistic.framerate,
19345
+ width: staticInfo.videoStatistic.width,
19346
+ height: staticInfo.videoStatistic.height
19347
+ },
19348
+ rtp: {
19349
+ sampleRates: staticInfo.videoStatistic.framerate,
19350
+ bitRate: staticInfo.videoStatistic.bitrate,
19351
+ packageLostTotal: Number(
19352
+ staticInfo.videoStatistic.lostpackcount
19353
+ ),
19354
+ avaragePackageLostRate: Number(staticInfo.videoStatistic.lostpackcount) / (Number(staticInfo.videoStatistic.packetcount) + Number(staticInfo.videoStatistic.lostpackcount)),
19355
+ packageLostRate: staticInfo.videoStatistic.lostpackrate
19356
+ }
19357
+ } : void 0
19358
+ });
19359
+ })
19360
+ );
19328
19361
  const updateVolumeButton = (isInit = false) => {
19329
19362
  var _a3;
19330
19363
  const button = (_a3 = player.panel) == null ? void 0 : _a3.controller.VolumeButton;
@@ -19,8 +19,8 @@ interface IGetConferenceWebRtcParam {
19
19
  export declare const closeDialogs: (ids: (string | undefined)[], token: string) => Promise<void>;
20
20
  export declare const closeAllStorageDialog: (token: string) => Promise<void>;
21
21
  declare const dialogApi: {
22
- getDeviceWebrtc: (param: Partial<IGetDeviceWebRtcParam>, token?: string | undefined) => Promise<IDialog>;
23
- getDeviceBvrtc: (param: Partial<IGetDeviceWebRtcParam>, token?: string | undefined) => Promise<IDialog>;
22
+ getDeviceWebrtc: (param: Partial<IGetDeviceWebRtcParam>, token?: string | undefined, signal?: AbortSignal | undefined) => Promise<IDialog>;
23
+ getDeviceBvrtc: (param: Partial<IGetDeviceWebRtcParam>, token?: string | undefined, signal?: AbortSignal | undefined) => Promise<IDialog>;
24
24
  getConferenceWebrtc: (param: Partial<IGetConferenceWebRtcParam>, token?: string | undefined) => Promise<IDialog>;
25
25
  getConferenceBvrtc: (param: Partial<IGetConferenceWebRtcParam>, token?: string | undefined) => Promise<IDialog>;
26
26
  closeDialogs: (ids: (string | undefined)[], token: string) => Promise<void>;
@@ -3,7 +3,7 @@ interface HttpOption {
3
3
  }
4
4
  interface Http {
5
5
  get(url: string, param?: URLSearchParams, option?: HttpOption): Promise<any>;
6
- post(url: string, param?: object, option?: HttpOption): Promise<any>;
6
+ post(url: string, param?: object, option?: HttpOption, signal?: AbortSignal): Promise<any>;
7
7
  put(url: string, param?: object, option?: HttpOption): Promise<any>;
8
8
  }
9
9
  declare const http: Http;
@@ -0,0 +1,12 @@
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.8.58",
3
+ "version": "0.8.59",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",