@reactoo/watchtogether-sdk-js 2.6.80 → 2.6.82

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.6.80",
3
+ "version": "2.6.82",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -1584,7 +1584,7 @@ class RoomSession {
1584
1584
  : this.simulcastMode;
1585
1585
  const failedAttempts = p.webrtcStuff.simulcastSwitchFailedAttempts[mid] || 0;
1586
1586
 
1587
- if((simulcastMode === 'auto' && !manualSelectedSubstream) || failedAttempts > 3) {
1587
+ if((simulcastMode === 'auto' && !manualSelectedSubstream) /* || failedAttempts > 3 */) {
1588
1588
  // do nothing
1589
1589
  }
1590
1590
 
@@ -1624,17 +1624,18 @@ class RoomSession {
1624
1624
  else if(simulcastMode === 'controlled') {
1625
1625
  const currentSubstream = p.webrtcStuff.selectedSubstream[mid];
1626
1626
  const settingsForCurrentSubstream = simulcastBitrates?.[simulcastBitrates.length - 1 - currentSubstream];
1627
+ console.log('test', simulcastBitrates, currentSubstream, settingsForCurrentSubstream)
1627
1628
  let directionDecision = 0;
1628
1629
  if(p.webrtcStuff?.stats?.[mid]?.length > this._upStatsLength) {
1629
1630
  const upMedianStats = this._calculateMedianStats(p.webrtcStuff.stats[mid].slice(this._upStatsLength * -1));
1630
- if(upMedianStats?.framesPerSecond >= Math.floor(settingsForCurrentSubstream.maxFramerate * 0.7) && upMedianStats?.freezeDurationSinceLast < (this._upStatsLength * this._statsInterval * 0.33) / 1000 && upMedianStats?.freezeCountSinceLast < 3) {
1631
+ if(upMedianStats?.framesPerSecond >= Math.floor((settingsForCurrentSubstream?.maxFramerate || 30) * 0.7) && upMedianStats?.freezeDurationSinceLast < (this._upStatsLength * this._statsInterval * 0.33) / 1000 && upMedianStats?.freezeCountSinceLast < 3) {
1631
1632
  directionDecision = 1;
1632
1633
  }
1633
1634
  }
1634
1635
 
1635
1636
  if(p.webrtcStuff?.stats?.[mid]?.length > this._downStatsLength) {
1636
1637
  const downMedianStats = this._calculateMedianStats(p.webrtcStuff.stats[mid].slice(this._downStatsLength * -1));
1637
- if(downMedianStats?.framesPerSecond < Math.floor(settingsForCurrentSubstream.maxFramerate * 0.7) || downMedianStats?.freezeDurationSinceLast > (this._downStatsLength * this._statsInterval * 0.33) / 1000 || downMedianStats?.freezeCountSinceLast > 5 /* || downMedianStats?.jitter > maxJitter(settingsForCurrentSubstream.maxFramerate) */) {
1638
+ if(downMedianStats?.framesPerSecond < Math.floor((settingsForCurrentSubstream?.maxFramerate || 30) * 0.7) || downMedianStats?.freezeDurationSinceLast > (this._downStatsLength * this._statsInterval * 0.33) / 1000 || downMedianStats?.freezeCountSinceLast > 5 /* || downMedianStats?.jitter > maxJitter(settingsForCurrentSubstream.maxFramerate) */) {
1638
1639
  directionDecision = -1;
1639
1640
  }
1640
1641
  }