mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-06 14:25:04 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
d5010ebb3e
@ -3548,39 +3548,41 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
for quality in videoQualityState.available {
|
if videoQualityState.available.count > 1 {
|
||||||
let isSelected = videoQualityState.preferred == .quality(quality)
|
for quality in videoQualityState.available {
|
||||||
let qualityTitle: String
|
let isSelected = videoQualityState.preferred == .quality(quality)
|
||||||
if quality <= 360 {
|
let qualityTitle: String
|
||||||
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityLow
|
if quality <= 360 {
|
||||||
} else if quality <= 480 {
|
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityLow
|
||||||
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityMedium
|
} else if quality <= 480 {
|
||||||
} else if quality <= 720 {
|
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityMedium
|
||||||
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityHD
|
} else if quality <= 720 {
|
||||||
} else if quality <= 1080 {
|
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityHD
|
||||||
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityFHD
|
} else if quality <= 1080 {
|
||||||
} else {
|
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityFHD
|
||||||
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityQHD
|
|
||||||
}
|
|
||||||
items.append(.action(ContextMenuActionItem(text: qualityTitle, textLayout: .secondLineWithValue("\(quality)p"), icon: { _ in
|
|
||||||
if isSelected {
|
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: .white)
|
|
||||||
} else {
|
} else {
|
||||||
return nil
|
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityQHD
|
||||||
}
|
}
|
||||||
}, action: { [weak self] _, f in
|
items.append(.action(ContextMenuActionItem(text: qualityTitle, textLayout: .secondLineWithValue("\(quality)p"), icon: { _ in
|
||||||
f(.default)
|
if isSelected {
|
||||||
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: .white)
|
||||||
guard let self, let videoNode = self.videoNode else {
|
} else {
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
videoNode.setVideoQuality(.quality(quality))
|
}, action: { [weak self] _, f in
|
||||||
self.videoQualityPromise.set(.quality(quality))
|
f(.default)
|
||||||
|
|
||||||
/*if let controller = strongSelf.galleryController() as? GalleryController {
|
guard let self, let videoNode = self.videoNode else {
|
||||||
controller.updateSharedPlaybackRate(rate)
|
return
|
||||||
}*/
|
}
|
||||||
})))
|
videoNode.setVideoQuality(.quality(quality))
|
||||||
|
self.videoQualityPromise.set(.quality(quality))
|
||||||
|
|
||||||
|
/*if let controller = strongSelf.galleryController() as? GalleryController {
|
||||||
|
controller.updateSharedPlaybackRate(rate)
|
||||||
|
}*/
|
||||||
|
})))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -178,9 +178,7 @@ private func validatePeerReadState(network: Network, postbox: Postbox, stateMana
|
|||||||
if case let .idBased(updatedMaxIncomingReadId, _, _, updatedCount, updatedMarkedUnread) = readState {
|
if case let .idBased(updatedMaxIncomingReadId, _, _, updatedCount, updatedMarkedUnread) = readState {
|
||||||
if updatedCount != 0 || updatedMarkedUnread {
|
if updatedCount != 0 || updatedMarkedUnread {
|
||||||
if localMaxIncomingReadId > updatedMaxIncomingReadId {
|
if localMaxIncomingReadId > updatedMaxIncomingReadId {
|
||||||
if !"".isEmpty {
|
return .retry
|
||||||
return .retry
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user