Add callbacks to tiny local video renderer.

This commit is contained in:
Alex Hart
2025-11-07 10:09:38 -04:00
committed by Michelle Tang
parent 44527f3763
commit 696dba9dee

View File

@@ -462,6 +462,7 @@ private fun BoxScope.Viewport(
spacerOffset.y.toDp() spacerOffset.y.toDp()
} }
), ),
onToggleCameraDirection = onToggleCameraDirection,
onClick = onPipClick onClick = onPipClick
) )
} }
@@ -503,7 +504,8 @@ private fun TinyLocalVideoRenderer(
localParticipant: CallParticipant, localParticipant: CallParticipant,
localRenderState: WebRtcLocalRenderState, localRenderState: WebRtcLocalRenderState,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
onClick: () -> Unit onClick: () -> Unit,
onToggleCameraDirection: () -> Unit
) { ) {
val (smallSize, expandedSize, padding) = rememberTinyPortraitSize() val (smallSize, expandedSize, padding) = rememberTinyPortraitSize()
val size = if (localRenderState == WebRtcLocalRenderState.EXPANDED) expandedSize else smallSize val size = if (localRenderState == WebRtcLocalRenderState.EXPANDED) expandedSize else smallSize
@@ -528,7 +530,12 @@ private fun TinyLocalVideoRenderer(
callParticipant = localParticipant, callParticipant = localParticipant,
isLocalParticipant = true, isLocalParticipant = true,
renderInPip = true, renderInPip = true,
selfPipMode = CallParticipantView.SelfPipMode.MINI_SELF_PIP, onToggleCameraDirection = onToggleCameraDirection,
selfPipMode = if (localRenderState == WebRtcLocalRenderState.EXPANDED) {
CallParticipantView.SelfPipMode.EXPANDED_SELF_PIP
} else {
CallParticipantView.SelfPipMode.MINI_SELF_PIP
},
modifier = modifier modifier = modifier
.padding(padding) .padding(padding)
.height(height) .height(height)