-
-
Save skydoves/3f19e7c84da07e0784087718dbbfca92 to your computer and use it in GitHub Desktop.
StreamPeerConnectionFactory STUN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2023 Stream.IO, Inc. All Rights Reserved. | |
// SPDX-License-Identifier: Apache-2.0 | |
class StreamPeerConnectionFactory constructor( | |
private val context: Context | |
) { | |
// rtcConfig contains STUN and TURN servers list | |
val rtcConfig = PeerConnection.RTCConfiguration( | |
arrayListOf( | |
// adding google's standard server | |
PeerConnection.IceServer.builder("stun:stun.l.google.com:19302").createIceServer() | |
) | |
).apply { | |
// it's very important to use new unified sdp semantics PLAN_B is deprecated | |
sdpSemantics = PeerConnection.SdpSemantics.UNIFIED_PLAN | |
} | |
.. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment