@reactoo/watchtogether-sdk-js 2.6.91 → 2.6.92

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.91",
3
+ "version": "2.6.92",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -1597,6 +1597,7 @@ class RoomSession {
1597
1597
  p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid] = true;
1598
1598
  const currentSubstream = p.webrtcStuff.selectedSubstream[mid];
1599
1599
  if(defaultSelectedSubstream !== undefined && defaultSelectedSubstream !== null && defaultSelectedSubstream !== currentSubstream) {
1600
+ this._log('Attempting to force substream quality', defaultSelectedSubstream);
1600
1601
  this.selectSubStream(p.handleId, defaultSelectedSubstream, undefined, mid, false)
1601
1602
  .then(() => {
1602
1603
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
@@ -1632,41 +1633,40 @@ class RoomSession {
1632
1633
 
1633
1634
  if(directionDecision === -1) {
1634
1635
  if(currentSubstream < simulcastBitrates.length - 1) {
1635
- this._log('switching to low res', currentSubstream + 1);
1636
+ this._log('Attempting to down the quality', currentSubstream + 1);
1637
+ this._resetStats(p.handleId, mid);
1636
1638
  this.selectSubStream(p.handleId, currentSubstream + 1, undefined, mid, false)
1637
1639
  .then(() => {
1638
1640
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
1639
1641
  })
1640
1642
  .catch((e) => {
1641
1643
  this._log('switch failed:', e);
1642
- this._resetStats(p.handleId, mid);
1643
-
1644
1644
  if(!p.webrtcStuff.simulcastSwitchFailedAttempts[mid]) {
1645
1645
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 1;
1646
1646
  }
1647
1647
  else {
1648
1648
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid]++;
1649
1649
  }
1650
- });
1650
+ })
1651
1651
  }
1652
1652
  }
1653
1653
  else if (directionDecision === 1) {
1654
1654
  if(currentSubstream > 0) {
1655
- this._log('switching to high res', currentSubstream - 1);
1655
+ this._log('Attempting to up the quality', currentSubstream - 1);
1656
+ this._resetStats(p.handleId, mid);
1656
1657
  this.selectSubStream(p.handleId, currentSubstream - 1, undefined, mid, false)
1657
1658
  .then(() => {
1658
1659
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
1659
1660
  })
1660
1661
  .catch((e) => {
1661
1662
  this._log('switch failed:', e);
1662
- this._resetStats(p.handleId, mid);
1663
1663
  if(!p.webrtcStuff.simulcastSwitchFailedAttempts[mid]) {
1664
1664
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 1;
1665
1665
  }
1666
1666
  else {
1667
1667
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid]++;
1668
1668
  }
1669
- });
1669
+ })
1670
1670
  }
1671
1671
  }
1672
1672
  }
@@ -2956,9 +2956,7 @@ class RoomSession {
2956
2956
  }
2957
2957
 
2958
2958
  selectSubStream(handleId, substream = 2, source, mid) {
2959
-
2960
- this._log('Select SubStream attempt', handleId, substream, source, mid);
2961
-
2959
+ this._log('Select substream called for handle:', handleId, 'Source or mid:', source ? source : mid, 'Substream:', substream);
2962
2960
  let handle = this._getHandle(handleId);
2963
2961
  if(!handle) {
2964
2962
  return Promise.resolve();