Skip to content

Commit ac0a145

Browse files
committed
feat: add paint parameter to video surface
1 parent 48802ac commit ac0a145

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/kotlin/dev/silenium/multimedia/compose/player/VideoSurface.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.ui.graphics.Color
1111
import androidx.compose.ui.unit.dp
1212
import dev.silenium.compose.gl.surface.*
1313
import dev.silenium.multimedia.core.annotation.InternalMultimediaApi
14+
import org.jetbrains.skia.Paint
1415

1516
@Composable
1617
private fun createGLSurface(
@@ -52,12 +53,14 @@ fun VideoSurface(
5253
player: VideoPlayer,
5354
showStats: Boolean = false,
5455
modifier: Modifier = Modifier,
56+
paint: Paint = Paint(),
5557
) {
5658
val surfaceState = rememberGLSurfaceState()
5759
BoxWithConstraints(modifier = modifier) {
5860
GLSurfaceView(
5961
surface = player.surface!!,
6062
modifier = Modifier.matchParentSize(),
63+
paint = paint,
6164
)
6265
if (showStats) {
6366
Surface(

src/main/kotlin/dev/silenium/multimedia/compose/player/VideoSurfaceWithControls.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import androidx.compose.runtime.Composable
66
import androidx.compose.ui.Alignment
77
import androidx.compose.ui.Modifier
88
import androidx.compose.ui.focus.FocusRequester
9+
import org.jetbrains.skia.Paint
910

1011
@Composable
1112
fun VideoSurfaceWithControls(
1213
player: VideoPlayer,
1314
modifier: Modifier = Modifier,
1415
showStats: Boolean = false,
1516
controlFocusRequester: FocusRequester? = null,
17+
paint: Paint = Paint(),
1618
) {
1719
BoxWithConstraints(modifier) {
1820
VideoSurface(
@@ -23,6 +25,7 @@ fun VideoSurfaceWithControls(
2325
maxWidth = maxWidth,
2426
maxHeight = maxHeight,
2527
),
28+
paint = paint,
2629
)
2730
VideoSurfaceControls(player, Modifier.matchParentSize(), controlFocusRequester)
2831
}

0 commit comments

Comments
 (0)