Commit 7f963142 authored by Soomin Lee's avatar Soomin Lee

VLCPlayerDisplayController: Miniplayer: Check is player is setup

This makes the property playerIsSetup accessible in order to check
if the player is setup.

Indeed for the case of the miniplayer, we were basing the shown
state on the return values of libvlc `willPlay` and `isPlaying`.
This led to have inconsistency because of synchronization issues.

(closes #472)
parent 3d611509
......@@ -63,6 +63,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property (nonatomic, readonly) NSInteger mediaDuration;
@property (nonatomic, readonly) BOOL isPlaying;
@property (nonatomic, readonly) BOOL willPlay;
@property (nonatomic, readonly) BOOL playerIsSetup;
@property (nonatomic, readwrite) VLCRepeatMode repeatMode;
@property (nonatomic, assign, getter=isShuffleMode) BOOL shuffleMode;
@property (nonatomic, readwrite) float playbackRate; // default = 1.0
......@@ -47,7 +47,6 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
VLCRemoteControlService *_remoteControlService;
VLCMediaPlayer *_mediaPlayer;
VLCMediaListPlayer *_listPlayer;
BOOL _playerIsSetup;
BOOL _shouldResumePlaying;
BOOL _sessionWillRestart;
......@@ -260,7 +260,7 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
VLCPlaybackController *playbackController = [VLCPlaybackController sharedInstance];
UIView<VLCPlaybackControllerDelegate, VLCMiniPlayer> *miniPlaybackView = self.miniPlaybackView;
const NSTimeInterval animationDuration = 0.25;
const BOOL activePlaybackSession = playbackController.isPlaying || playbackController.willPlay;
const BOOL activePlaybackSession = playbackController.isPlaying || playbackController.willPlay || playbackController.playerIsSetup;
const BOOL miniPlayerVisible = miniPlaybackView.visible;
BOOL needsShow = activePlaybackSession && !miniPlayerVisible;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment