You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Bugfix: LiveLink App had two datachannels, one it created and one that was automatically created as part of the request from the UE side. Fix is to remove manual creation of the datachannel on the LiveLink app side.
#rb Brian.Smith #jira UE-194903 [CL 27744198 by Luke Bermingham in ue5-main branch]
This commit is contained in:
@@ -61,12 +61,6 @@ final class WebRTCClient: NSObject {
|
||||
|
||||
self.peerConnection = pc
|
||||
|
||||
// Create the data channel
|
||||
if let dataChannel = createDataChannel(peerConnection: pc) {
|
||||
dataChannel.delegate = self
|
||||
self.dataChannel = dataChannel
|
||||
}
|
||||
|
||||
self.configureAudioSession()
|
||||
self.peerConnection!.delegate = self
|
||||
}
|
||||
@@ -178,15 +172,6 @@ final class WebRTCClient: NSObject {
|
||||
// MARK: Data Channels
|
||||
extension WebRTCClient: RTCDataChannelDelegate {
|
||||
|
||||
private func createDataChannel(peerConnection : RTCPeerConnection) -> RTCDataChannel? {
|
||||
let config = RTCDataChannelConfiguration()
|
||||
guard let dataChannel = peerConnection.dataChannel(forLabel: "iOSDataChannel", configuration: config) else {
|
||||
debugPrint("Warning: Couldn't create data channel.")
|
||||
return nil
|
||||
}
|
||||
return dataChannel
|
||||
}
|
||||
|
||||
func sendData(_ data: Data) {
|
||||
let buffer = RTCDataBuffer(data: data, isBinary: true)
|
||||
self.dataChannel?.sendData(buffer)
|
||||
@@ -239,6 +224,12 @@ extension WebRTCClient: RTCPeerConnectionDelegate {
|
||||
|
||||
func peerConnection(_ peerConnection: RTCPeerConnection, didOpen dataChannel: RTCDataChannel) {
|
||||
debugPrint("peerConnection did open data channel")
|
||||
|
||||
// Store datachannel internally for message sending and set datachannel delegate so we can react to its events
|
||||
dataChannel.delegate = self
|
||||
self.dataChannel = dataChannel
|
||||
|
||||
// Send the device resolution over the datachannel
|
||||
self.sendDeviceResolution()
|
||||
}
|
||||
|
||||
|
||||
@@ -582,6 +582,8 @@ extension WebRTCStreamingConnection: WebRTCClientDelegate {
|
||||
case .LatencyTest:
|
||||
fallthrough
|
||||
case .InitialSettings:
|
||||
// Do nothing with initial settings, but use it to send device resolution as this is a convenient time as we are guaranteed datachannel is working
|
||||
self.webRTCClient?.sendDeviceResolution()
|
||||
fallthrough
|
||||
case .FileExtension:
|
||||
fallthrough
|
||||
|
||||
Reference in New Issue
Block a user