@100mslive/react-native-hms 1.3.0 → 1.4.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 (42) hide show
  1. package/README.md +59 -5
  2. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +7 -0
  3. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +38 -0
  4. package/ios/HMSManager.m +1 -0
  5. package/ios/HMSManager.swift +7 -0
  6. package/ios/HMSRNSDK.swift +38 -0
  7. package/lib/commonjs/classes/HMSAudioTrackSettings.js +1 -1
  8. package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
  9. package/lib/commonjs/classes/HMSException.js +3 -4
  10. package/lib/commonjs/classes/HMSException.js.map +1 -1
  11. package/lib/commonjs/classes/HMSLocalVideoTrack.js +5 -6
  12. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  13. package/lib/commonjs/classes/HMSMessage.js +1 -2
  14. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  15. package/lib/commonjs/classes/HMSPeer.js +3 -4
  16. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  17. package/lib/commonjs/classes/HMSRemoteVideoTrack.js +0 -1
  18. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  19. package/lib/commonjs/classes/HMSSDK.js +38 -17
  20. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  21. package/lib/commonjs/classes/HMSVideoTrackSettings.js +1 -1
  22. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  23. package/lib/module/classes/HMSAudioTrackSettings.js +1 -1
  24. package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
  25. package/lib/module/classes/HMSException.js +3 -4
  26. package/lib/module/classes/HMSException.js.map +1 -1
  27. package/lib/module/classes/HMSLocalVideoTrack.js +5 -6
  28. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  29. package/lib/module/classes/HMSMessage.js +1 -2
  30. package/lib/module/classes/HMSMessage.js.map +1 -1
  31. package/lib/module/classes/HMSPeer.js +3 -4
  32. package/lib/module/classes/HMSPeer.js.map +1 -1
  33. package/lib/module/classes/HMSRemoteVideoTrack.js +0 -1
  34. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  35. package/lib/module/classes/HMSSDK.js +38 -17
  36. package/lib/module/classes/HMSSDK.js.map +1 -1
  37. package/lib/module/classes/HMSVideoTrackSettings.js +1 -1
  38. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  39. package/lib/typescript/classes/HMSSDK.d.ts +19 -11
  40. package/package.json +2 -2
  41. package/sdk-versions.json +2 -2
  42. package/src/classes/HMSSDK.tsx +45 -19
