Skip to content

Commit a812882

Browse files
Merge branch 'refs/heads/develop'
2 parents 8c7d359 + ab4fd4e commit a812882

File tree

118 files changed

+10470
-4157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+10470
-4157
lines changed

buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ object Configuration {
66
const val minSdk = 24
77
const val majorVersion = 1
88
const val minorVersion = 0
9-
const val patchVersion = 17
9+
const val patchVersion = 18
1010
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
11-
const val versionCode = 40
11+
const val versionCode = 41
1212
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
1313
const val artifactGroup = "io.getstream"
14-
const val streamVideoCallGooglePlayVersion = "1.1.10"
14+
const val streamVideoCallGooglePlayVersion = "1.1.11"
1515
const val streamWebRtcVersionName = "1.2.1"
1616
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/CallScreen.kt

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ import io.getstream.video.android.ui.menu.availableVideoFilters
107107
import io.getstream.video.android.util.config.AppConfig
108108
import kotlinx.coroutines.GlobalScope
109109
import kotlinx.coroutines.delay
110+
import kotlinx.coroutines.flow.firstOrNull
110111
import kotlinx.coroutines.launch
111112
import org.openapitools.client.models.OwnCapability
112113

@@ -331,33 +332,36 @@ fun CallScreen(
331332
)
332333
},
333334
floatingVideoRenderer = { _, _ ->
334-
FloatingParticipantVideo(
335-
call = call,
336-
participant = me!!,
337-
parentBounds = IntSize(
338-
this@BoxWithConstraints.constraints.maxWidth,
339-
this@BoxWithConstraints.constraints.maxHeight,
340-
),
341-
videoRenderer = { participant ->
342-
ParticipantVideo(
343-
modifier = Modifier
344-
.fillMaxSize()
345-
.clip(VideoTheme.shapes.dialog),
346-
call = call,
347-
participant = participant,
348-
reactionContent = {
349-
CustomReactionContent(
350-
participant = participant,
351-
style = RegularVideoRendererStyle().copy(
352-
isShowingConnectionQualityIndicator = false,
353-
reactionPosition = Alignment.TopCenter,
354-
reactionDuration = 5000,
355-
),
356-
)
357-
},
358-
)
359-
},
360-
)
335+
val myself = me ?: participantsSize.firstOrNull { it.sessionId == call.sessionId }
336+
myself?.let {
337+
FloatingParticipantVideo(
338+
call = call,
339+
participant = it,
340+
parentBounds = IntSize(
341+
this@BoxWithConstraints.constraints.maxWidth,
342+
this@BoxWithConstraints.constraints.maxHeight,
343+
),
344+
videoRenderer = { participant ->
345+
ParticipantVideo(
346+
modifier = Modifier
347+
.fillMaxSize()
348+
.clip(VideoTheme.shapes.dialog),
349+
call = call,
350+
participant = participant,
351+
reactionContent = {
352+
CustomReactionContent(
353+
participant = participant,
354+
style = RegularVideoRendererStyle().copy(
355+
isShowingConnectionQualityIndicator = false,
356+
reactionPosition = Alignment.TopCenter,
357+
reactionDuration = 5000,
358+
),
359+
)
360+
},
361+
)
362+
},
363+
)
364+
}
361365
},
362366
videoOverlayContent = {
363367
Crossfade(
@@ -463,7 +467,8 @@ fun CallScreen(
463467
mutableStateOf(call.isAudioProcessingEnabled())
464468
}
465469
val settings by call.state.settings.collectAsStateWithLifecycle()
466-
val noiseCancellationFeatureEnabled = settings?.audio?.noiseCancellation?.isEnabled == true
470+
val noiseCancellationFeatureEnabled =
471+
settings?.audio?.noiseCancellation?.isEnabled == true
467472
SettingsMenu(
468473
call = call,
469474
selectedVideoFilter = selectedVideoFilter,
@@ -478,11 +483,14 @@ fun CallScreen(
478483
is VideoFilter.None -> {
479484
call.videoFilter = null
480485
}
486+
481487
is VideoFilter.BlurredBackground -> {
482488
call.videoFilter = BlurredBackgroundVideoFilter()
483489
}
490+
484491
is VideoFilter.VirtualBackground -> {
485-
call.videoFilter = VirtualBackgroundVideoFilter(context, filter.drawable)
492+
call.videoFilter =
493+
VirtualBackgroundVideoFilter(context, filter.drawable)
486494
}
487495
}
488496
},
@@ -493,10 +501,11 @@ fun CallScreen(
493501
onNoiseCancellation = {
494502
isNoiseCancellationEnabled = call.toggleAudioProcessing()
495503
},
496-
) {
497-
isShowingStats = true
498-
isShowingSettingMenu = false
499-
}
504+
onShowCallStats = {
505+
isShowingStats = true
506+
isShowingSettingMenu = false
507+
},
508+
)
500509
}
501510

