@reactoo/watchtogether-sdk-js 2.6.88 → 2.6.90

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.88",
3
+ "version": "2.6.90",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -787,6 +787,7 @@ class RoomSession {
787
787
  this._log('Substream: ', sender, mid, substream);
788
788
  this._setSelectedSubstream(sender, mid, substream);
789
789
  this._resetStats(sender, mid);
790
+ this.requestKeyFrame(sender, mid)
790
791
  }
791
792
 
792
793
  if(temporal !== undefined && temporal !== null) {
@@ -967,7 +968,6 @@ class RoomSession {
967
968
  stats: {},
968
969
  selectedSubstream: {},
969
970
  initialSimulcastSubstreamBeenSet: {},
970
- simulcastSubstreamManualSelect: {},
971
971
  simulcastSwitchFailedAttempts: {},
972
972
  };
973
973
 
@@ -1025,7 +1025,6 @@ class RoomSession {
1025
1025
  stats: {},
1026
1026
  selectedSubstream: {},
1027
1027
  initialSimulcastSubstreamBeenSet: {},
1028
- simulcastSubstreamManualSelect: {},
1029
1028
  simulcastSwitchFailedAttempts: {},
1030
1029
  }
1031
1030
  };
@@ -1580,7 +1579,6 @@ class RoomSession {
1580
1579
  }
1581
1580
 
1582
1581
  const initialSubstreamBeenSet = !!p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid];
1583
- const manualSelectedSubstream = p.webrtcStuff.simulcastSubstreamManualSelect?.[mid];
1584
1582
  const defaultSelectedSubstream = typeof this.simulcastDefaultManualSubstream === 'object'
1585
1583
  ? (this.simulcastDefaultManualSubstream[source] !== undefined
1586
1584
  ? this.simulcastDefaultManualSubstream[source]
@@ -1591,28 +1589,14 @@ class RoomSession {
1591
1589
  : this.simulcastMode;
1592
1590
  const failedAttempts = p.webrtcStuff.simulcastSwitchFailedAttempts[mid] || 0;
1593
1591
 
1594
- if((simulcastMode === 'auto' && !manualSelectedSubstream) /* || failedAttempts > 3 */) {
1592
+ if((simulcastMode === 'auto') /* || failedAttempts > 3 */) {
1595
1593
  // do nothing
1596
1594
  }
1597
1595
 
1598
- else if(simulcastMode === 'manual' || manualSelectedSubstream || !initialSubstreamBeenSet) {
1596
+ else if(simulcastMode === 'manual' || !initialSubstreamBeenSet) {
1599
1597
  p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid] = true;
1600
1598
  const currentSubstream = p.webrtcStuff.selectedSubstream[mid];
1601
- if(manualSelectedSubstream !== undefined && manualSelectedSubstream !== null && currentSubstream !== manualSelectedSubstream) {
1602
- this.selectSubStream(p.handleId, manualSelectedSubstream, undefined, mid, false)
1603
- .then(() => {
1604
- p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
1605
- })
1606
- .catch(() => {
1607
- if(!p.webrtcStuff.simulcastSwitchFailedAttempts[mid]) {
1608
- p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 1;
1609
- }
1610
- else {
1611
- p.webrtcStuff.simulcastSwitchFailedAttempts[mid]++;
1612
- }
1613
- });
1614
- }
1615
- else if(defaultSelectedSubstream !== undefined && defaultSelectedSubstream !== null && defaultSelectedSubstream !== currentSubstream) {
1599
+ if(defaultSelectedSubstream !== undefined && defaultSelectedSubstream !== null && defaultSelectedSubstream !== currentSubstream) {
1616
1600
  this.selectSubStream(p.handleId, defaultSelectedSubstream, undefined, mid, false)
1617
1601
  .then(() => {
1618
1602
  p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
@@ -2971,9 +2955,9 @@ class RoomSession {
2971
2955
  }
2972
2956
  }
2973
2957
 
2974
- selectSubStream(handleId, substream = 2, source, mid, manual = true) {
2958
+ selectSubStream(handleId, substream = 2, source, mid = true) {
2975
2959
 
2976
- this._log('Select SubStream attempt', handleId, substream, source, mid, 'was this selected by user', manual);
2960
+ this._log('Select SubStream attempt', handleId, substream, source, mid);
2977
2961
 
2978
2962
  let handle = this._getHandle(handleId);
2979
2963
  if(!handle) {
@@ -2999,11 +2983,6 @@ class RoomSession {
2999
2983
  clearTimeout(messageTimeoutId);
3000
2984
  this._abortController.signal.removeEventListener('abort', abortResponse);
3001
2985
  this.ws.removeEventListener('message', parseResponse);
3002
-
3003
- if(manual) {
3004
- config.simulcastSubstreamManualSelect[mid] = substream;
3005
- }
3006
-
3007
2986
  resolve({substream, sender});
3008
2987
  }
3009
2988
  }
@@ -3022,8 +3001,7 @@ class RoomSession {
3022
3001
  }
3023
3002
  if(mid !== undefined) {
3024
3003
 
3025
- if(manual && substream === null) {
3026
- config.simulcastSubstreamManualSelect[mid] = substream;
3004
+ if(substream === null) {
3027
3005
  resolve({substream, sender: handleId});
3028
3006
  return;
3029
3007
  }