Skip to content

Commit

Permalink
style/#110 :: ConnectionClientImpl의 변수 이름 수정
Browse files Browse the repository at this point in the history
Co-Authored-By: Youngkyu Song <[email protected]>
  • Loading branch information
Kiyoung-Kim-57 and youn9k committed Nov 26, 2024
1 parent 4d97bf5 commit 60d7d0c
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ public final class ConnectionClientImpl: ConnectionClient {
public var receivedDataPublisher = PassthroughSubject<Data, Never>()

public var remoteVideoView: UIView = CapturableVideoView()
public var userInfo: UserInfoEntity?
public var remoteUserInfo: UserInfoEntity?

public var roomID: String = ""

public init(
signalingService: SignalingService,
webRTCService: WebRTCService,
userInfo: UserInfoEntity? = nil
remoteUserInfo: UserInfoEntity? = nil
) {
self.signalingService = signalingService
self.webRTCService = webRTCService
self.userInfo = userInfo
self.remoteUserInfo = remoteUserInfo

self.signalingService.delegate = self
self.webRTCService.delegate = self
Expand All @@ -33,14 +33,18 @@ public final class ConnectionClientImpl: ConnectionClient {
self.bindRemoteVideo()
}

public func setRemoteUserInfo(_ remoteUserInfo: UserInfoEntity) {
self.remoteUserInfo = remoteUserInfo
}

public func sendOffer() {
guard let userInfo else { return }
guard let remoteUserInfo else { return }

self.webRTCService.offer { sdp in
self.signalingService.send(
sdp: sdp,
peerID: userInfo.id,
roomID: userInfo.roomID ?? ""
peerID: remoteUserInfo.id,
roomID: remoteUserInfo.roomID ?? ""
)
}
}
Expand Down Expand Up @@ -104,7 +108,7 @@ extension ConnectionClientImpl: SignalingServiceDelegate {
guard self.webRTCService.peerConnection.localDescription == nil else { return }

self.webRTCService.answer { sdp in
guard let userInfo = self.userInfo else { return }
guard let userInfo = self.remoteUserInfo else { return }

self.signalingService.send(
sdp: sdp,
Expand All @@ -130,12 +134,12 @@ extension ConnectionClientImpl: WebRTCServiceDelegate {
_ service: WebRTCService,
didGenerateLocalCandidate candidate: RTCIceCandidate
) {
guard let userInfo else { return }
guard let remoteUserInfo else { return }

self.signalingService.send(
candidate: candidate,
peerID: userInfo.id,
roomID: userInfo.roomID ?? ""
peerID: remoteUserInfo.id,
roomID: remoteUserInfo.roomID ?? ""
)
}

Expand Down

0 comments on commit 60d7d0c

Please sign in to comment.