Skip to content

Commit 3c365f7

Browse files
committed
Disable tracks for location peer connections when disconnecting
1 parent e6c8215 commit 3c365f7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Sources/BandwidthWebRTC/RTCBandwidth.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public class RTCBandwidth: NSObject {
8181
/// Disconnect from Bandwidth's WebRTC signaling server and remove all local connections.
8282
public func disconnect() {
8383
signaling?.disconnect()
84+
localConnections.forEach { $0.peerConnection.senders.forEach { $0.track?.isEnabled = false } }
8485
localConnections.removeAll()
8586
}
8687

@@ -186,7 +187,7 @@ public class RTCBandwidth: NSObject {
186187
}
187188
}
188189
#endif
189-
190+
190191
private func negotiateSDP(endpointId: String, direction: String, mediaTypes: [MediaType], for peerConnection: RTCPeerConnection, completion: @escaping () -> Void) {
191192
debugPrint(direction)
192193

Sources/BandwidthWebRTC/Signaling/Signaling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protocol SignalingDelegate {
2727

2828
class Signaling {
2929
private let client = Client()
30-
30+
3131
var delegate: SignalingDelegate?
3232

3333
func connect(using token: String, completion: @escaping () -> Void) throws {

0 commit comments

Comments
 (0)