@stefanmartin/expo-video-watermark 0.2.2 → 0.2.4
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.
|
@@ -11,7 +11,7 @@ import androidx.media3.common.MediaItem
|
|
|
11
11
|
import androidx.media3.common.util.UnstableApi
|
|
12
12
|
import androidx.media3.effect.BitmapOverlay
|
|
13
13
|
import androidx.media3.effect.OverlayEffect
|
|
14
|
-
import androidx.media3.effect.
|
|
14
|
+
import androidx.media3.effect.StaticOverlaySettings
|
|
15
15
|
import androidx.media3.effect.TextureOverlay
|
|
16
16
|
import androidx.media3.transformer.Composition
|
|
17
17
|
import androidx.media3.transformer.EditedMediaItem
|
|
@@ -103,19 +103,19 @@ class ExpoVideoWatermarkModule : Module() {
|
|
|
103
103
|
val watermarkWidth = watermarkBitmap.width.toFloat()
|
|
104
104
|
val scale = videoWidth / watermarkWidth
|
|
105
105
|
|
|
106
|
-
// Create overlay
|
|
106
|
+
// Create overlay settings for full-width bottom positioning
|
|
107
107
|
// In Media3, coordinates are normalized: (0,0) is center
|
|
108
108
|
// x range [-1, 1] (left to right), y range [-1, 1] (bottom to top)
|
|
109
|
-
val
|
|
109
|
+
val overlaySettings = StaticOverlaySettings.Builder()
|
|
110
110
|
.setScale(scale, scale) // Scale uniformly to match video width
|
|
111
|
-
.
|
|
112
|
-
.
|
|
111
|
+
.setOverlayFrameAnchor(0f, -1f) // Anchor at bottom-center of watermark
|
|
112
|
+
.setBackgroundFrameAnchor(0f, -1f) // Position at very bottom of video
|
|
113
113
|
.build()
|
|
114
114
|
|
|
115
|
-
// Create the bitmap overlay with
|
|
115
|
+
// Create the bitmap overlay with settings
|
|
116
116
|
val bitmapOverlay = BitmapOverlay.createStaticBitmapOverlay(
|
|
117
117
|
watermarkBitmap,
|
|
118
|
-
|
|
118
|
+
overlaySettings
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
// Create overlay effect with proper typing
|