@@ -228,6 +228,7 @@ - (instancetype)initWithFrame:(CGRect)frame
228228
229229 UIView *scrubberBackgroundView = [[UIView alloc ] initWithFrame: CGRectMake (0 .0f , 0 .0f , _headerView.frame.size.width, 64 .0f )];
230230 scrubberBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
231+ // scrubberBackgroundView.backgroundColor = [TGPhotoEditorInterfaceAssets toolbarTransparentBackgroundColor];
231232 [_scrubberPanelView addSubview: scrubberBackgroundView];
232233
233234 _scrubberView = [[TGMediaPickerGalleryVideoScrubber alloc ] initWithFrame: CGRectMake (0 .0f , _headerView.frame.size.height - 44 .0f , _headerView.frame.size.width, 68 .0f ) cover: false ];
@@ -440,44 +441,31 @@ - (void)setItem:(TGMediaPickerGalleryVideoItem *)item synchronously:(bool)synchr
440441 [_contentWrapperView addSubview: _entitiesView];
441442 }
442443
443-
444444 __weak TGMediaPickerGalleryVideoItemView *weakSelf = self;
445-
446- SSignal *durationSignal = item.durationSignal ;
447- if (durationSignal != nil ) {
448- [_videoDurationVar set: [[[durationSignal deliverOn: [SQueue mainQueue ]] catch: ^SSignal *(__unused id error)
445+ [_videoDurationVar set: [[[item.durationSignal deliverOn: [SQueue mainQueue ]] catch: ^SSignal *(__unused id error)
446+ {
447+ __strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
448+ if (strongSelf != nil && [error isKindOfClass: [NSNumber class ]])
449+ [strongSelf _setDownloadRequired ];
450+
451+ return nil ;
452+ }] onNext: ^(__unused id next)
453+ {
454+ __strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
455+ if (strongSelf != nil )
449456 {
450- __strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
451- if (strongSelf != nil && [error isKindOfClass: [NSNumber class ]])
452- [strongSelf _setDownloadRequired ];
453-
454- return nil ;
455- }] onNext: ^(__unused id next)
456- {
457- __strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
458- if (strongSelf != nil )
459- {
460- strongSelf->_downloaded = true ;
461- if (strongSelf->_currentAvailabilityObserver != nil )
462- strongSelf->_currentAvailabilityObserver (true );
463- }
464- }]];
465- } else {
466- _downloaded = true ;
467- if (_currentAvailabilityObserver != nil )
468- _currentAvailabilityObserver (true );
469- }
457+ strongSelf->_downloaded = true ;
458+ if (strongSelf->_currentAvailabilityObserver != nil )
459+ strongSelf->_currentAvailabilityObserver (true );
460+ }
461+ }]];
470462
471463 SSignal *imageSignal = nil ;
472464 if (item.asset != nil )
473465 {
474466 SSignal *assetSignal = [SSignal single: nil ];
475467 if ([item.asset isKindOfClass: [TGMediaAsset class ]])
476468 {
477- if (((TGMediaAsset *)item.asset ).type == TGMediaAssetPhotoType) {
478- [_scrubberPanelView setHidden: true ];
479- }
480-
481469 assetSignal = [TGMediaAssetImageSignals imageForAsset: (TGMediaAsset *)item.asset imageType: (item.immediateThumbnailImage != nil ) ? TGMediaAssetImageTypeScreen : TGMediaAssetImageTypeFastScreen size: CGSizeMake (1280 , 1280 )];
482470 }
483471 else
@@ -753,7 +741,7 @@ - (bool)usePhotoBehavior
753741- (bool )itemIsLivePhoto
754742{
755743 if ([self .item.asset isKindOfClass: [TGMediaAsset class ]])
756- return ((TGMediaAsset *)self.item .asset ) ;
744+ return ((TGMediaAsset *)self.item .asset ). subtypes & TGMediaAssetSubtypePhotoLive ;
757745
758746 return false ;
759747}
0 commit comments