[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: Extract decorative view presentation logic into separate method
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun May 5 04:22:34 UTC 2024
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
6b5ba39e by Claudio Cambra at 2024-05-03T02:06:27+08:00
macosx: Extract decorative view presentation logic into separate method
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
a7e86d44 by Claudio Cambra at 2024-05-03T02:10:54+08:00
macosx: Send player controller with track list change notification
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
ce78ae84 by Claudio Cambra at 2024-05-03T02:11:43+08:00
macosx: Update decorative view state on track list change
Relevant for streams where after buffering we can discover that it is in fact a video stream and we need to show the actual video, not the decorative view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
2 changed files:
- modules/gui/macosx/playlist/VLCPlayerController.m
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m
Changes:
=====================================
modules/gui/macosx/playlist/VLCPlayerController.m
=====================================
@@ -1390,7 +1390,7 @@ static int BossCallback(vlc_object_t *p_this,
- (void)trackListChanged
{
- [_defaultNotificationCenter postNotificationName:VLCPlayerTrackListChanged object:nil];
+ [_defaultNotificationCenter postNotificationName:VLCPlayerTrackListChanged object:self];
}
- (void)selectTrack:(VLCTrackMetaData *)track exclusively:(BOOL)exclusiveSelection
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -69,6 +69,10 @@
selector:@selector(playerCurrentMediaItemChanged:)
name:VLCPlayerCurrentMediaItemChanged
object:nil];
+ [notificationCenter addObserver:self
+ selector:@selector(playerCurrentItemTrackListChanged:)
+ name:VLCPlayerTrackListChanged
+ object:nil];
}
return self;
}
@@ -152,12 +156,8 @@
[self.controlsBar update];
}
-- (void)playerCurrentMediaItemChanged:(NSNotification *)notification
+- (void)updateDecorativeViewVisibilityOnControllerChange:(VLCPlayerController *)controller
{
- NSParameterAssert(notification);
- VLCPlayerController * const controller = notification.object;
- NSAssert(controller != nil, @"Player current media item changed notification should carry a valid player controller");
-
VLCMediaLibraryMediaItem * const mediaItem = [VLCMediaLibraryMediaItem mediaItemForURL:controller.URLOfCurrentMediaItem];
BOOL decorativeViewVisible = NO;
@@ -176,6 +176,24 @@
}
}
+- (void)playerCurrentMediaItemChanged:(NSNotification *)notification
+{
+ NSParameterAssert(notification);
+ VLCPlayerController * const controller = notification.object;
+ NSAssert(controller != nil,
+ @"Player current media item changed notification should have valid player controller");
+ [self updateDecorativeViewVisibilityOnControllerChange:controller];
+}
+
+- (void)playerCurrentItemTrackListChanged:(NSNotification *)notification
+{
+ NSParameterAssert(notification);
+ VLCPlayerController * const controller = notification.object;
+ NSAssert(controller != nil,
+ @"Player current item track list changed notification should have valid player controller");
+ [self updateDecorativeViewVisibilityOnControllerChange:controller];
+}
+
- (BOOL)mouseOnControls
{
NSPoint mousePos = [self.view.window mouseLocationOutsideOfEventStream];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0e39c49c95a97113006864d388b4cf9021c13ce2...ce78ae848963786b528ea4db79de83f6597c3fc7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0e39c49c95a97113006864d388b4cf9021c13ce2...ce78ae848963786b528ea4db79de83f6597c3fc7
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list