@@ -3,13 +3,13 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
4
  export class HMSVideoTrackSettings {
5
5
  // android only
6
- // android only
7
6
 
8
7
  constructor(params) {
9
8
  _defineProperty(this, "simulcastSettings", void 0);
10
9
  _defineProperty(this, "initialState", void 0);
11
10
  _defineProperty(this, "cameraFacing", void 0);
12
11
  _defineProperty(this, "forceSoftwareDecoder", void 0);
12
+ // android only
13
13
  _defineProperty(this, "disableAutoResize", void 0);
14
14
  this.simulcastSettings = params.simulcastSettings;
15
15
  this.initialState = params.initialState;
@@ -1 +1 @@
1
- {"version":3,"names":["HMSVideoTrackSettings","constructor","params","_defineProperty","simulcastSettings","initialState","cameraFacing","forceSoftwareDecoder","disableAutoResize"],"sources":["HMSVideoTrackSettings.ts"],"sourcesContent":["import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';\nimport type { HMSCameraFacing } from './HMSCameraFacing';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\nexport class HMSVideoTrackSettings {\n readonly simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean; // android only\n disableAutoResize?: boolean; // android only\n\n constructor(params: {\n simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean;\n disableAutoResize?: boolean;\n }) {\n this.simulcastSettings = params.simulcastSettings;\n this.initialState = params.initialState;\n this.cameraFacing = params.cameraFacing;\n this.forceSoftwareDecoder = params.forceSoftwareDecoder;\n this.disableAutoResize = params.disableAutoResize;\n }\n}\n"],"mappings":";;;AAIA,OAAO,MAAMA,qBAAqB,CAAC;EAID;EACH;;EAE7BC,WAAWA,CAACC,MAMX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAI,CAACC,iBAAiB,GAAGF,MAAM,CAACE,iBAAiB;IACjD,IAAI,CAACC,YAAY,GAAGH,MAAM,CAACG,YAAY;IACvC,IAAI,CAACC,YAAY,GAAGJ,MAAM,CAACI,YAAY;IACvC,IAAI,CAACC,oBAAoB,GAAGL,MAAM,CAACK,oBAAoB;IACvD,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;EACnD;AACF"}
1
+ {"version":3,"names":["HMSVideoTrackSettings","constructor","params","_defineProperty","simulcastSettings","initialState","cameraFacing","forceSoftwareDecoder","disableAutoResize"],"sources":["HMSVideoTrackSettings.ts"],"sourcesContent":["import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';\nimport type { HMSCameraFacing } from './HMSCameraFacing';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\nexport class HMSVideoTrackSettings {\n readonly simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean; // android only\n disableAutoResize?: boolean; // android only\n\n constructor(params: {\n simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean;\n disableAutoResize?: boolean;\n }) {\n this.simulcastSettings = params.simulcastSettings;\n this.initialState = params.initialState;\n this.cameraFacing = params.cameraFacing;\n this.forceSoftwareDecoder = params.forceSoftwareDecoder;\n this.disableAutoResize = params.disableAutoResize;\n }\n}\n"],"mappings":";;;AAIA,OAAO,MAAMA,qBAAqB,CAAC;EAKJ;;EAE7BC,WAAWA,CAACC,MAMX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAT6B;IAAAA,eAAA;IAU9B,IAAI,CAACC,iBAAiB,GAAGF,MAAM,CAACE,iBAAiB;IACjD,IAAI,CAACC,YAAY,GAAGH,MAAM,CAACG,YAAY;IACvC,IAAI,CAACC,YAAY,GAAGJ,MAAM,CAACI,YAAY;IACvC,IAAI,CAACC,oBAAoB,GAAGL,MAAM,CAACK,oBAAoB;IACvD,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;EACnD;AACF"}
@@ -83,23 +83,19 @@ export declare class HMSSDK {
83
83
  logSettings?: HMSLogSettings;
84
84
  }): Promise<HMSSDK>;
85
85
  /**
86
- * - Returns the instance of logger which can be used to manipulate log levels.
87
- * @returns @instance HMSLogger
88
- * @memberof HMSSDK
89
- */
90
- static getLogger(): HMSLogger | undefined;
91
- /**
92
- * - Updates the logger for this instance of HMSSDK
93
- * @param {HMSLogger} hmsLogger
86
+ * - Calls removeListeners that in turn breaks all connections with native listeners.
87
+ *
94
88
  * @memberof HMSSDK
95
89
  */
96
- setLogger: (hmsLogger?: HMSLogger) => void;
90
+ destroy: () => Promise<any>;
97
91
  /**
98
- * - Calls removeListeners that in turn breaks all connections with native listeners.
92
+ * - getAuthTokenByRoomCode function is used to get the Auth Token by Room Code
93
+ *
94
+ * checkout {@link https://www.100ms.live/docs/concepts/v2/concepts/rooms/room-codes/room-codes} for more info
99
95
  *
100
96
  * @memberof HMSSDK
101
97
  */
102
- destroy: () => Promise<any>;
98
+ getAuthTokenByRoomCode: (roomCode: string, userId?: string, endpoint?: string) => Promise<string>;
103
99
  /**
104
100
  * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
105
101
  * after joining the room user will start receiving the events and updates of the room.
@@ -600,5 +596,17 @@ export declare class HMSSDK {
600
596
  isPipModeSupported(): Promise<undefined | boolean>;
601
597
  enablePipMode(data?: PIPConfig): Promise<undefined | boolean>;
602
598
  setPipParams(data?: PIPConfig): Promise<undefined | boolean>;
599
+ /**
600
+ * - Returns the instance of logger which can be used to manipulate log levels.
601
+ * @returns @instance HMSLogger
602
+ * @memberof HMSSDK
603
+ */
604
+ static getLogger(): HMSLogger | undefined;
605
+ /**
606
+ * - Updates the logger for this instance of HMSSDK
607
+ * @param {HMSLogger} hmsLogger
608
+ * @memberof HMSSDK
609
+ */
610
+ setLogger: (hmsLogger?: HMSLogger) => void;
603
611
  }
