@bits-innovate/react-native-vstarcam 1.0.59 → 1.0.61

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.
Binary file
@@ -304,8 +304,10 @@ public class VStarCamModule extends ReactContextBaseJavaModule implements Lifecy
304
304
  @Override
305
305
  public void commandListener(long clientPtr, byte[] data, int length) {
306
306
  try {
307
- Log.d(TAG, "Command callback: clientPtr=" + clientPtr + ", dataLen=" + (data != null ? data.length : 0));
308
- VStarCamModule.handleCommandReceive(clientPtr, 0, data);
307
+ Log.d(TAG, "Command callback: clientPtr=" + clientPtr + ", cmd=" + length + ", dataLen=" + (data != null ? data.length : 0));
308
+ // Mind blowing discovery: the parameter named 'length' in the AAR interface
309
+ // is actually the command ID (cmd) from the underlying C++ SDK!
310
+ VStarCamModule.handleCommandReceive(clientPtr, length, data);
309
311
  } catch (Exception e) {
310
312
  Log.e(TAG, "Error in commandListener callback", e);
311
313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
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
@@ -440,7 +440,19 @@ class VStarCamClient {
440
440
  for (const pair of pairs) {
441
441
  const [key, value] = pair.split("=");
442
442
  if (key && value) {
443
- result[key.trim()] = value.trim();
443
+ let cleanKey = key.trim();
444
+ // VStarCam often prefix variables with 'var '
445
+ if (cleanKey.startsWith("var ")) {
446
+ cleanKey = cleanKey.substring(4).trim();
447
+ }
448
+
449
+ let cleanValue = value.trim();
450
+ // Remove surrounding quotes if present
451
+ if (cleanValue.startsWith('"') && cleanValue.endsWith('"')) {
452
+ cleanValue = cleanValue.substring(1, cleanValue.length - 1);
453
+ }
454
+
455
+ result[cleanKey] = cleanValue;
444
456
  }
445
457
  }
446
458
  return result;