@stream-io/video-client 0.2.2 → 0.3.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.browser.es.js +325 -421
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +325 -421
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +325 -421
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/Call.d.ts +8 -10
  9. package/dist/src/StreamVideoClient.d.ts +3 -1
  10. package/dist/src/events/call-permissions.d.ts +0 -5
  11. package/dist/src/events/call.d.ts +0 -6
  12. package/dist/src/events/index.d.ts +0 -6
  13. package/dist/src/gen/coordinator/index.d.ts +25 -0
  14. package/dist/src/rtc/Dispatcher.d.ts +2 -2
  15. package/dist/src/rtc/Publisher.d.ts +0 -1
  16. package/dist/src/store/CallState.d.ts +164 -89
  17. package/dist/src/types.d.ts +1 -7
  18. package/dist/version.d.ts +1 -1
  19. package/package.json +1 -1
  20. package/src/Call.ts +37 -44
  21. package/src/StreamVideoClient.ts +14 -17
  22. package/src/events/__tests__/call-permissions.test.ts +1 -61
  23. package/src/events/__tests__/call.test.ts +5 -50
  24. package/src/events/call-permissions.ts +0 -14
  25. package/src/events/call.ts +5 -16
  26. package/src/events/callEventHandlers.ts +2 -57
  27. package/src/events/index.ts +0 -6
  28. package/src/gen/coordinator/index.ts +25 -0
  29. package/src/rtc/Dispatcher.ts +2 -2
  30. package/src/rtc/Publisher.ts +4 -6
  31. package/src/store/CallState.ts +475 -119
  32. package/src/store/__tests__/CallState.test.ts +447 -1
  33. package/src/types.ts +0 -8
  34. package/dist/src/events/__tests__/backstage.test.d.ts +0 -1
  35. package/dist/src/events/__tests__/members.test.d.ts +0 -1
  36. package/dist/src/events/__tests__/recording.test.d.ts +0 -1
  37. package/dist/src/events/__tests__/sessions.test.d.ts +0 -1
  38. package/dist/src/events/backstage.d.ts +0 -6
  39. package/dist/src/events/members.d.ts +0 -18
  40. package/dist/src/events/moderation.d.ts +0 -14
  41. package/dist/src/events/reactions.d.ts +0 -8
  42. package/dist/src/events/recording.d.ts +0 -18
  43. package/dist/src/events/sessions.d.ts +0 -26
  44. package/src/events/__tests__/backstage.test.ts +0 -15
  45. package/src/events/__tests__/members.test.ts +0 -135
  46. package/src/events/__tests__/recording.test.ts +0 -65
  47. package/src/events/__tests__/sessions.test.ts +0 -135
  48. package/src/events/backstage.ts +0 -15
  49. package/src/events/members.ts +0 -62
  50. package/src/events/moderation.ts +0 -35
  51. package/src/events/reactions.ts +0 -30
  52. package/src/events/recording.ts +0 -64
  53. package/src/events/sessions.ts +0 -102
@@ -50,7 +50,6 @@ export type PublisherOpts = {
50
50
  export class Publisher {
51
51
  private pc: RTCPeerConnection;
52
52
  private readonly state: CallState;
53
- private readonly dispatcher: Dispatcher;
54
53
 
55
54
  private readonly transceiverRegistry: {
56
55
  [key in TrackType]: RTCRtpTransceiver | undefined;
@@ -129,7 +128,6 @@ export class Publisher {
129
128
  this.pc = this.createPeerConnection(connectionConfig);
130
129
  this.sfuClient = sfuClient;
131
130
  this.state = state;
132
- this.dispatcher = dispatcher;
133
131
  this.isDtxEnabled = isDtxEnabled;
134
132
  this.isRedEnabled = isRedEnabled;
135
133
  this.preferredVideoCodec = preferredVideoCodec;
@@ -234,8 +232,8 @@ export class Publisher {
234
232
  };
235
233
 
236
234
  if (!transceiver) {
237
- const metadata = this.state.metadata;
238
- const targetResolution = metadata?.settings.video.target_resolution;
235
+ const { settings } = this.state;
236
+ const targetResolution = settings?.video.target_resolution;
239
237
  const videoEncodings =
240
238
  trackType === TrackType.VIDEO
241
239
  ? findOptimalVideoLayers(track, targetResolution)
@@ -608,8 +606,8 @@ export class Publisher {
608
606
  return String(media.mid);
609
607
  };
610
608
 
611
- const metadata = this.state.metadata;
612
- const targetResolution = metadata?.settings.video.target_resolution;
609
+ const { settings } = this.state;
610
+ const targetResolution = settings?.video.target_resolution;
613
611
  return this.pc
614
612
  .getTransceivers()
615
613
  .filter((t) => t.direction === 'sendonly' && t.sender.track)