Commit 24762a2f authored by Carola's avatar Carola
Browse files

VLCPlaybackController: remove activePlaybackSession. isPlaying can be used instead

parent 3b85ec45
......@@ -1606,7 +1606,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (_vpc.activePlaybackSession && _controlsHidden)
if (_vpc.isPlaying && _controlsHidden)
[self setControlsHidden:NO animated:YES];
}
......@@ -1629,7 +1629,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
{
if (_vpc.activePlaybackSession && _controlsHidden)
if (_vpc.isPlaying && _controlsHidden)
[self setControlsHidden:NO animated:YES];
}
......
......@@ -45,7 +45,7 @@ Open a file in the libraryViewController without changing the playstate
- (void)openMediaLibraryObject:(NSManagedObject *)mediaObject
{
if (self.activePlaybackSession) {
if (self.isPlaying) {
NSArray *files = [MLFile fileForURL:self.mediaPlayer.media.url];
MLFile *nowPlayingFile = (MLFile *)(NSManagedObject *)files.firstObject;
MLFile *newFile;
......
......@@ -69,7 +69,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property (nonatomic, readwrite) float subtitleDelay; // in seconds, default = 0.0
@property (nonatomic, readonly) BOOL currentMediaHasChapters;
@property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom;
@property (nonatomic, readonly) BOOL activePlaybackSession;
@property (nonatomic, readwrite) BOOL fullscreenSessionRequested;
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
@property (nonatomic, readonly) NSTimer* sleepTimer;
......
......@@ -65,7 +65,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
BOOL _needsMetadataUpdate;
BOOL _mediaWasJustStarted;
BOOL _recheckForExistingThumbnail;
BOOL _activeSession;
BOOL _headphonesWasPlugged;
NSLock *_playbackSessionManagementLock;
......@@ -143,8 +142,8 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
_itemInMediaListToBePlayedFirst = (int)index;
_pathToExternalSubtitlesFile = subsFilePath;
_sessionWillRestart = self.activePlaybackSession;
self.activePlaybackSession ? [self stopPlayback] : [self startPlayback];
_sessionWillRestart = self.isPlaying;
self.isPlaying ? [self stopPlayback] : [self startPlayback];
}
- (void)startPlayback
......@@ -160,8 +159,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
return;
}
_activeSession = YES;
#if TARGET_OS_IOS
[[AVAudioSession sharedInstance] setDelegate:self];
#endif
......@@ -297,7 +294,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
[[UIApplication sharedApplication] openURL:_successCallback];
[[self remoteControlService] unsubscribeFromRemoteCommands];
_activeSession = NO;
[_playbackSessionManagementLock unlock];
if (!_sessionWillRestart) {
......@@ -447,11 +443,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
return [[_mediaPlayer audioTrackIndexes] count] > 2 || [[_mediaPlayer videoSubTitlesIndexes] count] > 1;
}
- (BOOL)activePlaybackSession
{
return _activeSession;
}
- (float)playbackRate
{
return _mediaPlayer.rate;
......
......@@ -289,7 +289,7 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
VLCPlaybackController *playbackController = [VLCPlaybackController sharedInstance];
UIView<VLCPlaybackControllerDelegate, VLCMiniPlaybackViewInterface> *miniPlaybackView = self.miniPlaybackView;
const NSTimeInterval animationDuration = 0.25;
const BOOL activePlaybackSession = playbackController.activePlaybackSession;
const BOOL activePlaybackSession = playbackController.isPlaying;
const BOOL miniPlayerVisible = miniPlaybackView.visible;
const CGRect viewRect = self.view.bounds;
......
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