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
Original file line number Diff line number Diff line change
Expand Up @@ -1346,22 +1346,26 @@ public final class io/getstream/video/android/compose/ui/components/call/rendere
public final class io/getstream/video/android/compose/ui/components/call/renderer/ComposableSingletons$ParticipantVideoKt {
public static final field INSTANCE Lio/getstream/video/android/compose/ui/components/call/renderer/ComposableSingletons$ParticipantVideoKt;
public static field lambda-1 Lkotlin/jvm/functions/Function4;
public static field lambda-10 Lkotlin/jvm/functions/Function2;
public static field lambda-10 Lkotlin/jvm/functions/Function3;
public static field lambda-11 Lkotlin/jvm/functions/Function2;
public static field lambda-12 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function6;
public static field lambda-3 Lkotlin/jvm/functions/Function3;
public static field lambda-4 Lkotlin/jvm/functions/Function3;
public static field lambda-5 Lkotlin/jvm/functions/Function2;
public static field lambda-3 Lkotlin/jvm/functions/Function4;
public static field lambda-4 Lkotlin/jvm/functions/Function6;
public static field lambda-5 Lkotlin/jvm/functions/Function3;
public static field lambda-6 Lkotlin/jvm/functions/Function3;
public static field lambda-7 Lkotlin/jvm/functions/Function2;
public static field lambda-8 Lkotlin/jvm/functions/Function3;
public static field lambda-9 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function4;
public final fun getLambda-10$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-10$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-11$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-12$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function6;
public final fun getLambda-3$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-4$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-5$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-3$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function4;
public final fun getLambda-4$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function6;
public final fun getLambda-5$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-6$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-7$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-8$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
Expand Down Expand Up @@ -1418,11 +1422,21 @@ public final class io/getstream/video/android/compose/ui/components/call/rendere
public static fun values ()[Lio/getstream/video/android/compose/ui/components/call/renderer/LayoutType;
}

public final class io/getstream/video/android/compose/ui/components/call/renderer/MirrorMode : java/lang/Enum {
public static final field ALWAYS Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;
public static final field AUTO Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;
public static final field NEVER Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;
public static fun values ()[Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;
}

public final class io/getstream/video/android/compose/ui/components/call/renderer/ParticipantVideoKt {
public static final fun ParticipantLabel (Landroidx/compose/foundation/layout/BoxScope;Lio/getstream/video/android/core/Call;Lio/getstream/video/android/core/ParticipantState;Landroidx/compose/ui/Alignment;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun ParticipantLabel (Landroidx/compose/foundation/layout/BoxScope;Ljava/lang/String;ZLandroidx/compose/ui/Alignment;ZZZFLkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun ParticipantVideo (Lio/getstream/video/android/core/Call;Lio/getstream/video/android/core/ParticipantState;Landroidx/compose/ui/Modifier;Lio/getstream/video/android/compose/ui/components/call/renderer/VideoRendererStyle;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lio/getstream/video/android/compose/ui/components/video/VideoScalingType;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function4;Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;Lkotlin/jvm/functions/Function6;Landroidx/compose/runtime/Composer;III)V
public static final fun ParticipantVideo (Lio/getstream/video/android/core/Call;Lio/getstream/video/android/core/ParticipantState;Landroidx/compose/ui/Modifier;Lio/getstream/video/android/compose/ui/components/call/renderer/VideoRendererStyle;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lio/getstream/video/android/compose/ui/components/video/VideoScalingType;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function6;Landroidx/compose/runtime/Composer;II)V
public static final fun ParticipantVideoRenderer (Lio/getstream/video/android/core/Call;Lio/getstream/video/android/core/ParticipantState;Lio/getstream/video/android/compose/ui/components/video/VideoScalingType;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun ParticipantVideoRenderer (Lio/getstream/video/android/core/Call;Lio/getstream/video/android/core/ParticipantState;Lio/getstream/video/android/compose/ui/components/video/VideoScalingType;Lio/getstream/video/android/compose/ui/components/call/renderer/MirrorMode;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/video/android/compose/ui/components/call/renderer/ParticipantsLayoutKt {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2014-2026 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-video-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.video.android.compose.ui.components.call.renderer

/**
* Controls horizontal mirroring of the video stream in [ParticipantVideo].
*/
public enum class MirrorMode {
/** Mirrors only the local self-view when using the front camera; remote participants are never mirrored. Default. */
AUTO,

/** Always mirror the stream. */
ALWAYS,

/** Never mirror the stream. */
NEVER,
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@
* @param connectionIndicatorContent Content is shown that indicates the connection quality.
* @param videoFallbackContent Content is shown the video track is failed to load or not available.
* @param reactionContent Content is shown for the reaction.
* @param mirrorMode Controls horizontal mirroring of the video stream. Defaults to [MirrorMode.AUTO] which mirrors
* only the local self-view when using the front camera; remote participants are never mirrored.
* @param actionsContent Content to show action picker with call actions related to the selected participant.
*/

@Composable
public fun ParticipantVideo(

Check warning on line 120 in stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/ui/components/call/renderer/ParticipantVideo.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

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

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-video-android&issues=AZ3y1nsWkYAhKoGL3a8_&open=AZ3y1nsWkYAhKoGL3a8_&pullRequest=1665
call: Call,
participant: ParticipantState,
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -143,6 +146,7 @@
style = style,
)
},
mirrorMode: MirrorMode = MirrorMode.AUTO,
actionsContent: @Composable BoxScope.(
actions: List<ParticipantAction>,
call: Call,
Expand All @@ -158,6 +162,7 @@
participant,
)
},

) {
val connectionQuality by participant.networkQuality.collectAsStateWithLifecycle()
val participants by call.state.participants.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -203,6 +208,7 @@
call = call,
participant = participant,
scalingType = scalingType,
mirrorMode = mirrorMode,
videoFallbackContent = videoFallbackContent,
)

Expand All @@ -222,13 +228,82 @@
}
}

@Deprecated(
"Use ParticipantVideo which accepts mirrorMode instead.",
ReplaceWith(
"ParticipantVideo(call, participant, modifier, style, labelContent, connectionIndicatorContent, scalingType, videoFallbackContent, reactionContent, actionsContent, mirrorMode)",
),
)
@Composable
public fun ParticipantVideo(

Check warning on line 238 in stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/ui/components/call/renderer/ParticipantVideo.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=AZ3y1nsWkYAhKoGL3a9A&open=AZ3y1nsWkYAhKoGL3a9A&pullRequest=1665
call: Call,
participant: ParticipantState,
modifier: Modifier = Modifier,
style: VideoRendererStyle = RegularVideoRendererStyle(),
labelContent: @Composable BoxScope.(ParticipantState) -> Unit = {
ParticipantLabel(call, participant, style.labelPosition)
},
connectionIndicatorContent: @Composable BoxScope.(NetworkQuality) -> Unit = {
NetworkQualityIndicator(
networkQuality = it,
modifier = Modifier
.align(BottomEnd)
.height(VideoTheme.dimens.componentHeightM)
.testTag("Stream_ParticipantNetworkQualityIndicator"),
)
},
scalingType: VideoScalingType = VideoScalingType.SCALE_ASPECT_FILL,
videoFallbackContent: @Composable (Call) -> Unit = {
val userName by participant.userNameOrId.collectAsStateWithLifecycle()
val userImage by participant.image.collectAsStateWithLifecycle()
UserAvatarBackground(userImage = userImage, userName = userName)
},
reactionContent: @Composable BoxScope.(ParticipantState) -> Unit = {
DefaultReaction(
participant = participant,
style = style,
)
},
actionsContent: @Composable BoxScope.(
actions: List<ParticipantAction>,
call: Call,
participant: ParticipantState,
) -> Unit = { actions, call, participant ->
ParticipantActions(
Modifier
.align(TopStart)
.padding(8.dp)
.testTag("Stream_ParticipantActionsIcon"),
actions,
call,
participant,
)
},
) {
ParticipantVideo(
call,
participant,
modifier,
style,
labelContent,
connectionIndicatorContent,
scalingType,
videoFallbackContent,
reactionContent,
MirrorMode.AUTO,
actionsContent,
)
}

/**
* Renders a single participant with a given call, which contains all the call states.
* Also displays participant information with a label and connection quality indicator.
*
* @param call The call that contains all the participants state and tracks.
* @param participant Participant to render.
* @param scalingType The scaling type for the video renderer.
* @param mirrorMode Controls horizontal mirroring of the video stream. Defaults to [MirrorMode.AUTO] which mirrors
* only the local self-view when using the front camera; remote participants are never mirrored.
* @param videoFallbackContent Content is shown the video track is failed to load or not available.
*/
@OptIn(StreamVideoUiDelicateApi::class)
Expand All @@ -237,6 +312,7 @@
call: Call,
participant: ParticipantState,
scalingType: VideoScalingType = VideoScalingType.SCALE_ASPECT_FILL,
mirrorMode: MirrorMode = MirrorMode.AUTO,
videoFallbackContent: @Composable (Call) -> Unit = {
val userName by participant.userNameOrId.collectAsStateWithLifecycle()
val userImage by participant.image.collectAsStateWithLifecycle()
Expand All @@ -260,10 +336,10 @@
val video by participant.video.collectAsStateWithLifecycle()
val cameraDirection by call.camera.direction.collectAsStateWithLifecycle()
val me by call.state.me.collectAsStateWithLifecycle()
val mirror by remember(cameraDirection) {
mutableStateOf(
cameraDirection == CameraDirection.Front && me?.sessionId == participant.sessionId,
)
val mirror = when (mirrorMode) {
MirrorMode.AUTO -> cameraDirection == CameraDirection.Front && me?.sessionId == participant.sessionId
MirrorMode.ALWAYS -> true
MirrorMode.NEVER -> false
}
val videoRendererConfig = remember(mirror, scalingType, videoFallbackContent) {
videoRenderConfig {
Expand Down Expand Up @@ -501,7 +577,7 @@
private fun CallParticipantPreview() {
StreamPreviewDataUtils.initializeStreamVideo(LocalContext.current)
VideoTheme {
ParticipantVideo(

Check warning on line 580 in stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/ui/components/call/renderer/ParticipantVideo.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Deprecated code should not be used.

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-video-android&issues=AZ3y1nsWkYAhKoGL3a9B&open=AZ3y1nsWkYAhKoGL3a9B&pullRequest=1665
call = previewCall,
participant = previewParticipantsList[1],
)
Expand Down
Loading