Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ On CallContent make sure to pass onBackPressed to CallAppBar in order to make th

### ✅ Added
Add `participantLabelContent` slot to `CallLobby` so the lobby participant label can be hidden (`{}`) or fully customized. Brings the Compose API in line with React's `VideoPreview` slot overrides.
Add `videoPreviewModifier` parameter to `CallLobby` so callers can override the size, shape, padding, and background of the local video preview box. Defaults preserve the previous responsive height + 12dp rounded corner clip, matching iOS (parent-driven sizing in `GeometryReader`) and React (`className`-driven sizing on `VideoPreview`).

### ⚠️ Changed
Deprecate the `CallLobby` overload that takes `labelPosition: Alignment`. Migrate to the new `participantLabelContent` slot; pass `{}` to hide the label or supply a composable to customize content and positioning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ public final class io/getstream/video/android/compose/ui/components/call/diagnos

public final class io/getstream/video/android/compose/ui/components/call/lobby/CallLobbyKt {
public static final fun CallLobby (Landroidx/compose/ui/Modifier;Lio/getstream/video/android/core/Call;Lio/getstream/video/android/model/User;Landroidx/compose/ui/Alignment;ZZLio/getstream/video/android/core/ParticipantState$Video;Lio/getstream/video/android/compose/permission/VideoPermissionsState;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
public static final fun CallLobby (Landroidx/compose/ui/Modifier;Lio/getstream/video/android/core/Call;Lio/getstream/video/android/model/User;ZZLio/getstream/video/android/core/ParticipantState$Video;Lio/getstream/video/android/compose/permission/VideoPermissionsState;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
public static final fun CallLobby (Landroidx/compose/ui/Modifier;Lio/getstream/video/android/core/Call;Lio/getstream/video/android/model/User;ZZLio/getstream/video/android/core/ParticipantState$Video;Lio/getstream/video/android/compose/permission/VideoPermissionsState;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
}

public final class io/getstream/video/android/compose/ui/components/call/lobby/ComposableSingletons$CallLobbyKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
* @param permissions Android permissions that should be required to render a video call properly.
* @param onRenderedContent A video renderer, which renders a local video track before joining a call.
* @param onDisabledContent Content is shown that a local camera is disabled. It displays user avatar by default.
* @param videoPreviewModifier Modifier applied to the [Box] that wraps the local video preview. Defaults
* to a responsive height (180/280/200dp depending on screen size and orientation), full width, and a
* 12dp rounded corner clip. Override to provide custom size, shape, padding, or background — useful
* when the preview needs to match a host layout instead of the SDK's default sizing.
* @param participantLabelContent Slot for the participant label overlaid on the preview. Defaults to a
* label showing the user's name and microphone state at [Alignment.BottomStart]. Pass `{}` to hide the
* label entirely, or override to provide custom positioning and content (use [BoxScope.align] inside).
Expand Down Expand Up @@ -118,6 +122,7 @@
onDisabledContent: @Composable () -> Unit = {
OnDisabledContent(user = user)
},
videoPreviewModifier: Modifier = defaultVideoPreviewModifier(),
participantLabelContent: @Composable BoxScope.() -> Unit = {
DefaultParticipantLabel(
user = user,
Expand All @@ -144,18 +149,10 @@
DefaultPermissionHandler(videoPermission = permissions)

MediaPiPLifecycle(call = call, PictureInPictureConfiguration(false, false))
val configuration = LocalConfiguration.current
val isPortrait = configuration.orientation == Configuration.ORIENTATION_PORTRAIT
val screenHeightDp = configuration.screenHeightDp

val boxModifier = Modifier
.responsiveHeight(isPortrait, screenHeightDp)
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))

Column(modifier = modifier) {
Box(
modifier = boxModifier,
modifier = videoPreviewModifier,
) {
if (isCameraEnabled) {
onRenderedContent.invoke(video)
Expand Down Expand Up @@ -184,7 +181,7 @@
),
)
@Composable
public fun CallLobby(

Check warning on line 184 in stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/ui/components/call/lobby/CallLobby.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This function has 13 parameters, which is greater than the 7 authorized.

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-video-android&issues=AZ7zoP1u5ZPmqghFVJCV&open=AZ7zoP1u5ZPmqghFVJCV&pullRequest=1733

Check warning on line 184 in stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/ui/components/call/lobby/CallLobby.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-video-android&issues=AZ7zoP1u5ZPmqghFVJCW&open=AZ7zoP1u5ZPmqghFVJCW&pullRequest=1733
modifier: Modifier = Modifier,
call: Call,
user: User = StreamVideo.instance().user,
Expand Down Expand Up @@ -358,6 +355,16 @@
}
}

@Composable
private fun defaultVideoPreviewModifier(): Modifier {
val configuration = LocalConfiguration.current
val isPortrait = configuration.orientation == Configuration.ORIENTATION_PORTRAIT
return Modifier
.responsiveHeight(isPortrait = isPortrait, screenHeightDp = configuration.screenHeightDp)
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))
}

private fun Modifier.responsiveHeight(isPortrait: Boolean, screenHeightDp: Int): Modifier {
val isSmallDevice = screenHeightDp <= 640
val height = if (isPortrait && isSmallDevice) {
Expand Down
Loading