@100mslive/react-native-hms 0.9.9 → 0.9.91

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 (84) hide show
  1. package/README.md +50 -43
  2. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  3. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  6. package/android/.gradle/checksums/checksums.lock +0 -0
  7. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  8. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  9. package/android/.idea/libraries/{Gradle__com_github_100mslive_android_sdk_lib_2_4_2_aar.xml → Gradle__com_github_100mslive_android_sdk_lib_2_4_7_aar.xml} +4 -4
  10. package/android/.idea/libraries/Gradle__com_github_100mslive_webrtc_m97_hms_1_1_aar.xml +11 -0
  11. package/android/.idea/modules/android.androidTest.iml +4 -4
  12. package/android/.idea/modules/android.main.iml +4 -4
  13. package/android/.idea/modules/android.unitTest.iml +4 -4
  14. package/android/build.gradle +2 -2
  15. package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +84 -0
  16. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +77 -8
  17. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +95 -22
  18. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +86 -0
  19. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +255 -34
  20. package/ios/HMSDecoder.swift +9 -8
  21. package/ios/HMSHelper.swift +5 -8
  22. package/ios/HMSManager.swift +5 -4
  23. package/ios/HMSRNSDK.swift +27 -32
  24. package/lib/commonjs/classes/HMSAudioDevice.js +17 -0
  25. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -0
  26. package/lib/commonjs/classes/HMSAudioMixingMode.js +15 -0
  27. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -0
  28. package/lib/commonjs/classes/HMSAudioMode.js +17 -0
  29. package/lib/commonjs/classes/HMSAudioMode.js.map +1 -0
  30. package/lib/commonjs/classes/HMSEncoder.js +15 -0
  31. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  32. package/lib/commonjs/classes/HMSException.js +18 -13
  33. package/lib/commonjs/classes/HMSException.js.map +1 -1
  34. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
  35. package/lib/commonjs/classes/HMSPermissions.js +7 -4
  36. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  37. package/lib/commonjs/classes/HMSSDK.js +184 -9
  38. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  39. package/lib/commonjs/classes/HMSUpdateListenerActions.js +1 -0
  40. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  41. package/lib/commonjs/index.js +42 -0
  42. package/lib/commonjs/index.js.map +1 -1
  43. package/lib/module/classes/HMSAudioDevice.js +10 -0
  44. package/lib/module/classes/HMSAudioDevice.js.map +1 -0
  45. package/lib/module/classes/HMSAudioMixingMode.js +8 -0
  46. package/lib/module/classes/HMSAudioMixingMode.js.map +1 -0
  47. package/lib/module/classes/HMSAudioMode.js +10 -0
  48. package/lib/module/classes/HMSAudioMode.js.map +1 -0
  49. package/lib/module/classes/HMSEncoder.js +14 -0
  50. package/lib/module/classes/HMSEncoder.js.map +1 -1
  51. package/lib/module/classes/HMSException.js +18 -13
  52. package/lib/module/classes/HMSException.js.map +1 -1
  53. package/lib/module/classes/HMSHLSConfig.js.map +1 -1
  54. package/lib/module/classes/HMSPermissions.js +7 -4
  55. package/lib/module/classes/HMSPermissions.js.map +1 -1
  56. package/lib/module/classes/HMSSDK.js +184 -9
  57. package/lib/module/classes/HMSSDK.js.map +1 -1
  58. package/lib/module/classes/HMSUpdateListenerActions.js +1 -0
  59. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  60. package/lib/module/index.js +3 -0
  61. package/lib/module/index.js.map +1 -1
  62. package/lib/typescript/classes/HMSAudioDevice.d.ts +7 -0
  63. package/lib/typescript/classes/HMSAudioMixingMode.d.ts +5 -0
  64. package/lib/typescript/classes/HMSAudioMode.d.ts +7 -0
  65. package/lib/typescript/classes/HMSEncoder.d.ts +2 -0
  66. package/lib/typescript/classes/HMSException.d.ts +8 -14
  67. package/lib/typescript/classes/HMSHLSConfig.d.ts +2 -2
  68. package/lib/typescript/classes/HMSPermissions.d.ts +6 -4
  69. package/lib/typescript/classes/HMSSDK.d.ts +105 -7
  70. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +2 -1
  71. package/lib/typescript/index.d.ts +3 -0
  72. package/package.json +1 -1
  73. package/react-native-hms.podspec +1 -1
  74. package/src/classes/HMSAudioDevice.ts +7 -0
  75. package/src/classes/HMSAudioMixingMode.ts +5 -0
  76. package/src/classes/HMSAudioMode.ts +7 -0
  77. package/src/classes/HMSEncoder.ts +12 -0
  78. package/src/classes/HMSException.ts +15 -24
  79. package/src/classes/HMSHLSConfig.ts +2 -2
  80. package/src/classes/HMSPermissions.ts +9 -6
  81. package/src/classes/HMSSDK.tsx +250 -16
  82. package/src/classes/HMSUpdateListenerActions.ts +1 -0
  83. package/src/index.ts +3 -0
  84. package/android/.idea/libraries/Gradle__com_github_100mslive_webrtc_m97_aar.xml +0 -11
