@bits-innovate/react-native-vstarcam 1.0.54 → 1.0.55

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.
@@ -46,6 +46,7 @@ public class VStarCamVideoView extends FrameLayout
46
46
  private long playerPtr = 0;
47
47
  private boolean isStreaming = false;
48
48
  private boolean playerInitialized = false;
49
+ private boolean pendingStartStream = false;
49
50
 
50
51
  // Player class (from AAR)
51
52
  private Class<?> appPlayerClass;
@@ -184,8 +185,9 @@ public class VStarCamVideoView extends FrameLayout
184
185
  }
185
186
 
186
187
  if (surface == null) {
187
- Log.e(TAG, "Cannot start: no surface available");
188
- statusView.setText("No surface");
188
+ Log.d(TAG, "Surface not yet available — deferring stream start");
189
+ statusView.setText("Preparing...");
190
+ pendingStartStream = true;
189
191
  return;
190
192
  }
191
193
 
@@ -344,7 +346,15 @@ public class VStarCamVideoView extends FrameLayout
344
346
  Log.d(TAG, "Surface available: " + width + "x" + height);
345
347
  this.surface = new Surface(surfaceTexture);
346
348
 
347
- // If already supposed to be streaming, try to update surface
349
+ // If startStream() was called before surface was ready, start now
350
+ if (pendingStartStream) {
351
+ Log.d(TAG, "Deferred stream start — surface now available");
352
+ pendingStartStream = false;
353
+ startStream();
354
+ return;
355
+ }
356
+
357
+ // If already streaming, update the surface on the existing player
348
358
  if (isStreaming && playerPtr != 0 && appPlayerClass != null) {
349
359
  try {
350
360
  Method setSurfaceMethod = appPlayerClass.getMethod(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.54",
3
+ "version": "1.0.55",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",