mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Don't display quality selector if there is only one
This commit is contained in:
parent
9e32dab3cc
commit
a9798ac925
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user