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 @@ -44,7 +44,6 @@ import androidx.compose.material.icons.filled.RadioButtonChecked
import androidx.compose.material.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateListOf
Expand Down Expand Up @@ -108,7 +107,6 @@ import io.getstream.video.android.ui.menu.availableVideoFilters
import io.getstream.video.android.util.config.AppConfig
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.launch
import org.openapitools.client.models.OwnCapability

Expand Down Expand Up @@ -153,7 +151,7 @@ fun CallScreen(
var preferredScaleType by remember { mutableStateOf(VideoScalingType.SCALE_ASPECT_FILL) }

val connection by call.state.connection.collectAsStateWithLifecycle()
val me by call.state.me.collectAsState()
val me by call.state.me.collectAsStateWithLifecycle()

LaunchedEffect(key1 = connection) {
if (connection == RealtimeConnection.Disconnected) {
Expand Down Expand Up @@ -335,8 +333,7 @@ fun CallScreen(
)
},
floatingVideoRenderer = { _, _ ->
val myself = me ?: participantsSize.firstOrNull { it.sessionId == call.sessionId }
myself?.let {
me?.let {
FloatingParticipantVideo(
call = call,
participant = it,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public class CallState(
val totalParticipants = _participantCounts.mapState { it?.total ?: 0 }

/** Your own participant state */
public val me: StateFlow<ParticipantState?> = _participants.mapState {
it[call.sessionId]
public val me: StateFlow<ParticipantState?> = _participants.mapState { map ->
map[call.sessionId] ?: participants.value.find { it.isLocal }
}

/** Your own participant state */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,7 @@ public class RtcSession internal constructor(
throw IllegalStateException(
"Cant send audio and video since publisher hasn't been setup to connect",
)
}
publisher?.let { publisher ->
} else {
// step 2 ensure all tracks are setup correctly
// start capturing the video

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import io.getstream.video.android.model.ApiKey
import io.getstream.video.android.model.SfuToken
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
Expand Down Expand Up @@ -149,6 +150,7 @@ class SfuSocketConnection(
scope.launch {
internalSocket.awaitConnection(connectionTimeout)
internalSocket.connectionIdOrError().also {
delay(500) // Wait for the connection to settle then call `connected`
connected(it)
}
}
Expand Down
Loading