mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various Fixes
This commit is contained in:
parent
ffed0c5515
commit
f6ba6d264c
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user