@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.
|
|
188
|
-
statusView.setText("
|
|
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
|
|
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(
|