diff --git a/Sources/ion/Client.swift b/Sources/ion/Client.swift index 09ae905..9eec5a3 100644 --- a/Sources/ion/Client.swift +++ b/Sources/ion/Client.swift @@ -36,14 +36,13 @@ class Client { stream.delegate = self } -// _ = publisher.createAudioTrack(label: "audio", streamId: "stream") - publisher.offer(completion: { result in switch result { case .failure: - break - case let .success(description): break // @TODO + case let .success(description): + debugPrint(description) +// self.signal.offer(description) } }) } diff --git a/Sources/ion/WebRTC/WebRTC.swift b/Sources/ion/WebRTC/WebRTC.swift index 2f15e87..1c8d851 100644 --- a/Sources/ion/WebRTC/WebRTC.swift +++ b/Sources/ion/WebRTC/WebRTC.swift @@ -108,13 +108,13 @@ final class WebRTCClient: NSObject { return completion(.failure(error)) } - if let sdp = sdp { - return completion(.success(sdp)) - } - - // @TODO SET REMOTE + peerConnection.setRemoteDescription(sdp, completionHandler: { error in + if let error = error { + return completion(.failure(error)) + } - fatalError("both SDP and Error were nil") + return completion(.success(sdp)) + }) }) } @@ -148,7 +148,6 @@ final class WebRTCClient: NSObject { let track = WebRTCClient.factory.audioTrack(with: audioSource, trackId: label) - // @TODO FIGURE THIS PART OUT peerConnection.add(track, streamIds: [streamId]) peerConnection.addTransceiver(with: track)