@@ -3548,39 +3548,41 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35483548 } ) ) )
35493549 }
35503550
3551- for quality in videoQualityState. available {
3552- let isSelected = videoQualityState. preferred == . quality( quality)
3553- let qualityTitle : String
3554- if quality <= 360 {
3555- qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityLow
3556- } else if quality <= 480 {
3557- qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityMedium
3558- } else if quality <= 720 {
3559- qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityHD
3560- } else if quality <= 1080 {
3561- qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityFHD
3562- } else {
3563- qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityQHD
3564- }
3565- items. append ( . action( ContextMenuActionItem ( text: qualityTitle, textLayout: . secondLineWithValue( " \( quality) p " ) , icon: { _ in
3566- if isSelected {
3567- return generateTintedImage ( image: UIImage ( bundleImageName: " Chat/Context Menu/Check " ) , color: . white)
3551+ if videoQualityState. available. count > 1 {
3552+ for quality in videoQualityState. available {
3553+ let isSelected = videoQualityState. preferred == . quality( quality)
3554+ let qualityTitle : String
3555+ if quality <= 360 {
3556+ qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityLow
3557+ } else if quality <= 480 {
3558+ qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityMedium
3559+ } else if quality <= 720 {
3560+ qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityHD
3561+ } else if quality <= 1080 {
3562+ qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityFHD
35683563 } else {
3569- return nil
3570- }
3571- } , action: { [ weak self] _, f in
3572- f ( . default)
3573-
3574- guard let self, let videoNode = self . videoNode else {
3575- return
3564+ qualityTitle = strongSelf. presentationData. strings. Gallery_VideoSettings_QualityQHD
35763565 }
3577- videoNode. setVideoQuality ( . quality( quality) )
3578- self . videoQualityPromise. set ( . quality( quality) )
3579-
3580- /*if let controller = strongSelf.galleryController() as? GalleryController {
3581- controller.updateSharedPlaybackRate(rate)
3582- }*/
3583- } ) ) )
3566+ items. append ( . action( ContextMenuActionItem ( text: qualityTitle, textLayout: . secondLineWithValue( " \( quality) p " ) , icon: { _ in
3567+ if isSelected {
3568+ return generateTintedImage ( image: UIImage ( bundleImageName: " Chat/Context Menu/Check " ) , color: . white)
3569+ } else {
3570+ return nil
3571+ }
3572+ } , action: { [ weak self] _, f in
3573+ f ( . default)
3574+
3575+ guard let self, let videoNode = self . videoNode else {
3576+ return
3577+ }
3578+ videoNode. setVideoQuality ( . quality( quality) )
3579+ self . videoQualityPromise. set ( . quality( quality) )
3580+
3581+ /*if let controller = strongSelf.galleryController() as? GalleryController {
3582+ controller.updateSharedPlaybackRate(rate)
3583+ }*/
3584+ } ) ) )
3585+ }
35843586 }
35853587 }
35863588 } else {
0 commit comments