502511
if (isShowingFeedbackDialog) {

demo-app/src/main/kotlin/io/getstream/video/android/ui/join/CallJoinScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ private fun JoinCallForm(
461461
mutableStateOf(
462462
TextFieldValue(
463463
if (BuildConfig.FLAVOR == StreamFlavors.development) {
464-
"default:79cYh3J5JgGk"
464+
"default:123lexgvg"
465465
} else {
466466
""
467467
},

demo-app/src/main/kotlin/io/getstream/video/android/ui/lobby/CallLobbyScreen.kt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import io.getstream.video.android.compose.ui.components.call.lobby.CallLobby
7373
import io.getstream.video.android.core.Call
7474
import io.getstream.video.android.core.call.state.ToggleCamera
7575
import io.getstream.video.android.core.call.state.ToggleMicrophone
76+
import io.getstream.video.android.core.events.ParticipantCount
7677
import io.getstream.video.android.mock.StreamPreviewDataUtils
7778
import io.getstream.video.android.mock.previewCall
7879
import io.getstream.video.android.mock.previewUsers
@@ -270,23 +271,26 @@ private fun CallLobbyBody(
270271
private fun LobbyDescription(
271272
callLobbyViewModel: CallLobbyViewModel,
272273
) {
273-
val session by callLobbyViewModel.call.state.session.collectAsState()
274-
val participantsSize = session?.participants?.size ?: 0
274+
val participantCounts by callLobbyViewModel.call.state.participantCounts.collectAsState()
275275

276-
LobbyDescriptionContent(participantsSize = participantsSize) {
276+
LobbyDescriptionContent(participantCounts = participantCounts) {
277277
callLobbyViewModel.handleUiEvent(
278278
CallLobbyEvent.JoinCall,
279279
)
280280
}
281281
}
282282

283283
@Composable
284-
private fun LobbyDescriptionContent(participantsSize: Int, onClick: () -> Unit) {
285-
val text = if (participantsSize > 0) {
284+
private fun LobbyDescriptionContent(participantCounts: ParticipantCount?, onClick: () -> Unit) {
285+
val totalParticipants = participantCounts?.total ?: 0
286+
val anonParticipants = participantCounts?.anonymous ?: 0
287+
288+
val text = if (totalParticipants != 0) {
286289
Pair(
287290
stringResource(
288291
id = R.string.join_call_description,
289-
participantsSize,
292+
totalParticipants,
293+
anonParticipants,
290294
),
291295
stringResource(id = R.string.join_call),
292296
)
@@ -384,8 +388,7 @@ private fun CallLobbyBodyPreview() {
384388
onToggleMicrophone = {},
385389
onToggleCamera = {},
386390
) {
387-
LobbyDescriptionContent(participantsSize = 0) {
388-
}
391+
LobbyDescriptionContent(participantCounts = ParticipantCount(1, 1)) {}
389392
}
390393
}
391394
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/menu/MenuDefinitions.kt

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ import androidx.compose.material.icons.filled.BluetoothAudio
2727
import androidx.compose.material.icons.filled.Feedback
2828
import androidx.compose.material.icons.filled.Headphones
2929
import androidx.compose.material.icons.filled.HeadsetMic
30-
import androidx.compose.material.icons.filled.PortableWifiOff
30+
import androidx.compose.material.icons.filled.Replay
3131
import androidx.compose.material.icons.filled.RestartAlt
32+
import androidx.compose.material.icons.filled.SettingsBackupRestore
3233
import androidx.compose.material.icons.filled.SettingsVoice
3334
import androidx.compose.material.icons.filled.SpatialAudioOff
3435
import androidx.compose.material.icons.filled.SpeakerPhone
@@ -57,11 +58,12 @@ fun defaultStreamMenu(
5758
onToggleAudioFilterClick: () -> Unit,
5859
onRestartSubscriberIceClick: () -> Unit,
5960
onRestartPublisherIceClick: () -> Unit,
60-
onKillSfuWsClick: () -> Unit,
6161
onSwitchSfuClick: () -> Unit,
6262
onShowFeedback: () -> Unit,
6363
onNoiseCancellation: () -> Unit,
6464
onDeviceSelected: (StreamAudioDevice) -> Unit,
65+
onSfuRejoinClick: () -> Unit,
66+
onSfuFastReconnectClick: () -> Unit,
6567
availableDevices: List<StreamAudioDevice>,
6668
loadRecordings: suspend () -> List<MenuItem>,
6769
) = buildList<MenuItem> {
@@ -133,8 +135,9 @@ fun defaultStreamMenu(
133135
onToggleAudioFilterClick,
134136
onRestartSubscriberIceClick,
135137
onRestartPublisherIceClick,
136-
onKillSfuWsClick,
137138
onSwitchSfuClick,
139+
onSfuRejoinClick,
140+
onSfuFastReconnectClick,
138141
),
139142
),
140143
)
@@ -159,17 +162,52 @@ fun codecMenu(codecList: List<MediaCodecInfo>, onCodecSelected: (MediaCodecInfo)
159162
)
160163
}
161164

165+
fun reconnectMenu(
166+
onRestartPublisherIceClick: () -> Unit,
167+
onRestartSubscriberIceClick: () -> Unit,
168+
onSwitchSfuClick: () -> Unit,
169+
onSfuRejoinClick: () -> Unit,
170+
onSfuFastReconnectClick: () -> Unit,
171+
) = listOf(
172+
ActionMenuItem(
173+
title = "Publisher - ICE restart",
174+
icon = Icons.Default.SettingsBackupRestore,
175+
action = onRestartPublisherIceClick,
176+
),
177+
ActionMenuItem(
178+
title = "Subscriber - ICE restart",
179+
icon = Icons.Default.SettingsBackupRestore,
180+
action = onRestartSubscriberIceClick,
181+
),
182+
ActionMenuItem(
183+
title = "Reconnect SFU - migrate",
184+
icon = Icons.Default.SwitchLeft,
185+
action = onSwitchSfuClick,
186+
),
187+
ActionMenuItem(
188+
title = "Reconnect SFU - rejoin",
189+
icon = Icons.Default.Replay,
190+
action = onSfuRejoinClick,
191+
),
192+
ActionMenuItem(
193+
title = "Reconnect SFU - fast",
194+
icon = Icons.Default.RestartAlt,
195+
action = onSfuFastReconnectClick,
196+
),
197+
)
198+
162199
/**
163200
* Optionally defines the debug sub-menu of the demo app.
164201
*/
165202
fun debugSubmenu(
166203
codecList: List<MediaCodecInfo>,
167204
onCodecSelected: (MediaCodecInfo) -> Unit,
168205
onToggleAudioFilterClick: () -> Unit,
169-
onRestartSubscriberIceClick: () -> Unit,
170206
onRestartPublisherIceClick: () -> Unit,
171-
onKillSfuWsClick: () -> Unit,
207+
onRestartSubscriberIceClick: () -> Unit,
172208
onSwitchSfuClick: () -> Unit,
209+
onSfuRejoinClick: () -> Unit,
210+
onSfuFastReconnectClick: () -> Unit,
173211
) = listOf(
174212
SubMenuItem(
175213
title = "Available video codecs",
@@ -181,24 +219,15 @@ fun debugSubmenu(
181219
icon = Icons.Default.Audiotrack,
182220
action = onToggleAudioFilterClick,
183221
),
184-
ActionMenuItem(
185-
title = "Restart subscriber Ice",
186-
icon = Icons.Default.RestartAlt,
187-
action = onRestartSubscriberIceClick,
188-
),
189-
ActionMenuItem(
190-
title = "Restart publisher Ice",
191-
icon = Icons.Default.RestartAlt,
192-
action = onRestartPublisherIceClick,
193-
),
194-
ActionMenuItem(
195-
title = "Shut down SFU web-socket",
196-
icon = Icons.Default.PortableWifiOff,
197-
action = onKillSfuWsClick,
198-
),
199-
ActionMenuItem(
200-
title = "Switch SFU",
201-
icon = Icons.Default.SwitchLeft,
202-
action = onSwitchSfuClick,
222+
SubMenuItem(
223+
title = "Reconnect V2",
224+
icon = Icons.Default.Replay,
225+
items = reconnectMenu(
226+
onRestartPublisherIceClick,
227+
onRestartSubscriberIceClick,
228+
onSwitchSfuClick,
229+
onSfuRejoinClick,
230+
onSfuFastReconnectClick,
231+
),
203232
),
204233
)

demo-app/src/main/kotlin/io/getstream/video/android/ui/menu/SettingsMenu.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,25 @@ internal fun SettingsMenu(
135135
Toast.makeText(context, "Restart Publisher Ice", Toast.LENGTH_SHORT).show()
136136
}
137137

138-
val onKillSfuWsClick: () -> Unit = {
139-
call.debug.doFullReconnection()
138+
val onSfuRejoinClick: () -> Unit = {
139+
call.debug.rejoin()
140140
onDismissed.invoke()
141141
Toast.makeText(context, "Killing SFU WS. Should trigger reconnect...", Toast.LENGTH_SHORT)
142142
.show()
143143
}
144144

145145
val onSwitchSfuClick: () -> Unit = {
146-
call.debug.switchSfu()
146+
call.debug.migrate()
147147
onDismissed.invoke()
148148
Toast.makeText(context, "Switch sfu", Toast.LENGTH_SHORT).show()
149149
}
150150

151+
val onSfuFastReconnectClick: () -> Unit = {
152+
call.debug.fastReconnect()
153+
onDismissed.invoke()
154+
Toast.makeText(context, "Fast Reconnect SFU", Toast.LENGTH_SHORT).show()
155+
}
156+
151157
val codecInfos = remember {
152158
MediaCodecList(MediaCodecList.ALL_CODECS).codecInfos.filter {
153159
it.name.contains("encoder") && it.supportedTypes.firstOrNull {
@@ -222,13 +228,14 @@ internal fun SettingsMenu(
222228
},
223229
onShowFeedback = onShowFeedback,
224230
onToggleScreenShare = onScreenShareClick,
225-
onKillSfuWsClick = onKillSfuWsClick,
226231
onRestartPublisherIceClick = onRestartPublisherIceClick,
227232
onRestartSubscriberIceClick = onRestartSubscriberIceClick,
228233
onToggleAudioFilterClick = onToggleAudioFilterClick,
229234
onSwitchSfuClick = onSwitchSfuClick,
230235
onShowCallStats = onShowCallStats,
231236
onNoiseCancellation = onNoiseCancellation,
237+
onSfuRejoinClick = onSfuRejoinClick,
238+
onSfuFastReconnectClick = onSfuFastReconnectClick,
232239
isScreenShareEnabled = isScreenSharing,
233240
loadRecordings = onLoadRecordings,
234241
),
@@ -285,7 +292,8 @@ private fun SettingsMenuPreview() {
285292
onToggleAudioFilterClick = { },
286293
onRestartSubscriberIceClick = { },
287294
onRestartPublisherIceClick = { },
288-
onKillSfuWsClick = { },
295+
onSfuRejoinClick = { },
296+
onSfuFastReconnectClick = {},
289297
onSwitchSfuClick = { },
290298
availableDevices = emptyList(),
291299
onDeviceSelected = {},

0 commit comments

Comments
 (0)