Various Improvements

This commit is contained in:
Ilya Laktyushin
2021-11-25 20:26:37 +04:00
parent 8c7b94d422
commit b734b2a970
9 changed files with 231 additions and 11 deletions

View File

@@ -367,6 +367,14 @@ public final class MediaPlayerNode: ASDisplayNode {
}
}
public var captureProtected: Bool = false {
didSet {
if #available(iOS 13.0, *) {
self.videoLayer?.preventsCapture = captureProtected
}
}
}
public init(backgroundThread: Bool = false) {
self.videoNode = MediaPlayerNodeDisplayNode()
@@ -397,6 +405,9 @@ public final class MediaPlayerNode: ASDisplayNode {
Queue.mainQueue().async {
if let strongSelf = self {
strongSelf.videoLayer = videoLayer
if #available(iOS 13.0, *) {
videoLayer.preventsCapture = strongSelf.captureProtected
}
strongSelf.updateLayout()
strongSelf.layer.addSublayer(videoLayer)