Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-11-21 18:11:11 +04:00
parent 35d39c6fbc
commit d2015f3375
18 changed files with 145 additions and 64 deletions

View File

@@ -393,10 +393,12 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
if strongSelf.displayData != displayData {
strongSelf.displayData = displayData
var canShare = true
if let (_, valueOrLoading, _) = value, case let .state(value) = valueOrLoading, let source = value.item.playbackData?.source {
switch source {
case let .telegramFile(fileReference):
case let .telegramFile(fileReference, isCopyProtected):
canShare = !isCopyProtected
strongSelf.currentFileReference = fileReference
if let size = fileReference.media.size {
strongSelf.scrubberNode.bufferingStatus = strongSelf.postbox.mediaBox.resourceRangesStatus(fileReference.media.resource)
@@ -411,6 +413,8 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
strongSelf.scrubberNode.bufferingStatus = nil
}
strongSelf.updateLabels(transition: .immediate)
strongSelf.shareNode.isHidden = !canShare
}
})