diff --git a/MembraneRTC/src/main/java/org/membraneframework/rtc/transport/PhoenixTransport.kt b/MembraneRTC/src/main/java/org/membraneframework/rtc/transport/PhoenixTransport.kt index 0d40344..b3657b1 100644 --- a/MembraneRTC/src/main/java/org/membraneframework/rtc/transport/PhoenixTransport.kt +++ b/MembraneRTC/src/main/java/org/membraneframework/rtc/transport/PhoenixTransport.kt @@ -7,6 +7,7 @@ import org.membraneframework.rtc.events.ReceivableEvent import org.membraneframework.rtc.events.SendableEvent import org.membraneframework.rtc.events.serializeToMap import org.membraneframework.rtc.utils.ClosableCoroutineScope +import org.membraneframework.rtc.utils.SocketChannelParams import org.membraneframework.rtc.utils.SocketConnectionParams import org.phoenixframework.Channel import org.phoenixframework.Socket @@ -16,7 +17,8 @@ public class PhoenixTransport constructor( private val url: String, private val topic: String, private val ioDispatcher: CoroutineDispatcher, - private val params: SocketConnectionParams? = emptyMap() + private val params: SocketConnectionParams? = emptyMap(), + private val socketChannelParams: SocketChannelParams = emptyMap() ) : EventTransport { private lateinit var coroutineScope: CoroutineScope @@ -67,7 +69,7 @@ public class PhoenixTransport constructor( this.listener?.onClose() } - channel = socket!!.channel(topic) + channel = socket!!.channel(topic, socketChannelParams) channel?.join(timeout = 3000L) ?.receive("ok") { _ -> diff --git a/MembraneRTC/src/main/java/org/membraneframework/rtc/utils/types.kt b/MembraneRTC/src/main/java/org/membraneframework/rtc/utils/types.kt index 20e5107..1e92442 100644 --- a/MembraneRTC/src/main/java/org/membraneframework/rtc/utils/types.kt +++ b/MembraneRTC/src/main/java/org/membraneframework/rtc/utils/types.kt @@ -3,3 +3,4 @@ package org.membraneframework.rtc.utils typealias Payload = Map typealias Metadata = Map typealias SocketConnectionParams = Map +typealias SocketChannelParams = Map diff --git a/app/src/main/java/com/dscout/membranevideoroomdemo/viewmodels/RoomViewModel.kt b/app/src/main/java/com/dscout/membranevideoroomdemo/viewmodels/RoomViewModel.kt index 314ca4e..e3abd58 100644 --- a/app/src/main/java/com/dscout/membranevideoroomdemo/viewmodels/RoomViewModel.kt +++ b/app/src/main/java/com/dscout/membranevideoroomdemo/viewmodels/RoomViewModel.kt @@ -74,7 +74,13 @@ class RoomViewModel( room.value = MembraneRTC.connect( appContext = getApplication(), options = ConnectOptions( - transport = PhoenixTransport(url, "room:$roomName", Dispatchers.IO, params), + transport = PhoenixTransport( + url, + "room:$roomName", + Dispatchers.IO, + params, + mapOf("isSimulcastOn" to true) + ), config = mapOf("displayName" to displayName), encoderOptions = EncoderOptions( encoderType = EncoderType.HARDWARE