Open Miara opened 3 weeks ago
I see that the problem is only with audio settings. Video settings seem to work corretly.
Here is the hack I did to make it working as expected:
@OptIn(StreamCallActivityDelicateApi::class)
class CallActivity : ComposeStreamCallActivity() {
override val uiDelegate: StreamActivityUiDelegate<StreamCallActivity> = CallActivityUIDelegate()
override val configuration: StreamCallActivityConfiguration =
StreamCallActivityConfiguration(closeScreenOnCallEnded = false)
override fun create(
call: Call,
ring: Boolean,
members: List<String>,
onSuccess: (suspend (Call) -> Unit)?,
onError: (suspend (Exception) -> Unit)?
) {
val isVideo = call.type == "video"
lifecycleScope.launch(Dispatchers.IO) {
val instance = StreamVideo.instance()
val result = call.create(
// List of all users, containing the caller also
memberIds = members + instance.userId,
// If other users will get push notification.
ring = ring,
settings = CallSettingsRequest(
audio = AudioSettingsRequest(
defaultDevice = if(isVideo) AudioSettingsRequest.DefaultDevice.Speaker else AudioSettingsRequest.DefaultDevice.Earpiece,
micDefaultOn = true
),
)
)
result.onOutcome(call, onSuccess, onError)
}
}
private suspend fun <A : Any> Result<A>.onOutcome(
call: Call,
onSuccess: (suspend (Call) -> Unit)? = null,
onError: (suspend (Exception) -> Unit)? = null,
) = withContext(Dispatchers.Main) {
onSuccess?.let {
onSuccessSuspend {
onSuccess(call)
}
} onError?.let {
onErrorSuspend {
onError(Exception(it.message))
}
} }}
Hi @Miara, we'll look into it as soon as possible, thanks for reporting this issue.
I see that even my hack partially works, because when I have this custom setting:
micDefaultOn
works, so after call is started, microphone is enabled
but speakerDefaultOn
doesn't work. even if this is set to true, speaker is disabled
Describe the bug I created custom call types:
video
andaudio
in GetStream Dasboard. I set settings for each of these types. For example for video I set these settings:And in custom settings:
Hovewer after call is started - microphone is disabled and speaker is disabled as well - I can hear only voice from Earpiece audio source.
I'm not sure it something is not ok with console web implementation, or backend implementation, or Android SDK implementation, or even I did something wrong - but i guess it's bug on your side, because I create as simple call activity as possible, using only your code:
SDK version
To Reproduce Steps to reproduce the behavior:
Expected behavior Microphone is enabled, speaker mode is enabled
Device: