Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f3a8d4af by Claudio Cambra at 2024-05-07T03:32:49+00:00
macosx: Add loading indicator to main video view XIB

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
f11df7bc by Claudio Cambra at 2024-05-07T03:32:49+00:00
macosx: Show and hide loading indicator in main video view based on buffer fill 
state

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
b4ec0537 by Claudio Cambra at 2024-05-07T03:32:49+00:00
macosx: Run animation for main video view loading indicator

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
823f9a79 by Claudio Cambra at 2024-05-07T03:32:49+00:00
macosx: Hide main video view loading indicator on load

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
32399ea6 by Claudio Cambra at 2024-05-07T03:32:49+00:00
macosx: Do not mark audio decorative view property as readwrite outlet

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
ff02f0a9 by Claudio Cambra at 2024-05-07T03:32:49+00:00
macosx: Ensure loading indicator is visible above decorative view

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -


3 changed files:

- modules/gui/macosx/UI/VLCMainVideoView.xib
- modules/gui/macosx/windows/video/VLCMainVideoViewController.h
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m


Changes:

=====================================
modules/gui/macosx/UI/VLCMainVideoView.xib
=====================================
@@ -14,6 +14,7 @@
                 <outlet property="controlsBar" destination="3" 
id="Mfq-2w-2uR"/>
                 <outlet property="fakeTitleBar" destination="jnw-gL-nrF" 
id="7lZ-al-c3d"/>
                 <outlet property="fakeTitleBarHeightConstraint" 
destination="wY4-If-nIp" id="wPt-X4-mgu"/>
+                <outlet property="loadingIndicator" destination="xOQ-YR-iAc" 
id="CtX-Yo-UX2"/>
                 <outlet property="mainControlsView" destination="D4V-Zd-qvB" 
id="KwM-ya-ETn"/>
                 <outlet property="overlayView" destination="FGS-tq-54S" 
id="RSC-7m-N0y"/>
                 <outlet property="playlistButton" destination="Drq-if-dw4" 
id="BZe-Cr-mzZ"/>
@@ -426,13 +427,19 @@
                     </view>
                     <color key="fillColor" red="0.0" green="0.0" blue="0.0" 
alpha="0.35060533940397354" colorSpace="custom" customColorSpace="sRGB"/>
                 </box>
+                <progressIndicator maxValue="100" indeterminate="YES" 
style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="xOQ-YR-iAc">
+                    <rect key="frame" x="344" y="156" width="32" height="32"/>
+                </progressIndicator>
             </subviews>
             <constraints>
                 <constraint firstItem="D4V-Zd-qvB" firstAttribute="bottom" 
secondItem="mAS-4a-RS8" secondAttribute="bottom" id="AaN-hq-IgD"/>
                 <constraint firstItem="mAS-4a-RS8" firstAttribute="top" 
secondItem="WRu-Ic-lQK" secondAttribute="top" id="F3X-8V-3Hg"/>
                 <constraint firstAttribute="bottom" secondItem="mAS-4a-RS8" 
secondAttribute="bottom" id="RPX-tv-ZTb"/>
                 <constraint firstItem="D4V-Zd-qvB" firstAttribute="top" 
secondItem="mAS-4a-RS8" secondAttribute="top" id="RUD-Fr-n5w"/>
+                <constraint firstItem="xOQ-YR-iAc" firstAttribute="top" 
secondItem="CvV-yX-Nbh" secondAttribute="bottom" constant="20" id="S0Y-3b-Ibd"/>
                 <constraint firstItem="mAS-4a-RS8" firstAttribute="leading" 
secondItem="WRu-Ic-lQK" secondAttribute="leading" id="Ygq-Dt-Lbg"/>
+                <constraint firstItem="xOQ-YR-iAc" firstAttribute="centerX" 
secondItem="WRu-Ic-lQK" secondAttribute="centerX" id="enR-Xo-ume"/>
+                <constraint firstItem="1GA-GG-Sdx" firstAttribute="top" 
relation="greaterThanOrEqual" secondItem="xOQ-YR-iAc" secondAttribute="bottom" 
constant="20" id="jM9-dz-8jm"/>
                 <constraint firstAttribute="trailing" secondItem="mAS-4a-RS8" 
