@100mslive/react-native-hms 0.8.1 → 0.8.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.
Files changed (73) hide show
  1. package/android/build.gradle +1 -2
  2. package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +198 -254
  3. package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +18 -30
  4. package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +18 -18
  5. package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +182 -146
  6. package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +15 -21
  7. package/android/src/main/java/com/reactnativehmssdk/HmssdkPackage.kt +1 -2
  8. package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +4 -10
  9. package/ios/HmsDecoder.swift +33 -20
  10. package/ios/HmsHelper.swift +13 -3
  11. package/ios/HmsManager.m +8 -8
  12. package/ios/HmsManager.swift +16 -16
  13. package/ios/HmsSDK.swift +97 -29
  14. package/lib/commonjs/classes/HMSEncoder.js +6 -4
  15. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  16. package/lib/commonjs/classes/HMSLocalAudioTrack.js +20 -0
  17. package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
  18. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  19. package/lib/commonjs/classes/HMSLocalVideoTrack.js +18 -0
  20. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  21. package/lib/commonjs/classes/HMSLogger.js +28 -1
  22. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  23. package/lib/commonjs/classes/HMSRemoteAudioTrack.js +19 -0
  24. package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
  25. package/lib/commonjs/classes/HMSRemoteVideoTrack.js +19 -0
  26. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  27. package/lib/commonjs/classes/HMSSDK.js +179 -134
  28. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  29. package/lib/commonjs/classes/HMSTrackSettings.js +3 -0
  30. package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
  31. package/lib/commonjs/classes/HMSVideoCodec.js +4 -4
  32. package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
  33. package/lib/commonjs/index.js +14 -0
  34. package/lib/commonjs/index.js.map +1 -1
  35. package/lib/module/classes/HMSEncoder.js +6 -4
  36. package/lib/module/classes/HMSEncoder.js.map +1 -1
  37. package/lib/module/classes/HMSLocalAudioTrack.js +17 -0
  38. package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
  39. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  40. package/lib/module/classes/HMSLocalVideoTrack.js +15 -0
  41. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  42. package/lib/module/classes/HMSLogger.js +28 -1
  43. package/lib/module/classes/HMSLogger.js.map +1 -1
  44. package/lib/module/classes/HMSRemoteAudioTrack.js +16 -0
  45. package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
  46. package/lib/module/classes/HMSRemoteVideoTrack.js +16 -0
  47. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  48. package/lib/module/classes/HMSSDK.js +176 -134
  49. package/lib/module/classes/HMSSDK.js.map +1 -1
  50. package/lib/module/classes/HMSTrackSettings.js +3 -0
  51. package/lib/module/classes/HMSTrackSettings.js.map +1 -1
  52. package/lib/module/classes/HMSVideoCodec.js +4 -4
  53. package/lib/module/classes/HMSVideoCodec.js.map +1 -1
  54. package/lib/module/index.js +1 -0
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/typescript/classes/HMSLocalPeer.d.ts +3 -0
  57. package/lib/typescript/classes/HMSLogger.d.ts +7 -0
  58. package/lib/typescript/classes/HMSSDK.d.ts +11 -11
  59. package/lib/typescript/classes/HMSTrackSettings.d.ts +2 -0
  60. package/lib/typescript/classes/HMSVideoCodec.d.ts +4 -4
  61. package/lib/typescript/index.d.ts +1 -0
  62. package/package.json +1 -1
  63. package/src/classes/HMSEncoder.ts +3 -1
  64. package/src/classes/HMSLocalAudioTrack.ts +16 -0
  65. package/src/classes/HMSLocalPeer.ts +3 -0
  66. package/src/classes/HMSLocalVideoTrack.ts +15 -0
  67. package/src/classes/HMSLogger.ts +14 -1
  68. package/src/classes/HMSRemoteAudioTrack.ts +16 -0
  69. package/src/classes/HMSRemoteVideoTrack.ts +16 -0
  70. package/src/classes/HMSSDK.tsx +134 -73
  71. package/src/classes/HMSTrackSettings.ts +3 -0
  72. package/src/classes/HMSVideoCodec.ts +4 -4
  73. package/src/index.ts +1 -0
