metag-sdk-ionic 1.2.7-native-0.133 → 1.2.7-native-0.135
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.
|
@@ -128,10 +128,10 @@ public class CustomVideoRecorder extends Plugin {
|
|
|
128
128
|
Surface recorderSurface = mediaRecorder.getSurface();
|
|
129
129
|
captureRequestBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD);
|
|
130
130
|
captureRequestBuilder.addTarget(recorderSurface);
|
|
131
|
-
captureRequestBuilder.addTarget(new Surface(textureView.getSurfaceTexture()));
|
|
131
|
+
captureRequestBuilder.addTarget(new Surface(overlayView.textureView.getSurfaceTexture()));
|
|
132
132
|
|
|
133
133
|
cameraDevice.createCaptureSession(
|
|
134
|
-
Arrays.asList(recorderSurface, new Surface(textureView.getSurfaceTexture())),
|
|
134
|
+
Arrays.asList(recorderSurface, new Surface(overlayView.textureView.getSurfaceTexture())),
|
|
135
135
|
new CameraCaptureSession.StateCallback() {
|
|
136
136
|
@Override
|
|
137
137
|
public void onConfigured(@NonNull CameraCaptureSession session) {
|
|
@@ -381,19 +381,13 @@ public class CustomVideoRecorder extends Plugin {
|
|
|
381
381
|
|
|
382
382
|
// Vista personalizada que combina TextureView (preview) + Canvas (UI)
|
|
383
383
|
private class CameraOverlayView extends FrameLayout {
|
|
384
|
-
|
|
385
|
-
private
|
|
386
|
-
private Paint textPaint;
|
|
387
|
-
private Paint buttonPaint;
|
|
388
|
-
private RectF recordButton;
|
|
389
|
-
private RectF closeButton;
|
|
390
|
-
private CustomVideoRecorder plugin;
|
|
384
|
+
public TextureView textureView;
|
|
385
|
+
private OverlayDrawView overlayDrawView;
|
|
391
386
|
|
|
392
387
|
public CameraOverlayView(android.content.Context context, CustomVideoRecorder plugin) {
|
|
393
388
|
super(context);
|
|
394
|
-
this.plugin = plugin;
|
|
395
389
|
|
|
396
|
-
// TextureView para preview de cámara
|
|
390
|
+
// TextureView para preview de cámara (fondo)
|
|
397
391
|
textureView = new TextureView(context);
|
|
398
392
|
textureView.setSurfaceTextureListener(surfaceTextureListener);
|
|
399
393
|
addView(textureView, new FrameLayout.LayoutParams(
|
|
@@ -401,6 +395,34 @@ public class CustomVideoRecorder extends Plugin {
|
|
|
401
395
|
FrameLayout.LayoutParams.MATCH_PARENT
|
|
402
396
|
));
|
|
403
397
|
|
|
398
|
+
// Vista de dibujo encima del preview
|
|
399
|
+
overlayDrawView = new OverlayDrawView(context, plugin);
|
|
400
|
+
addView(overlayDrawView, new FrameLayout.LayoutParams(
|
|
401
|
+
FrameLayout.LayoutParams.MATCH_PARENT,
|
|
402
|
+
FrameLayout.LayoutParams.MATCH_PARENT
|
|
403
|
+
));
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
public void updateUI() {
|
|
407
|
+
if (overlayDrawView != null) {
|
|
408
|
+
overlayDrawView.invalidate();
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Vista que dibuja los overlays (botones, texto, etc.)
|
|
414
|
+
private class OverlayDrawView extends View {
|
|
415
|
+
private Paint paint;
|
|
416
|
+
private Paint textPaint;
|
|
417
|
+
private Paint buttonPaint;
|
|
418
|
+
private RectF recordButton;
|
|
419
|
+
private RectF closeButton;
|
|
420
|
+
private CustomVideoRecorder plugin;
|
|
421
|
+
|
|
422
|
+
public OverlayDrawView(android.content.Context context, CustomVideoRecorder plugin) {
|
|
423
|
+
super(context);
|
|
424
|
+
this.plugin = plugin;
|
|
425
|
+
|
|
404
426
|
// Configurar paints
|
|
405
427
|
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
|
406
428
|
|
|
@@ -417,7 +439,6 @@ public class CustomVideoRecorder extends Plugin {
|
|
|
417
439
|
recordButton = new RectF();
|
|
418
440
|
closeButton = new RectF();
|
|
419
441
|
|
|
420
|
-
setWillNotDraw(false);
|
|
421
442
|
setClickable(true);
|
|
422
443
|
}
|
|
423
444
|
|
|
@@ -505,10 +526,6 @@ public class CustomVideoRecorder extends Plugin {
|
|
|
505
526
|
getContext().getResources().getDisplayMetrics()
|
|
506
527
|
);
|
|
507
528
|
}
|
|
508
|
-
|
|
509
|
-
public void updateUI() {
|
|
510
|
-
invalidate();
|
|
511
|
-
}
|
|
512
529
|
}
|
|
513
530
|
|
|
514
531
|
private void startCountdown() {
|
package/package.json
CHANGED