Jelajahi Sumber

hide meta info labels with controls if playing video

Tobias Conradi 10 tahun lalu
induk
melakukan
993b8b3b94
1 mengubah file dengan 16 tambahan dan 0 penghapusan
  1. 16 0
      Sources/VLCMovieViewController.m

+ 16 - 0
Sources/VLCMovieViewController.m

@@ -69,6 +69,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
     BOOL _isScrubbing;
     BOOL _interfaceIsLocked;
     BOOL _switchingTracksNotChapters;
+    BOOL _audioOnly;
 
     BOOL _swipeGesturesEnabled;
     BOOL _variableJumpDurationEnabled;
@@ -569,6 +570,10 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
         }
         _multiSelectionView.alpha = 0.0f;
         _multiSelectionView.hidden = YES;
+
+        _artistNameLabel.hidden = NO;
+        _albumNameLabel.hidden = NO;
+        _trackNameLabel.hidden = NO;
     }
 
     void (^animationBlock)() = ^() {
@@ -582,6 +587,11 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
         _multiSelectionView.alpha = alpha;
         if (_sleepTimerContainer)
             _sleepTimerContainer.alpha = alpha;
+
+        CGFloat metaInfoAlpha = _audioOnly ? 1.0f : alpha;
+        _artistNameLabel.alpha = metaInfoAlpha;
+        _albumNameLabel.alpha = metaInfoAlpha;
+        _trackNameLabel.alpha = metaInfoAlpha;
     };
 
     void (^completionBlock)(BOOL finished) = ^(BOOL finished) {
@@ -595,6 +605,10 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
         if (_sleepTimerContainer)
             _sleepTimerContainer.hidden = YES;
         _multiSelectionView.hidden = YES;
+
+        _artistNameLabel.hidden = _audioOnly ? NO : _controlsHidden;
+        _albumNameLabel.hidden =  _audioOnly ? NO : _controlsHidden;
+        _trackNameLabel.hidden =  _audioOnly ? NO : _controlsHidden;
     };
 
     UIStatusBarAnimation animationType = animated? UIStatusBarAnimationFade: UIStatusBarAnimationNone;
@@ -845,6 +859,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
     self.timeNavigationTitleView.positionSlider.hidden = NO;
 
     self.videoFilterButton.hidden = audioOnly;
+
+    _audioOnly = audioOnly;
 }
 
 - (IBAction)playPause