@stream-io/video-client 1.11.1 → 1.11.3

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": "@stream-io/video-client",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -100,6 +100,15 @@ describe('StreamVideoClient', () => {
100
100
  expect(response.calls).toBeDefined();
101
101
  });
102
102
 
103
+ it('should clear token on disconnect', async () => {
104
+ const user = { id: 'jane' };
105
+ const tp = vi.fn(tokenProvider(user.id));
106
+ await client.connectUser(user, tp);
107
+ await client.disconnectUser();
108
+ await client.connectUser({ type: 'anonymous' });
109
+ expect(tp).toBeCalledTimes(1);
110
+ });
111
+
103
112
  afterEach(() => {
104
113
  client.disconnectUser();
105
114
  });
@@ -63,6 +63,8 @@ export class TokenManager {
63
63
  */
64
64
  reset = () => {
65
65
  this.token = undefined;
66
+ this.tokenProvider = undefined;
67
+ this.type = 'static';
66
68
  this.user = undefined;
67
69
  this.loadTokenPromise = null;
68
70
  };
@@ -652,7 +652,8 @@ export class Publisher {
652
652
  settings?.screensharing.target_resolution?.bitrate;
653
653
 
654
654
  const publishOpts = opts || this.publishOptsForTrack.get(trackType);
655
- const codecInUse = getOptimalVideoCodec(publishOpts?.preferredCodec);
655
+ const codecInUse =
656
+ opts?.forceCodec || getOptimalVideoCodec(opts?.preferredCodec);
656
657
  return trackType === TrackType.VIDEO
657
658
  ? findOptimalVideoLayers(track, targetResolution, codecInUse, publishOpts)
658
659
  : trackType === TrackType.SCREEN_SHARE