Various Fixes

This commit is contained in:
Ilya Laktyushin 2021-11-26 01:24:00 +04:00
parent ffed0c5515
commit f6ba6d264c
3 changed files with 6 additions and 12 deletions

View File

@ -367,15 +367,7 @@ 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) {
public init(backgroundThread: Bool = false, captureProtected: Bool = false) {
self.videoNode = MediaPlayerNodeDisplayNode()
if false && backgroundThread {
@ -406,7 +398,7 @@ public final class MediaPlayerNode: ASDisplayNode {
if let strongSelf = self {
strongSelf.videoLayer = videoLayer
if #available(iOS 13.0, *) {
videoLayer.preventsCapture = strongSelf.captureProtected
videoLayer.preventsCapture = captureProtected
}
strongSelf.updateLayout()

View File

@ -1573,6 +1573,9 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
imageView.contentMode = .scaleToFill
imageView.image = strongSelf.imageNode.image
imageView.frame = strongSelf.imageNode.frame
if imageView.layer.contents == nil {
imageView.layer.contents = imageView.image?.cgImage
}
strongSelf.imageNode.view.superview?.insertSubview(imageView, aboveSubview: strongSelf.imageNode.view)
view = self?.view.snapshotContentTree(unhide: true)

View File

@ -172,8 +172,7 @@ private final class NativeVideoContentNode: ASDisplayNode, UniversalVideoContent
actionAtEndImpl?()
})
}
self.playerNode = MediaPlayerNode(backgroundThread: false)
self.playerNode.captureProtected = captureProtected
self.playerNode = MediaPlayerNode(backgroundThread: false, captureProtected: captureProtected)
self.player.attachPlayerNode(self.playerNode)
self.dimensions = fileReference.media.dimensions?.cgSize