604
612
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "1.3.0",
4
- "description": "The React Native package for 100ms SDK",
3
+ "version": "1.4.0",
4
+ "description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/index.d.ts",
package/sdk-versions.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "ios": "0.8.1",
2
+ "ios": "0.9.1",
3
3
  "iOSBroadcastExtension": "0.0.8",
4
- "android": "2.5.9"
4
+ "android": "2.6.0"
5
5
  }
@@ -79,7 +79,6 @@ export class HMSSDK {
79
79
  id: string;
80
80
  private muteStatus: boolean | undefined;
81
81
  private appStateSubscription?: any;
82
-
83
82
  private onPreviewDelegate?: any;
84
83
  private onJoinDelegate?: any;
85
84
  private onRoomDelegate?: any;
@@ -151,24 +150,6 @@ export class HMSSDK {
151
150
  return HmsSdk;
152
151
  }
153
152
 
154
- /**
155
- * - Returns the instance of logger which can be used to manipulate log levels.
156
- * @returns @instance HMSLogger
157
- * @memberof HMSSDK
158
- */
159
- static getLogger() {
160
- return getLogger();
161
- }
162
-
163
- /**
164
- * - Updates the logger for this instance of HMSSDK
165
- * @param {HMSLogger} hmsLogger
166
- * @memberof HMSSDK
167
- */
168
- setLogger = (hmsLogger?: HMSLogger) => {
169
- setLogger(this.id, hmsLogger);
170
- };
171
-
172
153
  /**
173
154
  * - Calls removeListeners that in turn breaks all connections with native listeners.
174
155
  *
@@ -182,6 +163,33 @@ export class HMSSDK {
182
163
  return await HMSManager.destroy({ id: this.id });
183
164
  };
184
165
 
166
+ /**
167
+ * - getAuthTokenByRoomCode function is used to get the Auth Token by Room Code
168
+ *
169
+ * checkout {@link https://www.100ms.live/docs/concepts/v2/concepts/rooms/room-codes/room-codes} for more info
170
+ *
171
+ * @memberof HMSSDK
172
+ */
173
+ getAuthTokenByRoomCode = async (
174
+ roomCode: string,
175
+ userId?: string,
176
+ endpoint?: string
177
+ ): Promise<string> => {
178
+ logger?.verbose('#Function getAuthTokenByRoomCode', {
179
+ id: this.id,
180
+ roomCode,
181
+ userId,
182
+ endpoint,
183
+ });
184
+
185
+ return HMSManager.getAuthTokenByRoomCode({
186
+ id: this.id,
187
+ roomCode,
188
+ userId,
189
+ endpoint,
190
+ });
191
+ };
192
+
185
193
  /**
186
194
  * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
187
195
  * after joining the room user will start receiving the events and updates of the room.
@@ -2230,4 +2238,22 @@ export class HMSSDK {
2230
2238
  id: this.id,
2231
2239
  });
2232
2240
  }
2241
+
2242
+ /**
2243
+ * - Returns the instance of logger which can be used to manipulate log levels.
2244
+ * @returns @instance HMSLogger
2245
+ * @memberof HMSSDK
2246
+ */
2247
+ static getLogger() {
2248
+ return getLogger();
2249
+ }
2250
+
2251
+ /**
2252
+ * - Updates the logger for this instance of HMSSDK
2253
+ * @param {HMSLogger} hmsLogger
2254
+ * @memberof HMSSDK
2255
+ */
2256
+ setLogger = (hmsLogger?: HMSLogger) => {
2257
+ setLogger(this.id, hmsLogger);
2258
+ };
2233
2259
  }