@signalwire/js 3.19.1 → 3.19.2

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
@@ -3,7 +3,7 @@
3
3
  "description": "SignalWire JS SDK",
4
4
  "author": "SignalWire Team <open.source@signalwire.com>",
5
5
  "license": "MIT",
6
- "version": "3.19.1",
6
+ "version": "3.19.2",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.esm.js",
9
9
  "unpkg": "dist/index.umd.js",
@@ -8,7 +8,10 @@ import { createClient } from './createClient'
8
8
  import { BaseRoomSession } from './BaseRoomSession'
9
9
  import { checkMediaParams, getJoinMediaParams } from './utils/roomSession'
10
10
  import type { MakeRoomOptions } from './Client'
11
- import type { BaseRoomSessionJoinParams } from './utils/interfaces'
11
+ import type {
12
+ BaseRoomSessionJoinParams,
13
+ RoomSessionObjectEvents,
14
+ } from './utils/interfaces'
12
15
  import { getStorage, CALL_ID } from './utils/storage'
13
16
 
14
17
  /**
@@ -54,6 +57,16 @@ export const UNSAFE_PROP_ACCESS = [
54
57
  'demote',
55
58
  ]
56
59
 
60
+ /**
61
+ * List of events that the SDK must subscribe at the invite time.
62
+ * ie. ScreenShare/AdditionaDevice are based on the member.joined logic.
63
+ */
64
+ const REQUIRED_EVENTS: (keyof RoomSessionObjectEvents)[] = [
65
+ 'member.joined',
66
+ 'layout.changed',
67
+ ]
68
+ const noop = () => {}
69
+
57
70
  export interface RoomSessionOptions extends UserOptions, MakeRoomOptions {}
58
71
 
59
72
  export interface RoomSession extends BaseRoomSession<RoomSession> {
@@ -221,6 +234,8 @@ export const RoomSession = function (roomOptions: RoomSessionOptions) {
221
234
  // Hijack previous callId if present
222
235
  reattachManager.init()
223
236
 
237
+ REQUIRED_EVENTS.forEach((event) => room.once(event, noop))
238
+
224
239
  await room.join()
225
240
  } catch (error) {
226
241
  getLogger().error('RoomSession Join', error)