Skip to content

Commit

Permalink
fix(lib): dispatching connect seems to be slower
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Feb 7, 2024
1 parent da9e8db commit 4f6fc22
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/ApiVideoLiveStream/ApiVideoLiveStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ public class ApiVideoLiveStream {
self.streamKey = streamKey
self.url = url

self.rtmpStream.lockQueue.sync {
rtmpConnection.connect(url)
}
self.rtmpConnection.connect(url)
}

/// Stop your livestream
Expand Down Expand Up @@ -432,9 +430,7 @@ public class ApiVideoLiveStream {
private func rtmpErrorHandler(_ notification: Notification) {
let e = Event.from(notification)
print("rtmpErrorHandler: \(e)")
DispatchQueue.main.async {
self.rtmpConnection.connect(self.url)
}
self.rtmpConnection.connect(self.url)
}

#if os(iOS)
Expand Down

0 comments on commit 4f6fc22

Please sign in to comment.