@bits-innovate/react-native-vstarcam 1.0.36 → 1.0.37

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.
@@ -417,7 +417,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
417
417
  sendEvent("onConnectionStateChanged", params);
418
418
 
419
419
  // Update connected state
420
- entry.getValue().isConnected = (state == 3); // ONLINE
420
+ entry.getValue().isConnected = (state == 2); // ONLINE is 2 in native, 3 in JS (now aligned to 2 in index.ts)
421
421
  break;
422
422
  }
423
423
  }
@@ -601,7 +601,6 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
601
601
 
602
602
  // Code >= 0 or other negative values might be a success (Session ID or State)
603
603
  Log.d(TAG, "JNIApi.connect successful or handle returned: " + res);
604
- clientInfo.isConnected = true; // Optimistically set this if we got a handle
605
604
  } catch (java.lang.reflect.InvocationTargetException ite) {
606
605
  Log.e(TAG, "JNIApi.connect threw exception: " + ite.getCause(), ite.getCause());
607
606
  throw ite;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/index.ts CHANGED
@@ -95,18 +95,17 @@ const VStarCamModule = NativeModules.VStarCam
95
95
 
96
96
  // Connection states
97
97
  export enum ConnectionState {
98
- INVALID_CLIENT = 0,
99
- CONNECTING = 1,
100
- INITIALIZING = 2,
101
- ONLINE = 3,
102
- CONNECT_FAILED = 4,
103
- DISCONNECTED = 5,
104
- INVALID_ID = 6,
105
- OFFLINE = 7,
106
- TIMEOUT = 8,
107
- MAX_SESSION = 9,
108
- MAX = 10,
109
- REMOVE_CLOSE = 11,
98
+ CONNECTING = 0,
99
+ INITIALIZING = 1,
100
+ ONLINE = 2,
101
+ CONNECT_FAILED = 3,
102
+ DISCONNECTED = 4,
103
+ INVALID_ID = 5,
104
+ OFFLINE = 6,
105
+ TIMEOUT = 7,
106
+ WRONG_PWD = 8,
107
+ INVALID_CLIENT = 9,
108
+ MAX_SESSION = 10,
110
109
  }
111
110
 
112
111
  // Connection modes