Skip to content

Commit

Permalink
feat: add paint parameter to video surface
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Jan 10, 2025
1 parent 48802ac commit ac0a145
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import dev.silenium.compose.gl.surface.*
import dev.silenium.multimedia.core.annotation.InternalMultimediaApi
import org.jetbrains.skia.Paint

@Composable
private fun createGLSurface(
Expand Down Expand Up @@ -52,12 +53,14 @@ fun VideoSurface(
player: VideoPlayer,
showStats: Boolean = false,
modifier: Modifier = Modifier,
paint: Paint = Paint(),
) {
val surfaceState = rememberGLSurfaceState()
BoxWithConstraints(modifier = modifier) {
GLSurfaceView(
surface = player.surface!!,
modifier = Modifier.matchParentSize(),
paint = paint,
)
if (showStats) {
Surface(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import org.jetbrains.skia.Paint

@Composable
fun VideoSurfaceWithControls(
player: VideoPlayer,
modifier: Modifier = Modifier,
showStats: Boolean = false,
controlFocusRequester: FocusRequester? = null,
paint: Paint = Paint(),
) {
BoxWithConstraints(modifier) {
VideoSurface(
Expand All @@ -23,6 +25,7 @@ fun VideoSurfaceWithControls(
maxWidth = maxWidth,
maxHeight = maxHeight,
),
paint = paint,
)
VideoSurfaceControls(player, Modifier.matchParentSize(), controlFocusRequester)
}
Expand Down

0 comments on commit ac0a145

Please sign in to comment.