@@ -1,4 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
+ import { HMSSDK } from './HMSSDK';
2
3
  import { HMSVideoTrack } from './HMSVideoTrack';
3
4
  import type { HMSTrackType } from './HMSTrackType';
4
5
 
@@ -19,6 +20,14 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
19
20
  * @memberof HMSRemoteVideoTrack
20
21
  */
21
22
  setPlaybackAllowed(playbackAllowed: boolean) {
23
+ const logger = HMSSDK.getLogger();
24
+ logger?.verbose('#Function setPlaybackAllowed', {
25
+ trackId: this.trackId,
26
+ id: this.id,
27
+ source: this.source,
28
+ type: this.type,
29
+ playbackAllowed,
30
+ });
22
31
  HmsManager.setPlaybackAllowed({
23
32
  id: this.id,
24
33
  trackId: this.trackId,
@@ -28,6 +37,13 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
28
37
 
29
38
  isPlaybackAllowed = async () => {
30
39
  try {
40
+ const logger = HMSSDK.getLogger();
41
+ logger?.verbose('#Function isPlaybackAllowed', {
42
+ trackId: this.trackId,
43
+ id: this.id,
44
+ source: this.source,
45
+ type: this.type,
46
+ });
31
47
  const val = await HmsManager.isPlaybackAllowed({
32
48
  id: this.id,
33
49
  trackId: this.trackId,
@@ -38,12 +38,13 @@ const HmsEventEmitter = new NativeEventEmitter(HmsManager);
38
38
 
39
39
  let HmsSdk: HMSSDK | undefined;
40
40
 
41
+ let logger: HMSLogger | undefined;
42
+
41
43
  export class HMSSDK {
42
44
  room?: HMSRoom;
43
45
  localPeer?: HMSLocalPeer;
44
46
  remotePeers?: HMSRemotePeer[];
45
47
  knownRoles?: HMSRole[];
46
- logger?: HMSLogger;
47
48
  id: string;
48
49
  private muteStatus: boolean | undefined;
49
50
 
@@ -81,6 +82,15 @@ export class HMSSDK {
81
82
  return HmsSdk;
82
83
  }
83
84
 
85
+ static getLogger() {
86
+ return logger;
87
+ }
88
+
89
+ setLogger = (hmsLogger: HMSLogger) => {
90
+ logger = hmsLogger;
91
+ hmsLogger.verbose('#Function setLogger', { id: this.id });
92
+ };
93
+
84
94
  destroy = () => {
85
95
  this.removeListeners();
86
96
  };
@@ -224,12 +234,12 @@ export class HMSSDK {
224
234
  * @memberof HMSSDK
225
235
  */
226
236
  join = async (config: HMSConfig) => {
227
- this.logger?.verbose('JOIN', { config });
237
+ logger?.verbose('#Function join', { config, id: this.id });
228
238
  await HmsManager.join({ ...config, id: this.id });
229
239
  };
230
240
 
231
241
  preview = (config: HMSConfig) => {
232
- this.logger?.verbose('PREVIEW', { config });
242
+ logger?.verbose('#Function preview', { config, id: this.id });
233
243
  HmsManager.preview({ ...config, id: this.id });
234
244
  };
235
245
 
@@ -258,31 +268,45 @@ export class HMSSDK {
258
268
  * @memberof HMSSDK
259
269
  */
260
270
  leave = async () => {
261
- this.logger?.verbose('LEAVE', {});
271
+ logger?.verbose('#Function leave', { id: this.id });
262
272
  const data = {
263
273
  id: this.id,
264
274
  };
265
275
 
266
- await HmsManager.leave(data);
276
+ const op = await HmsManager.leave(data);
267
277
  this.muteStatus = undefined;
268
278
  this.localPeer = undefined;
269
279
  this.remotePeers = undefined;
270
280
  this.room = undefined;
271
281
  this.knownRoles = undefined;
282
+ return op;
272
283
  };
273
284
 
274
- sendBroadcastMessage = (message: string, type?: string) => {
275
- this.logger?.verbose('SEND_BROADCAST_MESSAGE', { message });
276
- HmsManager.sendBroadcastMessage({
285
+ sendBroadcastMessage = async (message: string, type?: string) => {
286
+ logger?.verbose('#Function sendBroadcastMessage', {
287
+ message,
288
+ type: type || null,
289
+ id: this.id,
290
+ });
291
+ return await HmsManager.sendBroadcastMessage({
277
292
  message,
278
293
  type: type || null,
279
294
  id: this.id,
280
295
  });
281
296
  };
282
297
 
283
- sendGroupMessage = (message: string, roles: HMSRole[], type?: string) => {
284
- this.logger?.verbose('SEND_GROUP_MESSAGE', { message, roles });
285
- HmsManager.sendGroupMessage({
298
+ sendGroupMessage = async (
299
+ message: string,
300
+ roles: HMSRole[],
301
+ type?: string
302
+ ) => {
303
+ logger?.verbose('#Function sendGroupMessage', {
304
+ message,
305
+ roles,
306
+ id: this.id,
307
+ type: type || null,
308
+ });
309
+ return await HmsManager.sendGroupMessage({
286
310
  message,
287
311
  roles: HMSHelper.getRoleNames(roles),
288
312
  id: this.id,
@@ -290,9 +314,18 @@ export class HMSSDK {
290
314
  });
291
315
  };
292
316
 
293
- sendDirectMessage = (message: string, peerId: string, type?: string) => {
294
- this.logger?.verbose('SEND_DIRECT_MESSAGE', { message, peerId });
295
- HmsManager.sendDirectMessage({
317
+ sendDirectMessage = async (
318
+ message: string,
319
+ peerId: string,
320
+ type?: string
321
+ ) => {
322
+ logger?.verbose('#Function sendDirectMessage', {
323
+ message,
324
+ peerId,
325
+ id: this.id,
326
+ type: type || null,
327
+ });
328
+ return await HmsManager.sendDirectMessage({
296
329
  message,
297
330
  peerId,
298
331
  id: this.id,
@@ -301,56 +334,64 @@ export class HMSSDK {
301
334
  };
302
335
 
303
336
  changeMetadata = (metadata: string) => {
304
- this.logger?.verbose('CHANGE_METADATA', { metadata });
337
+ logger?.verbose('#Function changeMetadata', { metadata, id: this.id });
305
338
  HmsManager.changeMetadata({ metadata, id: this.id });
306
339
  };
307
340
 
308
341
  startRTMPOrRecording = async (data: HMSRTMPConfig) => {
309
- this.logger?.verbose('START_RTMP_OR_RECORDING', { data });
342
+ logger?.verbose('#Function startRTMPOrRecording', {
343
+ ...data,
344
+ id: this.id,
345
+ });
310
346
 
311
347
  const op = await HmsManager.startRTMPOrRecording({ ...data, id: this.id });
312
348
  return op;
313
349
  };
314
350
 
315
351
  stopRtmpAndRecording = async () => {
316
- this.logger?.verbose('STOP_RTMP_OR_RECORDING', {});
352
+ logger?.verbose('#Function stopRtmpAndRecording', {});
317
353
  const op = await HmsManager.stopRtmpAndRecording({ id: this.id });
318
354
  return op;
319
355
  };
320
356
 
321
- changeRole = (peer: HMSPeer, role: HMSRole, force: boolean = false) => {
357
+ changeRole = async (peer: HMSPeer, role: HMSRole, force: boolean = false) => {
322
358
  const data = {
323
359
  peerId: peer?.peerID,
324
360
  role: role?.name,
325
361
  force: force,
326
362
  id: this.id,
327
363
  };
328
- this.logger?.verbose('CHANGE_ROLE', data);
329
- HmsManager.changeRole(data);
364
+ logger?.verbose('#Function changeRole', data);
365
+ return await HmsManager.changeRole(data);
330
366
  };
331
367
 
332
- changeTrackState = (track: HMSTrack, mute: boolean) => {
333
- this.logger?.verbose('CHANGE_TRACK_STATE', { track, mute });
368
+ changeTrackState = async (track: HMSTrack, mute: boolean) => {
369
+ logger?.verbose('#Function changeTrackState', {
370
+ track,
371
+ mute,
372
+ id: this.id,
373
+ });
334
374
  const data = {
335
375
  trackId: track.trackId,
336
376
  mute,
337
377
  id: this.id,
338
378
  };
339
379
 
340
- HmsManager.changeTrackState(data);
380
+ return await HmsManager.changeTrackState(data);
341
381
  };
342
382
 
343
- changeTrackStateRoles = (
383
+ changeTrackStateRoles = async (
344
384
  type: HMSTrackType,
345
385
  mute: boolean,
346
386
  source: string,
347
387
  roles: Array<HMSRole>
348
388
  ) => {
349
- this.logger?.verbose('CHANGE_TRACK_STATE_ROLES', {
389
+ logger?.verbose('#Function changeTrackStateRoles', {
350
390
  source,
351
391
  mute,
352
392
  type,
353
393
  roles,
394
+ id: this.id,
354
395
  });
355
396
  const data = {
356
397
  source,
@@ -360,44 +401,47 @@ export class HMSSDK {
360
401
  id: this.id,
361
402
  };
362
403
 
363
- HmsManager.changeTrackStateRoles(data);
404
+ return await HmsManager.changeTrackStateRoles(data);
364
405
  };
365
406
 
366
- removePeer = (peerId: string, reason: string) => {
367
- this.logger?.verbose('REMOVE_PEER', { peerId, reason });
407
+ removePeer = async (peerId: string, reason: string) => {
408
+ logger?.verbose('#Function removePeer', { peerId, reason, id: this.id });
368
409
  const data = {
369
410
  peerId,
370
411
  reason,
371
412
  id: this.id,
372
413
  };
373
414
 
374
- HmsManager.removePeer(data);
415
+ return await HmsManager.removePeer(data);
375
416
  };
376
417
 
377
- endRoom = (lock: boolean, reason: string) => {
378
- this.logger?.verbose('END_ROOM', { lock, reason });
418
+ endRoom = async (lock: boolean, reason: string) => {
419
+ logger?.verbose('#Function endRoom', { lock, reason, id: this.id });
379
420
  const data = {
380
421
  lock,
381
422
  reason,
382
423
  id: this.id,
383
424
  };
384
425
 
385
- HmsManager.endRoom(data);
426
+ return await HmsManager.endRoom(data);
386
427
  };
387
428
 
388
429
  acceptRoleChange = () => {
389
- this.logger?.verbose('ACCEPT_ROLE_CHANGE', {});
430
+ logger?.verbose('#Function acceptRoleChange', { id: this.id });
390
431
  HmsManager.acceptRoleChange({ id: this.id });
391
432
  };
392
433
 
393
434
  muteAllPeersAudio = (mute: boolean) => {
394
- this.logger?.verbose('ON_MUTE_ALL_PEERS', { mute });
435
+ logger?.verbose('#Function muteAllPeersAudio', { mute, id: this.id });
395
436
  this.muteStatus = mute;
396
437
  HmsManager.muteAllPeersAudio({ mute, id: this.id });
397
438
  };
398
439
 
399
440
  getRoom = async () => {
400
- this.logger?.verbose('GET_ROOM_API_CALL', { roomID: this.id });
441
+ logger?.verbose('#Function getRoom', {
442
+ roomID: this.room?.id,
443
+ id: this.id,
444
+ });
401
445
  const hmsRoom = await HmsManager.getRoom({ id: this.id });
402
446
 
403
447
  const encodedHmsRoom = HMSEncoder.encodeHmsRoom(hmsRoom, this.id);
@@ -405,7 +449,11 @@ export class HMSSDK {
405
449
  };
406
450
 
407
451
  setVolume = (track: HMSTrack, volume: number) => {
408
- this.logger?.verbose('SET_VOLUME_CALL', { track, volume });
452
+ logger?.verbose('#Function setVolume', {
453
+ track,
454
+ volume,
455
+ id: this.id,
456
+ });
409
457
  HmsManager.setVolume({
410
458
  id: this.id,
411
459
  trackId: track.trackId,
@@ -423,7 +471,10 @@ export class HMSSDK {
423
471
  * @memberof HMSSDK
424
472
  */
425
473
  addEventListener = (action: HMSUpdateListenerActions, callback: any) => {
426
- this.logger?.verbose('ON_ATTACH_EVENT_LISTENER', { action });
474
+ logger?.verbose('#Function addEventListener', {
475
+ action,
476
+ id: this.id,
477
+ });
427
478
  switch (action) {
428
479
  case HMSUpdateListenerActions.ON_PREVIEW:
429
480
  this.onPreviewDelegate = callback;
@@ -477,7 +528,7 @@ export class HMSSDK {
477
528
  * @memberof HMSSDK
478
529
  */
479
530
  removeEventListener = (action: HMSUpdateListenerActions) => {
480
- this.logger?.verbose('ON_REMOVE_LISTENER', { action });
531
+ logger?.verbose('#Function removeEventListener', { action, id: this.id });
481
532
  switch (action) {
482
533
  case HMSUpdateListenerActions.ON_PREVIEW:
483
534
  this.onPreviewDelegate = null;
@@ -542,19 +593,14 @@ export class HMSSDK {
542
593
  this.onChangeTrackStateRequestDelegate = null;
543
594
  this.onRemovedFromRoomDelegate = null;
544
595
 
545
- this.logger?.verbose('REMOVE_ALL_LISTENER', {});
546
- };
547
-
548
- setLogger = (hmsLogger: HMSLogger) => {
549
- this.logger = hmsLogger;
550
- hmsLogger.verbose('UPDATE_LOGGER', { hmsLogger });
596
+ logger?.verbose('#Function REMOVE_ALL_LISTENER', { id: this.id });
551
597
  };
552
598
 
553
599
  onPreviewListener = (data: any) => {
554
600
  if (data.id !== this.id) {
555
601
  return;
556
602
  }
557
- this.logger?.verbose('ON_PREVIEW', data);
603
+ logger?.verbose('#Listener ON_PREVIEW', data);
558
604
  const room: HMSRoom = HMSEncoder.encodeHmsRoom(data.room, this.id);
559
605
  const localPeer: HMSLocalPeer = HMSEncoder.encodeHmsLocalPeer(
560
606
  data.localPeer,
@@ -566,7 +612,7 @@ export class HMSSDK {
566
612
  this.localPeer = localPeer;
567
613
  this.room = room;
568
614
  if (this.onPreviewDelegate) {
569
- this.logger?.verbose('ON_PREVIEW_LISTENER_CALL', {
615
+ logger?.verbose('#Listener ON_PREVIEW_LISTENER_CALL', {
570
616
  ...data,
571
617
  room,
572
618
  localPeer,
@@ -580,7 +626,7 @@ export class HMSSDK {
580
626
  if (data.id !== this.id) {
581
627
  return;
582
628
  }
583
- this.logger?.verbose('ON_JOIN', data);
629
+ logger?.verbose('#LISTENER ON_JOIN', data);
584
630
  // Preprocessing
585
631
  const room: HMSRoom = HMSEncoder.encodeHmsRoom(data.room, this.id);
586
632
  const localPeer: HMSLocalPeer = HMSEncoder.encodeHmsLocalPeer(
@@ -597,7 +643,7 @@ export class HMSSDK {
597
643
  this.remotePeers = remotePeers;
598
644
  this.knownRoles = roles;
599
645
  if (this.onJoinDelegate) {
600
- this.logger?.verbose('ON_JOIN_LISTENER_CALL', {
646
+ logger?.verbose('#Listener ON_JOIN_LISTENER_CALL', {
601
647
  ...data,
602
648
  room,
603
649
  localPeer,
@@ -611,7 +657,7 @@ export class HMSSDK {
611
657
  if (data.id !== this.id) {
612
658
  return;
613
659
  }
614
- this.logger?.verbose('ON_ROOM', data);
660
+ logger?.verbose('#Listener ON_ROOM', data);
615
661
  const room: HMSRoom = HMSEncoder.encodeHmsRoom(data.room, this.id);
616
662
  const localPeer: HMSLocalPeer = HMSEncoder.encodeHmsLocalPeer(
617
663
  data.localPeer,
@@ -625,7 +671,7 @@ export class HMSSDK {
625
671
  this.localPeer = localPeer;
626
672
  this.remotePeers = remotePeers;
627
673
  if (this.onRoomDelegate) {
628
- this.logger?.verbose('ON_ROOM_LISTENER_CALL', {
674
+ logger?.verbose('#Listener ON_ROOM_LISTENER_CALL', {
629
675
  ...data,
630
676
  room,
631
677
  localPeer,
@@ -639,7 +685,8 @@ export class HMSSDK {
639
685
  if (data.id !== this.id) {
640
686
  return;
641
687
  }
642
- this.logger?.verbose('ON_PEER', data);
688
+ logger?.verbose('#Listener ON_PEER', data);
689
+ const peer: HMSPeer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
643
690
  const room: HMSRoom = HMSEncoder.encodeHmsRoom(data.room, this.id);
644
691
  const localPeer: HMSLocalPeer = HMSEncoder.encodeHmsLocalPeer(
645
692
  data.localPeer,
@@ -654,8 +701,8 @@ export class HMSSDK {
654
701
  this.remotePeers = remotePeers;
655
702
  this.room = room;
656
703
  if (this.onPeerDelegate) {
657
- this.logger?.verbose('ON_PEER_LISTENER_CALL', data);
658
- this.onPeerDelegate({ ...data, localPeer, remotePeers, room });
704
+ logger?.verbose('#Listener ON_PEER_LISTENER_CALL', data);
705
+ this.onPeerDelegate({ ...data, localPeer, remotePeers, room, peer });
659
706
  }
660
707
  };
661
708
 
@@ -663,7 +710,9 @@ export class HMSSDK {
663
710
  if (data.id !== this.id) {
664
711
  return;
665
712
  }
666
- this.logger?.verbose('ON_TRACK', data);
713
+ logger?.verbose('#Listener ON_TRACK', data);
714
+ const track: HMSTrack = HMSEncoder.encodeHmsTrack(data.track, this.id);
715
+ const peer: HMSPeer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
667
716
  const room: HMSRoom = HMSEncoder.encodeHmsRoom(data.room, this.id);
668
717
  const localPeer: HMSLocalPeer = HMSEncoder.encodeHmsLocalPeer(
669
718
  data.localPeer,
@@ -680,8 +729,15 @@ export class HMSSDK {
680
729
  this.localPeer = localPeer;
681
730
  this.remotePeers = remotePeers;
682
731
  if (this.onTrackDelegate) {
683
- this.logger?.verbose('ON_TRACK_LISTENER_CALL', data);
684
- this.onTrackDelegate({ ...data, localPeer, remotePeers, room });
732
+ logger?.verbose('#Listener ON_TRACK_LISTENER_CALL', data);
733
+ this.onTrackDelegate({
734
+ ...data,
735
+ localPeer,
736
+ remotePeers,
737
+ room,
738
+ peer,
739
+ track,
740
+ });
685
741
  }
686
742
  };
687
743
 
@@ -689,10 +745,10 @@ export class HMSSDK {
689
745
  if (data.id !== this.id) {
690
746
  return;
691
747
  }
692
- this.logger?.verbose('ON_MESSAGE', data);
748
+ logger?.verbose('#Listener ON_MESSAGE', data);
693
749
  const message = new HMSMessage(data);
694
750
  if (this.onMessageDelegate) {
695
- this.logger?.verbose('ON_MESSAGE_LISTENER_CALL', message);
751
+ logger?.verbose('#Listener ON_MESSAGE_LISTENER_CALL', message);
696
752
  this.onMessageDelegate(message);
697
753
  }
698
754
  };
@@ -701,8 +757,9 @@ export class HMSSDK {
701
757
  if (data.id !== this.id) {
702
758
  return;
703
759
  }
704
- this.logger?.verbose('ON_SPEAKER', data);
760
+ logger?.verbose('#Listener ON_SPEAKER', data);
705
761
  if (this.onSpeakerDelegate) {
762
+ logger?.verbose('#Listener ON_SPEAKER_LISTENER_CALL', data);
706
763
  this.onSpeakerDelegate(data);
707
764
  }
708
765
  };
@@ -711,11 +768,11 @@ export class HMSSDK {
711
768
  if (data.id !== this.id) {
712
769
  return;
713
770
  }
714
- this.logger?.warn('ON_ERROR', data);
715
- this.logger?.verbose('ON_ERROR', data);
771
+ logger?.warn('#Listener ON_ERROR', data);
772
+ logger?.verbose('#Listener ON_ERROR', data);
716
773
  if (this.onErrorDelegate) {
717
- this.logger?.verbose('ON_ERROR_LISTENER_CALL', data);
718
- this.logger?.warn('ON_ERROR_LISTENER_CALL', data);
774
+ logger?.verbose('#Listener ON_ERROR_LISTENER_CALL', data);
775
+ logger?.warn('#Listener ON_ERROR_LISTENER_CALL', data);
719
776
  this.onErrorDelegate(data);
720
777
  }
721
778
  };
@@ -724,14 +781,14 @@ export class HMSSDK {
724
781
  if (data.id !== this.id) {
725
782
  return;
726
783
  }
727
- this.logger?.verbose('ON_ROLE_CHANGE_REQUEST', data);
784
+ logger?.verbose('#Listener ON_ROLE_CHANGE_REQUEST', data);
728
785
  if (this.onRoleChangeRequestDelegate) {
729
786
  const encodedRoleChangeRequest = HMSEncoder.encodeHmsRoleChangeRequest(
730
787
  data,
731
788
  this.id
732
789
  );
733
- this.logger?.verbose(
734
- 'ON_ROLE_CHANGE_LISTENER_CALL',
790
+ logger?.verbose(
791
+ '#Listener ON_ROLE_CHANGE_LISTENER_CALL',
735
792
  encodedRoleChangeRequest
736
793
  );
737
794
  this.onRoleChangeRequestDelegate(encodedRoleChangeRequest);
@@ -739,12 +796,15 @@ export class HMSSDK {
739
796
  };
740
797
 
741
798
  onChangeTrackStateRequestListener = (data: any) => {
742
- this.logger?.verbose('ON_CHANGE_TRACK_STATE_REQUEST', data);
799
+ if (data.id !== this.id) {
800
+ return;
801
+ }
802
+ logger?.verbose('#Listener ON_CHANGE_TRACK_STATE_REQUEST', data);
743
803
  if (this.onChangeTrackStateRequestDelegate) {
744
804
  const encodedRoleChangeRequest =
745
805
  HMSEncoder.encodeHmsChangeTrackStateRequest(data, this.id);
746
- this.logger?.verbose(
747
- 'ON_CHANGE_TRACK_STATE_REQUEST_LISTENER_CALL',
806
+ logger?.verbose(
807
+ '#Listener ON_CHANGE_TRACK_STATE_REQUEST_LISTENER_CALL',
748
808
  encodedRoleChangeRequest
749
809
  );
750
810
  this.onChangeTrackStateRequestDelegate(encodedRoleChangeRequest);
@@ -755,7 +815,7 @@ export class HMSSDK {
755
815
  if (data.id !== this.id) {
756
816
  return;
757
817
  }
758
- this.logger?.verbose('ON_REMOVED_FROM_ROOM', data);
818
+ logger?.verbose('#Listener ON_REMOVED_FROM_ROOM', data);
759
819
  if (this.onRemovedFromRoomDelegate) {
760
820
  let requestedBy = null;
761
821
  if (data.requestedBy) {
@@ -764,10 +824,11 @@ export class HMSSDK {
764
824
  const reason = data.reason;
765
825
  const roomEnded = data.roomEnded;
766
826
 
767
- this.logger?.verbose('ON_REMOVED_FROM_ROOM_LISTENER_CALL', {
827
+ logger?.verbose('#Listener ON_REMOVED_FROM_ROOM_LISTENER_CALL', {
768
828
  requestedBy,
769
829
  reason,
770
830
  roomEnded,
831
+ id: this.id,
771
832
  });
772
833
  this.onRemovedFromRoomDelegate({ requestedBy, reason, roomEnded });
773
834
  }
@@ -777,7 +838,7 @@ export class HMSSDK {
777
838
  if (data.id !== this.id) {
778
839
  return;
779
840
  }
780
- this.logger?.verbose('ON_RECONNECTING', data);
841
+ logger?.verbose('#Listener ON_RECONNECTING', data);
781
842
  if (this.onReconnectingDelegate) {
782
843
  this.onReconnectingDelegate(data);
783
844
  }
@@ -787,7 +848,7 @@ export class HMSSDK {
787
848
  if (data.id !== this.id) {
788
849
  return;
789
850
  }
790
- this.logger?.verbose('ON_RECONNECTED', data);
851
+ logger?.verbose('#Listener ON_RECONNECTED', data);
791
852
  if (this.onReconnectedDelegate) {
792
853
  this.onReconnectedDelegate(data);
793
854
  }
@@ -4,14 +4,17 @@ import type { HMSVideoTrackSettings } from './HMSVideoTrackSettings';
4
4
  export class HMSTrackSettings {
5
5
  video?: HMSVideoTrackSettings;
6
6
  audio?: HMSAudioTrackSettings;
7
+ useHardwareEchoCancellation?: boolean;
7
8
 
8
9
  constructor(params?: {
9
10
  video?: HMSVideoTrackSettings;
10
11
  audio?: HMSAudioTrackSettings;
12
+ useHardwareEchoCancellation?: boolean;
11
13
  }) {
12
14
  if (params) {
13
15
  this.video = params.video;
14
16
  this.audio = params.audio;
17
+ this.useHardwareEchoCancellation = params.useHardwareEchoCancellation;
15
18
  }
16
19
  }
17
20
  }
@@ -1,6 +1,6 @@
1
1
  export enum HMSVideoCodec {
2
- h264 = 'h264',
3
- vp8 = 'vp8',
4
- vp9 = 'vp9',
5
- h265 = 'h265',
2
+ H264 = 'H264',
3
+ VP8 = 'VP8',
4
+ VP9 = 'VP9',
5
+ H265 = 'H265',
6
6
  }
package/src/index.ts CHANGED
@@ -46,6 +46,7 @@ export * from './classes/HMSRtmpStreamingState';
46
46
  export * from './classes/HMSServerRecordingState';
47
47
  export * from './classes/HMSBrowserRecordingState';
48
48
  export * from './classes/HMSRTMPConfig';
49
+ export * from './classes/HMSVideoResolution';
49
50
 
50
51
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
51
52
  export default HmsManager;