secondAttribute="trailing" id="jOZ-5U-ips"/>
                 <constraint firstItem="D4V-Zd-qvB" firstAttribute="leading" 
secondItem="mAS-4a-RS8" secondAttribute="leading" id="rIC-FU-Uxl"/>
                 <constraint firstItem="D4V-Zd-qvB" firstAttribute="trailing" 
secondItem="mAS-4a-RS8" secondAttribute="trailing" id="z4h-I8-bGU"/>


=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.h
=====================================
@@ -35,7 +35,6 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, strong) IBOutlet VLCVoutView *voutView;
 @property (readwrite, strong) IBOutlet NSBox *mainControlsView;
 @property (readwrite, strong) IBOutlet VLCMainVideoViewOverlayView 
*overlayView;
-@property (readwrite, strong) IBOutlet 
VLCMainVideoViewAudioMediaDecorativeView *audioDecorativeView;
 @property (readwrite, strong) IBOutlet NSView *bottomBarView;
 @property (readwrite, strong) IBOutlet NSStackView *centralControlsStackView;
 @property (readwrite, strong) IBOutlet VLCMainVideoViewControlsBar 
*controlsBar;
@@ -47,7 +46,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, strong) IBOutlet NSLayoutConstraint 
*playlistButtonTrailingConstraint;
 @property (readwrite, strong) IBOutlet NSVisualEffectView *fakeTitleBar;
 @property (readwrite, strong) IBOutlet NSLayoutConstraint 
*fakeTitleBarHeightConstraint;
+@property (readwrite, strong) IBOutlet NSProgressIndicator *loadingIndicator;
 
+@property (readonly, strong) VLCMainVideoViewAudioMediaDecorativeView 
*audioDecorativeView;
 @property (readwrite, nonatomic) BOOL autohideControls;
 @property (readwrite, nonatomic) BOOL displayLibraryControls;
 @property (readonly) BOOL mouseOnControls;


=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -73,6 +73,10 @@
                                
selector:@selector(playerCurrentItemTrackListChanged:)
                                    name:VLCPlayerTrackListChanged
                                  object:nil];
+        [notificationCenter addObserver:self
+                                   selector:@selector(playerBufferChanged:)
+                                   name:VLCPlayerBufferChanged
+                                 object:nil];
     }
     return self;
 }
@@ -122,6 +126,7 @@
 
 - (void)viewDidLoad
 {
+    self.loadingIndicator.hidden = YES;
     _autohideControls = YES;
 
     [self setDisplayLibraryControls:NO];
@@ -194,6 +199,23 @@
     [self updateDecorativeViewVisibilityOnControllerChange:controller];
 }
 
+- (void)playerBufferChanged:(NSNotification *)notification
+{
+    NSParameterAssert(notification);
+    NSParameterAssert(notification.userInfo != nil);
+
+    NSNumber * const bufferFillNumber = 
notification.userInfo[VLCPlayerBufferFill];
+    NSAssert(bufferFillNumber != nil, @"Buffer fill number should not be nil");
+
+    const float bufferFill = bufferFillNumber.floatValue;
+    self.loadingIndicator.hidden = bufferFill == 1.0;
+    if (self.loadingIndicator.hidden) {
+        [self.loadingIndicator stopAnimation:self];
+    } else {
+        [self.loadingIndicator startAnimation:self];
+    }
+}
+
 - (BOOL)mouseOnControls
 {
     NSPoint mousePos = [self.view.window mouseLocationOutsideOfEventStream];



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/010853ff241ac37d5ee9e88211899eb832251d9f...ff02f0a9502a996c9d62baf453fb8ff030d94d67

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/010853ff241ac37d5ee9e88211899eb832251d9f...ff02f0a9502a996c9d62baf453fb8ff030d94d67
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to