@besovideo/webrtc-player 0.8.61 → 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.
@@ -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.61", 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,7 +19262,7 @@ ${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();
@@ -19542,7 +19556,9 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
19542
19556
  if (this.protocol == protocol)
19543
19557
  return;
19544
19558
  this.close().then(() => {
19545
- this.open(currentMuted, protocol);
19559
+ setTimeout(() => {
19560
+ this.open(currentMuted, protocol);
19561
+ }, 500);
19546
19562
  });
19547
19563
  },
19548
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.61", 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,7 +19248,7 @@ 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();
@@ -19528,7 +19542,9 @@ var PuPlayer = (props) => {
19528
19542
  if (this.protocol == protocol)
19529
19543
  return;
19530
19544
  this.close().then(() => {
19531
- this.open(currentMuted, protocol);
19545
+ setTimeout(() => {
19546
+ this.open(currentMuted, protocol);
19547
+ }, 500);
19532
19548
  });
19533
19549
  },
19534
19550
  setToken: (newToken) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.8.61",
3
+ "version": "0.8.62",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",