@besovideo/webrtc-player 0.8.60 → 0.8.62

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.
package/README.md CHANGED
@@ -136,14 +136,15 @@ clearAllDialog();
136
136
  ```typescript
137
137
  // 全部控制项
138
138
  [
139
- "volume",
140
- "volumeSlider",
141
- "information",
142
- "screenshot",
143
- "record",
144
139
  "fullscreen",
145
- "rotate",
146
140
  "ptzControl",
141
+ "rotate",
142
+ "record",
143
+ "screenshot",
144
+ "volumeSlider",
145
+ "volume",
146
+ "mike",
147
+ "information"
147
148
  ];
148
149
  // 在创建实例时 传入参数disabledControls数组 可关闭相关功能
149
150
  // 如不使用全屏按钮、云台控制器
@@ -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.8.60", PROJECT_NAMESPACE: "bvplayer" };
120
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.62", PROJECT_NAMESPACE: "bvplayer" };
121
121
  }
122
122
  });
123
123
 
@@ -12032,7 +12032,21 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
12032
12032
  if (targetReceivers.length > 0) {
12033
12033
  report = yield targetReceivers[0].getStats();
12034
12034
  }
12035
- return report ? {
12035
+ const isTargeReportExist = {
12036
+ codec: false,
12037
+ "inbound-rtp": false
12038
+ };
12039
+ Object.keys(isTargeReportExist).forEach((typeStats) => {
12040
+ if (report) {
12041
+ report.forEach((item) => {
12042
+ if (item.type == typeStats) {
12043
+ isTargeReportExist[typeStats] = true;
12044
+ }
12045
+ });
12046
+ }
12047
+ });
12048
+ const invalid = Object.keys(isTargeReportExist).findIndex((item) => !isTargeReportExist[item]) >= 0;
12049
+ return report && !invalid ? {
12036
12050
  codec: __privateMethod(this, _getLastStatsByType, getLastStatsByType_fn).call(this, report, "codec", {}).now,
12037
12051
  rtp: __privateMethod(this, _getLastStatsByType, getLastStatsByType_fn).call(this, report, "inbound-rtp", {
12038
12052
  bytesReceived: 0,
@@ -19248,10 +19262,11 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19248
19262
  player.mikeBtn.type = this.protocol;
19249
19263
  }
19250
19264
  } catch (e) {
19251
- if (signal.aborted) {
19265
+ if (signal.aborted && e != "protocol == ws-bvrtc" && type != "auto") {
19252
19266
  player.mask.visible = true;
19253
19267
  player.mask.text = t("connect-failed");
19254
19268
  onConnectedFailed && onConnectedFailed();
19269
+ useRecntMgr == null ? void 0 : useRecntMgr.reconnect();
19255
19270
  return;
19256
19271
  }
19257
19272
  try {
@@ -19541,7 +19556,9 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19541
19556
  if (this.protocol == protocol)
19542
19557
  return;
19543
19558
  this.close().then(() => {
19544
- this.open(currentMuted, protocol);
19559
+ setTimeout(() => {
19560
+ this.open(currentMuted, protocol);
19561
+ }, 500);
19545
19562
  });
19546
19563
  },
19547
19564
  setToken: (newToken) => {
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.8.60", PROJECT_NAMESPACE: "bvplayer" };
114
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.62", PROJECT_NAMESPACE: "bvplayer" };
115
115
  }
116
116
  });
117
117
 
@@ -12018,7 +12018,21 @@ var WebRTCConnect = class {
12018
12018
  if (targetReceivers.length > 0) {
12019
12019
  report = yield targetReceivers[0].getStats();
12020
12020
  }
12021
- return report ? {
12021
+ const isTargeReportExist = {
12022
+ codec: false,
12023
+ "inbound-rtp": false
12024
+ };
12025
+ Object.keys(isTargeReportExist).forEach((typeStats) => {
12026
+ if (report) {
12027
+ report.forEach((item) => {
12028
+ if (item.type == typeStats) {
12029
+ isTargeReportExist[typeStats] = true;
12030
+ }
12031
+ });
12032
+ }
12033
+ });
12034
+ const invalid = Object.keys(isTargeReportExist).findIndex((item) => !isTargeReportExist[item]) >= 0;
12035
+ return report && !invalid ? {
12022
12036
  codec: __privateMethod(this, _getLastStatsByType, getLastStatsByType_fn).call(this, report, "codec", {}).now,
12023
12037
  rtp: __privateMethod(this, _getLastStatsByType, getLastStatsByType_fn).call(this, report, "inbound-rtp", {
12024
12038
  bytesReceived: 0,
@@ -19234,10 +19248,11 @@ var PuPlayer = (props) => {
19234
19248
  player.mikeBtn.type = this.protocol;
19235
19249
  }
19236
19250
  } catch (e) {
19237
- if (signal.aborted) {
19251
+ if (signal.aborted && e != "protocol == ws-bvrtc" && type != "auto") {
19238
19252
  player.mask.visible = true;
19239
19253
  player.mask.text = t("connect-failed");
19240
19254
  onConnectedFailed && onConnectedFailed();
19255
+ useRecntMgr == null ? void 0 : useRecntMgr.reconnect();
19241
19256
  return;
19242
19257
  }
19243
19258
  try {
@@ -19527,7 +19542,9 @@ var PuPlayer = (props) => {
19527
19542
  if (this.protocol == protocol)
19528
19543
  return;
19529
19544
  this.close().then(() => {
19530
- this.open(currentMuted, protocol);
19545
+ setTimeout(() => {
19546
+ this.open(currentMuted, protocol);
19547
+ }, 500);
19531
19548
  });
19532
19549
  },
19533
19550
  setToken: (newToken) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.8.60",
3
+ "version": "0.8.62",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",