@@ -14,6 +14,9 @@ import type { HMSVideoViewMode } from './HMSVideoViewMode';
14
14
  import type { HMSTrackSettings } from './HMSTrackSettings';
15
15
  import type { HMSRTMPConfig } from './HMSRTMPConfig';
16
16
  import type { HMSHLSConfig } from './HMSHLSConfig';
17
+ import type { HMSAudioDevice } from './HMSAudioDevice';
18
+ import type { HMSAudioMode } from './HMSAudioMode';
19
+ import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
17
20
  interface HmsViewProps {
18
21
  trackId: string;
19
22
  style?: ViewStyle;
@@ -47,6 +50,7 @@ export declare class HMSSDK {
47
50
  onLocalVideoStatsDelegate?: any;
48
51
  onRemoteAudioStatsDelegate?: any;
49
52
  onRemoteVideoStatsDelegate?: any;
53
+ onAudioDeviceChangedDelegate?: any;
50
54
  constructor(id: string);
51
55
  /**
52
56
  * - Returns an instance of [HMSSDK]{@link HMSSDK}
@@ -129,13 +133,14 @@ export declare class HMSSDK {
129
133
  */
130
134
  previewForRole: (role: HMSRole) => Promise<any>;
131
135
  /**
132
- * - HmsView is react component that takes one track and starts showing that track on a tile.
136
+ * - HmsView is react component that takes trackId and starts showing that track on a tile.
133
137
  * - The appearance of tile is completely customizable with style prop.
134
- * - scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
138
+ * - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
139
+ * - Mirror to flip the video vertically.
135
140
  *
136
141
  * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
137
142
  *
138
- * @param {HmsComponentProps}
143
+ * @param {HmsViewProps}
139
144
  * @memberof HMSSDK
140
145
  */
141
146
  HmsView: React.ForwardRefExoticComponent<HmsViewProps & React.RefAttributes<any>>;
@@ -215,7 +220,7 @@ export declare class HMSSDK {
215
220
  * @param {HMSHLSConfig}
216
221
  * @memberof HMSSDK
217
222
  */
218
- startHLSStreaming: (data: HMSHLSConfig) => Promise<any>;
223
+ startHLSStreaming: (data?: HMSHLSConfig) => Promise<any>;
219
224
  /**
220
225
  * - stopHLSStreaming function stops the ongoing HLSStreams.
221
226
  * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
@@ -242,7 +247,7 @@ export declare class HMSSDK {
242
247
  changeRole: (peer: HMSPeer, role: HMSRole, force?: boolean) => Promise<any>;
243
248
  /**
244
249
  * - This function can be used to manipulate mute status of any track.
245
- * - Targeted peer affected by this action will get a callback in {@link onChangeTrackStateRequestListener}.
250
+ * - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
246
251
  *
247
252
  * * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
248
253
  *
@@ -254,7 +259,7 @@ export declare class HMSSDK {
254
259
  * - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
255
260
  * - We can change mute status for all the tracks of peers having a particular role.
256
261
  * - @param source determines the source of the track ex. video, audio etc.
257
- * - The peers affected by this action will get a callback in {@link onChangeTrackStateRequestListener}.
262
+ * - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
258
263
  *
259
264
  * @memberof HMSSDK
260
265
  */
@@ -295,7 +300,7 @@ export declare class HMSSDK {
295
300
  */
296
301
  acceptRoleChange: () => Promise<any>;
297
302
  /**
298
- * - setPlaybackForAllAudio is an extension of the abilities of {@link setPlaybackAllowed} in
303
+ * - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
299
304
  * {@link HMSRemoteAudioTrack}, it sets mute status for all peers in the room
300
305
  *
301
306
  * checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
@@ -382,6 +387,94 @@ export declare class HMSSDK {
382
387
  * @memberof HMSSDK
383
388
  */
384
389
  disableRTCStats: () => void;
390
+ /**
391
+ * - This wrapper function is used to start streaming device audio, currently available only for android.
392
+ *
393
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
394
+ *
395
+ * @param {HMSAudioMixingMode}
396
+ * @memberof HMSSDK
397
+ */
398
+ startAudioshare: (audioMixingMode: HMSAudioMixingMode) => Promise<any>;
399
+ /**
400
+ * - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
401
+ *
402
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
403
+ *
404
+ * @memberof HMSSDK
405
+ */
406
+ isAudioShared: () => Promise<any>;
407
+ /**
408
+ * - This wrapper function is used to stop streaming device audio, currently available only for android.
409
+ *
410
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
411
+ *
412
+ * @memberof HMSSDK
413
+ */
414
+ stopAudioshare: () => Promise<any>;
415
+ /**
416
+ * - This wrapper function returns the current audio mixing mode, currently available only for android.
417
+ *
418
+ * @memberof HMSSDK
419
+ * @return HMSAudioMixingMode
420
+ */
421
+ getAudioMixingMode: () => Promise<any>;
422
+ /**
423
+ * - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
424
+ *
425
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
426
+ *
427
+ * @param {HMSAudioMixingMode}
428
+ * @memberof HMSSDK
429
+ */
430
+ setAudioMixingMode: (audioMixingMode: HMSAudioMixingMode) => Promise<any>;
431
+ /**
432
+ * - This wrapper function returns the array of audio output devices which is of
433
+ * type {@link HMSAudioDevice[]}, currently available only for android.
434
+ *
435
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
436
+ *
437
+ * @memberof HMSSDK
438
+ * @return HMSAudioDevice[]
439
+ */
440
+ getAudioDevicesList: () => Promise<any>;
441
+ /**
442
+ * - This wrapper function returns the current audio output device which is of
443
+ * type {@link HMSAudioDevice}, currently available only for android.
444
+ *
445
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
446
+ *
447
+ * @memberof HMSSDK
448
+ * @return HMSAudioDevice
449
+ */
450
+ getAudioOutputRouteType: () => Promise<any>;
451
+ /**
452
+ * - This wrapper function used to switch output to device other than the default, currently available only for android.
453
+ *
454
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
455
+ *
456
+ * @param {HMSAudioDevice}
457
+ * @memberof HMSSDK
458
+ */
459
+ switchAudioOutput: (audioDevice: HMSAudioDevice) => any;
460
+ /**
461
+ * - This wrapper function used to change Audio Mode manually, currently available only for android.
462
+ *
463
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
464
+ *
465
+ * @param {HMSAudioMode}
466
+ * @memberof HMSSDK
467
+ */
468
+ setAudioMode: (audioMode: HMSAudioMode) => any;
469
+ /**
470
+ * - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
471
+ *
472
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
473
+ *
474
+ * @param {Function}
475
+ * @memberof HMSSDK
476
+ */
477
+ setAudioDeviceChangeListener: (callback: Function) => any;
385
478
  /**
386
479
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
387
480
  *
@@ -436,5 +529,10 @@ export declare class HMSSDK {
436
529
  onLocalVideoStatsListener: (data: any) => void;
437
530
  onRemoteAudioStatsListener: (data: any) => void;
438
531
  onRemoteVideoStatsListener: (data: any) => void;
532
+ onAudioDeviceChangedListener: (data: {
533
+ id: string;
534
+ device: string;
535
+ audioDevicesList: string[];
536
+ }) => void;
439
537
  }
440
538
  export {};
@@ -16,5 +16,6 @@ export declare enum HMSUpdateListenerActions {
16
16
  ON_LOCAL_AUDIO_STATS = "ON_LOCAL_AUDIO_STATS",
17
17
  ON_LOCAL_VIDEO_STATS = "ON_LOCAL_VIDEO_STATS",
18
18
  ON_REMOTE_AUDIO_STATS = "ON_REMOTE_AUDIO_STATS",
19
- ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS"
19
+ ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS",
20
+ ON_AUDIO_DEVICE_CHANGED = "ON_AUDIO_DEVICE_CHANGED"
20
21
  }
@@ -62,5 +62,8 @@ export * from './classes/HMSMessageRecipient';
62
62
  export * from './classes/HMSMessageRecipientType';
63
63
  export * from './classes/HMSNetworkQuality';
64
64
  export * from './classes/HMSRtmpVideoResolution';
65
+ export * from './classes/HMSAudioDevice';
66
+ export * from './classes/HMSAudioMode';
67
+ export * from './classes/HMSAudioMixingMode';
65
68
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
66
69
  export default HmsManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "0.9.9",
3
+ "version": "0.9.91",
4
4
  "description": "The React Native package for 100ms SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
18
  s.dependency "React-Core"
19
- s.dependency "HMSSDK", "0.3.2"
19
+ s.dependency "HMSSDK", "0.3.3"
20
20
  end
@@ -0,0 +1,7 @@
1
+ export enum HMSAudioDevice {
2
+ SPEAKER_PHONE = 'SPEAKER_PHONE',
3
+ WIRED_HEADSET = 'WIRED_HEADSET',
4
+ EARPIECE = 'EARPIECE',
5
+ BLUETOOTH = 'BLUETOOTH',
6
+ AUTOMATIC = 'AUTOMATIC',
7
+ }
@@ -0,0 +1,5 @@
1
+ export enum HMSAudioMixingMode {
2
+ TALK_ONLY = 'TALK_ONLY',
3
+ TALK_AND_MUSIC = 'TALK_AND_MUSIC',
4
+ MUSIC_ONLY = 'MUSIC_ONLY',
5
+ }
@@ -0,0 +1,7 @@
1
+ export enum HMSAudioMode {
2
+ MODE_NORMAL = 0,
3
+ MODE_RINGTONE = 1,
4
+ MODE_IN_CALL = 2,
5
+ MODE_IN_COMMUNICATION = 3,
6
+ MODE_CALL_SCREENING = 4,
7
+ }
@@ -27,6 +27,7 @@ import { HMSRtmpStreamingState } from './HMSRtmpStreamingState';
27
27
  import { HMSServerRecordingState } from './HMSServerRecordingState';
28
28
  import { HMSMessage } from './HMSMessage';
29
29
  import { HMSMessageRecipient } from './HMSMessageRecipient';
30
+ import { HMSException } from './HMSException';
30
31
 
31
32
  export class HMSEncoder {
32
33
  static encodeHmsRoom(room: HMSRoom, id: string) {
@@ -497,4 +498,15 @@ export class HMSEncoder {
497
498
  recipientRoles: this.encodeHmsRoles(data?.recipientRoles),
498
499
  });
499
500
  }
501
+
502
+ static encodeHMSException(data: any) {
503
+ return new HMSException({
504
+ code: data?.error?.code,
505
+ description: data?.error?.description,
506
+ message: data?.error?.message,
507
+ name: data?.error?.name,
508
+ action: data?.error?.action,
509
+ isTerminal: data?.error?.isTerminal,
510
+ });
511
+ }
500
512
  }
@@ -1,33 +1,24 @@
1
1
  export class HMSException {
2
- public error: {
2
+ code: number;
3
+ description: string;
4
+ message: string;
5
+ name: string;
6
+ action: string;
7
+ isTerminal: boolean;
8
+
9
+ constructor(params: {
3
10
  code: number;
4
11
  description: string;
5
- localizedDescription: string;
6
12
  message: string;
7
13
  name: string;
8
14
  action: string;
9
- };
10
- public event: string;
11
-
12
- constructor(params: {
13
- error: {
14
- code: number;
15
- description: string;
16
- localizedDescription: string;
17
- message: string;
18
- name: string;
19
- action: string;
20
- };
21
- event: string;
15
+ isTerminal: boolean;
22
16
  }) {
23
- this.error = {
24
- code: params.error.code,
25
- description: params.error.description,
26
- localizedDescription: params.error.localizedDescription,
27
- message: params.error.message,
28
- name: params.error.name,
29
- action: params.error.action,
30
- };
31
- this.event = params.event;
17
+ this.code = params.code;
18
+ this.description = params.description;
19
+ this.message = params.message;
20
+ this.name = params.name;
21
+ this.action = params.action;
22
+ this.isTerminal = params.isTerminal;
32
23
  }
33
24
  }
@@ -3,11 +3,11 @@ import type { HMSHLSRecordingConfig } from './HMSHLSRecordingConfig';
3
3
 
4
4
  export class HMSHLSConfig {
5
5
  hlsRecordingConfig?: HMSHLSRecordingConfig;
6
- meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
6
+ meetingURLVariants?: Array<HMSHLSMeetingURLVariant>;
7
7
 
8
8
  constructor(params: {
9
9
  hlsRecordingConfig?: HMSHLSRecordingConfig;
10
- meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
10
+ meetingURLVariants?: Array<HMSHLSMeetingURLVariant>;
11
11
  }) {
12
12
  this.hlsRecordingConfig = params.hlsRecordingConfig;
13
13
  this.meetingURLVariants = params.meetingURLVariants;
@@ -4,8 +4,9 @@ export class HMSPermissions {
4
4
  unmute?: boolean;
5
5
  mute?: boolean;
6
6
  changeRole?: boolean;
7
- recording?: boolean;
8
- streaming?: boolean;
7
+ browserRecording?: boolean;
8
+ hlsStreaming?: boolean;
9
+ rtmpStreaming?: boolean;
9
10
 
10
11
  constructor(params?: {
11
12
  endRoom?: boolean;
@@ -13,8 +14,9 @@ export class HMSPermissions {
13
14
  unmute?: boolean;
14
15
  mute?: boolean;
15
16
  changeRole?: boolean;
16
- recording?: boolean;
17
- streaming?: boolean;
17
+ browserRecording?: boolean;
18
+ hlsStreaming?: boolean;
19
+ rtmpStreaming?: boolean;
18
20
  }) {
19
21
  if (params) {
20
22
  this.endRoom = params.endRoom;
@@ -22,8 +24,9 @@ export class HMSPermissions {
22
24
  this.unmute = params.unmute;
23
25
  this.mute = params.mute;
24
26
  this.changeRole = params.changeRole;
25
- this.recording = params.recording;
26
- this.streaming = params.streaming;
27
+ this.browserRecording = params.browserRecording;
28
+ this.hlsStreaming = params.hlsStreaming;
29
+ this.rtmpStreaming = params.rtmpStreaming;
27
30
  }
28
31
  }
29
32
  }