Commit ee60ec4d authored by Carola's avatar Carola
Browse files

VLCPlaybackInfoControllers+ VLCPlaybackController: remove knowledge of Mediaplayer

parent ffc13911
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc + (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc
{ {
return vpc.mediaPlayer.isSeekable; return [vpc isSeekable];
} }
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
}]; }];
UISegmentedControl *rateControl = self.rateControl; UISegmentedControl *rateControl = self.rateControl;
rateControl.selectedSegmentIndex = currentIndex; rateControl.selectedSegmentIndex = currentIndex;
rateControl.enabled = vpc.mediaPlayer.isSeekable; rateControl.enabled = [vpc isSeekable];
} }
- (IBAction)rateControlChanged:(UISegmentedControl *)sender - (IBAction)rateControlChanged:(UISegmentedControl *)sender
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
{ {
[self stopActivity]; [self stopActivity];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance]; VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc.mediaPlayer openVideoSubTitlesFromFile:pathToFile]; [vpc openVideoSubTitlesFromFile:pathToFile];
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackMetadataDidChange object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackMetadataDidChange object:nil];
} }
......
...@@ -77,6 +77,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -77,6 +77,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property (readonly) NSInteger numberOfChaptersForCurrentTitle; @property (readonly) NSInteger numberOfChaptersForCurrentTitle;
@property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom; @property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom;
@property (nonatomic, readwrite) BOOL fullscreenSessionRequested; @property (nonatomic, readwrite) BOOL fullscreenSessionRequested;
@property (nonatomic, readonly) BOOL isSeekable;
@property (readonly) NSNumber *playbackTime; @property (readonly) NSNumber *playbackTime;
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary; @property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
@property (nonatomic, readonly) NSTimer* sleepTimer; @property (nonatomic, readonly) NSTimer* sleepTimer;
...@@ -109,5 +110,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -109,5 +110,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval; - (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath; - (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath;
- (void)openVideoSubTitlesFromFile:(NSString *)pathToFile;
@end @end
...@@ -137,6 +137,11 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate> ...@@ -137,6 +137,11 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
} }
#pragma mark - playback management #pragma mark - playback management
- (void)openVideoSubTitlesFromFile:(NSString *)pathToFile
{
[_mediaPlayer openVideoSubTitlesFromFile:pathToFile];
}
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath - (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath
{ {
self.mediaList = mediaList; self.mediaList = mediaList;
...@@ -449,6 +454,11 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate> ...@@ -449,6 +454,11 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
return [[_mediaPlayer audioTrackIndexes] count] > 2 || [[_mediaPlayer videoSubTitlesIndexes] count] > 1; return [[_mediaPlayer audioTrackIndexes] count] > 2 || [[_mediaPlayer videoSubTitlesIndexes] count] > 1;
} }
- (BOOL) isSeekable
{
return _mediaPlayer.isSeekable;
}
- (NSNumber *)playbackTime - (NSNumber *)playbackTime
{ {
return _mediaPlayer.time.value; return _mediaPlayer.time.value;
......
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