@livedigital/client 2.7.2 → 2.8.0

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@livedigital/client",
3
3
  "author": "vlprojects",
4
4
  "license": "MIT",
5
- "version": "2.7.2",
5
+ "version": "2.8.0",
6
6
  "private": false,
7
7
  "bugs": {
8
8
  "url": "https://github.com/vlprojects/livedigital-sdk/issues"
@@ -17,12 +17,37 @@ class AvailableOutgoingBitrateIssueDetector implements IssueDetector {
17
17
  return issues;
18
18
  }
19
19
 
20
- if (availableOutgoingBitrate < this.#availableOutgoingBitrateTreshhold) {
20
+ const audioStreamsTotalTargetBitrate = data.audio.outbound
21
+ .reduce((totalBitrate, streamStat) => totalBitrate + streamStat.targetBitrate, 0);
22
+
23
+ const videoStreamsTotalBitrate = data.video.outbound
24
+ .reduce((totalBitrate, streamStat) => totalBitrate + streamStat.bitrate, 0);
25
+
26
+ if (!audioStreamsTotalTargetBitrate && !videoStreamsTotalBitrate) {
27
+ // there are no streams sending through this connection
28
+ return issues;
29
+ }
30
+
31
+ if (audioStreamsTotalTargetBitrate > availableOutgoingBitrate) {
21
32
  issues.push({
22
33
  type: IssueType.Network,
23
34
  reason: IssueReason.OutboundNetworkThroughput,
24
- debug: `availableOutgoingBitrate: ${availableOutgoingBitrate}`,
35
+ debug: `availableOutgoingBitrate: ${availableOutgoingBitrate}`
36
+ + `, audioStreamsTotalTargetBitrate: ${audioStreamsTotalTargetBitrate}`,
25
37
  });
38
+
39
+ return issues;
40
+ }
41
+
42
+ if (videoStreamsTotalBitrate > 0 && availableOutgoingBitrate < this.#availableOutgoingBitrateTreshhold) {
43
+ issues.push({
44
+ type: IssueType.Network,
45
+ reason: IssueReason.OutboundNetworkThroughput,
46
+ debug: `availableOutgoingBitrate: ${availableOutgoingBitrate}`
47
+ + `, videoStreamsTotalBitrate: ${videoStreamsTotalBitrate}`,
48
+ });
49
+
50
+ return issues;
26
51
  }
27
52
 
28
53
  return issues;