Skip to content

Commit 07b2e3d

Browse files
authored
Use new lib with shouldReceive (#88)
* flip shouldReceive * use .04 * .05
1 parent b48e322 commit 07b2e3d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
)
1818
],
1919
dependencies: [
20-
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("97.4692.02")),
20+
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("97.4692.05")),
2121
.package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.18.0")),
2222
.package(name: "Promises", url: "https://github.com/google/promises.git", .upToNextMajor(from: "2.0.0")),
2323
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),

Sources/LiveKit/Publications/RemoteTrackPublication.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import Foundation
1818
import CoreGraphics
1919
import Promises
20+
import WebRTC
2021

2122
public enum SubscriptionState {
2223
case subscribed
@@ -313,6 +314,11 @@ extension RemoteTrackPublication {
313314
let viewsString = asViews.enumerated().map { (i, view) in "view\(i).isVisible: \(view.isVisible)(didLayout: \(view._state.didLayout), isHidden: \(view._state.isHidden), isEnabled: \(view._state.isEnabled))" }.joined(separator: ", ")
314315
log("[adaptiveStream] disabling sid: \(sid), viewCount: \(asViews.count), \(viewsString)")
315316
}
317+
318+
if let videoTrack = track?.mediaTrack as? RTCVideoTrack {
319+
log("VideoTrack.shouldReceive: \(enabled)")
320+
DispatchQueue.webRTC.sync { videoTrack.shouldReceive = enabled }
321+
}
316322

317323
send(trackSettings: newSettings).catch(on: .sdk) { [weak self] error in
318324
guard let self = self else { return }

0 commit comments

Comments
 (0)