Commit ae8095f1 authored by Soomin Lee's avatar Soomin Lee

VLCPlaybackController: Rename to VLCPlaybackService

parent 56360b84
......@@ -57,10 +57,10 @@
self.titlesDataSource.dependendCollectionView = self.chaptersCollectionView;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mediaPlayerChanged) name:VLCPlaybackControllerPlaybackMetadataDidChange object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mediaPlayerChanged) name:VLCPlaybackServicePlaybackMetadataDidChange object:nil];
}
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackService *)vpc
{
return [vpc numberOfChaptersForCurrentTitle] > 1;
}
......@@ -92,14 +92,14 @@
@implementation VLCPlaybackInfoTitlesDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [[VLCPlaybackController sharedInstance] numberOfTitles];
return [[VLCPlaybackService sharedInstance] numberOfTitles];
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
VLCPlaybackInfoTVCollectionViewCell *trackCell = (VLCPlaybackInfoTVCollectionViewCell*)cell;
NSInteger row = indexPath.row;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
BOOL isSelected = [vpc indexOfCurrentTitle] == row;
trackCell.selectionMarkerVisible = isSelected;
......@@ -114,7 +114,7 @@
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
[[VLCPlaybackController sharedInstance] selectTitleAtIndex:indexPath.row];
[[VLCPlaybackService sharedInstance] selectTitleAtIndex:indexPath.row];
[collectionView reloadData];
[self.dependendCollectionView reloadData];
}
......@@ -123,7 +123,7 @@
@implementation VLCPlaybackInfoChaptersDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [[VLCPlaybackController sharedInstance] numberOfChaptersForCurrentTitle];
return [[VLCPlaybackService sharedInstance] numberOfChaptersForCurrentTitle];
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
......@@ -131,10 +131,10 @@
VLCPlaybackInfoTVCollectionViewCell *trackCell = (VLCPlaybackInfoTVCollectionViewCell*)cell;
NSInteger row = indexPath.row;
BOOL isSelected = [[VLCPlaybackController sharedInstance] indexOfCurrentChapter] == row;
BOOL isSelected = [[VLCPlaybackService sharedInstance] indexOfCurrentChapter] == row;
trackCell.selectionMarkerVisible = isSelected;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSDictionary *description = [vpc chapterDescriptionsDictAtIndex:row];
NSString *chapter = description[VLCChapterDescriptionName];
......@@ -146,7 +146,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
[[VLCPlaybackController sharedInstance] selectChapterAtIndex:indexPath.row];
[[VLCPlaybackService sharedInstance] selectChapterAtIndex:indexPath.row];
[collectionView reloadData];
}
......
......@@ -35,7 +35,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(updateMediaTitle)
name:VLCPlaybackControllerPlaybackMetadataDidChange
name:VLCPlaybackServicePlaybackMetadataDidChange
object:nil];
}
......@@ -51,7 +51,7 @@
self.metaDataLabel.textColor = darkColor;
}
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
self.titleLabel.text = vpc.metadata.title;
VLCMedia *media = [vpc currentlyPlayingMedia];
......@@ -149,7 +149,7 @@
- (void)updateMediaTitle
{
self.titleLabel.text = [VLCPlaybackController sharedInstance].metadata.title;
self.titleLabel.text = [VLCPlaybackService sharedInstance].metadata.title;
}
@end
......@@ -11,10 +11,10 @@
#import <UIKit/UIKit.h>
@class VLCPlaybackController;
@class VLCPlaybackService;
@protocol VLCPlaybackInfoPanelTVViewController <NSObject>
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc;
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackService *)vpc;
@end
......
......@@ -48,7 +48,7 @@ static inline void sharedSetup(VLCPlaybackInfoPanelTVViewController *self)
return NO;
}
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackService *)vpc
{
return YES;
}
......
......@@ -31,7 +31,7 @@
return CGSizeMake(CGRectGetWidth(self.view.bounds), 200);
}
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackService *)vpc
{
return [vpc isSeekable];
}
......@@ -86,7 +86,7 @@
- (void)updateRateControl
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
float currentRate = vpc.playbackRate;
NSInteger currentIndex = [self.possibleRates indexOfObjectPassingTest:^BOOL(NSNumber * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
......@@ -100,13 +100,13 @@
- (IBAction)rateControlChanged:(UISegmentedControl *)sender
{
float newRate = self.possibleRates[sender.selectedSegmentIndex].floatValue;
[VLCPlaybackController sharedInstance].playbackRate = newRate;
[VLCPlaybackService sharedInstance].playbackRate = newRate;
}
- (void)updateRepeatControl
{
NSUInteger selectedIndex;
VLCRepeatMode repeatMode = [VLCPlaybackController sharedInstance].repeatMode;
VLCRepeatMode repeatMode = [VLCPlaybackService sharedInstance].repeatMode;
switch (repeatMode) {
case VLCRepeatCurrentItem:
selectedIndex = 1;
......@@ -139,7 +139,7 @@
break;
}
[VLCPlaybackController sharedInstance].repeatMode = repeatMode;
[VLCPlaybackService sharedInstance].repeatMode = repeatMode;
}
@end
......@@ -106,7 +106,7 @@
- (void)searchForMedia
{
[self startActivity];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
self.osoFetcher.subtitleLanguageId = [defaults stringForKey:kVLCSettingLastUsedSubtitlesSearchLanguage];
[self.osoFetcher searchForSubtitlesWithQuery:vpc.metadata.title];
......@@ -129,10 +129,10 @@
- (void)MDFOSOFetcher:(MDFOSOFetcher *)aFetcher subtitleDownloadSucceededForItem:(MDFSubtitleItem *)subtitleItem atPath:(NSString *)pathToFile
{
[self stopActivity];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
[vpc openVideoSubTitlesFromFile:pathToFile];
[self dismissViewControllerAnimated:YES completion:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackMetadataDidChange object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackServicePlaybackMetadataDidChange object:nil];
}
#pragma mark - table view datasource
......
......@@ -32,7 +32,7 @@
- (NSArray<UIViewController*>*)tabViewControllers
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
return [_allTabViewControllers filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id<VLCPlaybackInfoPanelTVViewController> _Nonnull evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
return [[evaluatedObject class] shouldBeVisibleForPlaybackController:vpc];
}]];
......
......@@ -57,7 +57,7 @@
self.subtitleDataSource.title = [NSLocalizedString(@"SUBTITLES", nil) uppercaseStringWithLocale:currentLocale];
self.subtitleDataSource.cellIdentifier = [VLCPlaybackInfoTVCollectionViewCell identifier];
self.subtitleDataSource.parentViewController = self;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mediaPlayerChanged) name:VLCPlaybackControllerPlaybackMetadataDidChange object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mediaPlayerChanged) name:VLCPlaybackServicePlaybackMetadataDidChange object:nil];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -92,13 +92,13 @@
@implementation VLCPlaybackInfoTracksDataSourceAudio
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [[VLCPlaybackController sharedInstance] numberOfAudioTracks] + 1;
return [[VLCPlaybackService sharedInstance] numberOfAudioTracks] + 1;
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
VLCPlaybackInfoTVCollectionViewCell *trackCell = (VLCPlaybackInfoTVCollectionViewCell*)cell;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger row = indexPath.row;
NSString *trackName;
......@@ -128,7 +128,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger row = indexPath.row;
if (row >= [vpc numberOfAudioTracks]) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
......@@ -147,13 +147,13 @@
@implementation VLCPlaybackInfoTracksDataSourceSubtitle
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [[VLCPlaybackController sharedInstance] numberOfVideoSubtitlesIndexes] + 1;
return [[VLCPlaybackService sharedInstance] numberOfVideoSubtitlesIndexes] + 1;
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
VLCPlaybackInfoTVCollectionViewCell *trackCell = (VLCPlaybackInfoTVCollectionViewCell*)cell;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger row = indexPath.row;
NSString *trackName;
if (row >= [vpc numberOfVideoSubtitlesIndexes]) {
......@@ -173,7 +173,7 @@
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger row = indexPath.row;
if (row >= [vpc numberOfVideoSubtitlesIndexes]) {
if (self.parentViewController) {
......
......@@ -11,12 +11,12 @@
#import <UIKit/UIKit.h>
#import "VLCPlaybackController.h"
#import "VLCPlaybackService.h"
#import "VLCTransportBar.h"
@class VLCNetworkImageView;
@interface VLCFullscreenMovieTVViewController : UIViewController <VLCPlaybackControllerDelegate>
@interface VLCFullscreenMovieTVViewController : UIViewController <VLCPlaybackServiceDelegate>
@property (readwrite, nonatomic, weak) IBOutlet UIView *movieView;
......
......@@ -59,11 +59,11 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self
selector:@selector(playbackDidStop)
name:VLCPlaybackControllerPlaybackDidStop
name:VLCPlaybackServicePlaybackDidStop
object:nil];
[center addObserver:self
selector:@selector(playbackDidStop)
name:VLCPlaybackControllerPlaybackDidFail
name:VLCPlaybackServicePlaybackDidFail
object:nil];
_movieView.userInteractionEnabled = NO;
......@@ -148,7 +148,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
self.audioArtworkImageView.animateImageSetting = YES;
self.audioLargeBackgroundImageView.animateImageSetting = YES;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
vpc.delegate = self;
[vpc recoverPlaybackState];
}
......@@ -157,7 +157,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
{
[super viewDidAppear:animated];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
[vpc recoverDisplayedMetadata];
vpc.videoOutputView = nil;
vpc.videoOutputView = self.movieView;
......@@ -165,7 +165,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)viewWillDisappear:(BOOL)animated
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
if (vpc.videoOutputView == self.movieView) {
vpc.videoOutputView = nil;
}
......@@ -196,7 +196,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
[self setScanState:VLCPlayerScanStateNone];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
if (self.transportBar.scrubbing) {
[self selectButtonPressed];
} else {
......@@ -206,7 +206,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)panGesture:(UIPanGestureRecognizer *)panGestureRecognizer
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -276,7 +276,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)selectButtonPressed
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -314,7 +314,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)showInfoVCIfNotScrubbing
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -341,7 +341,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)handleIRPressUp
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -353,7 +353,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)handleIRPressLeft
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -369,7 +369,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
return;
}
BOOL paused = ![VLCPlaybackController sharedInstance].isPlaying;
BOOL paused = ![VLCPlaybackService sharedInstance].isPlaying;
if (paused) {
[self jumpBackward];
} else
......@@ -380,7 +380,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)handleIRPressRight
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -396,7 +396,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
return;
}
BOOL paused = ![VLCPlaybackController sharedInstance].isPlaying;
BOOL paused = ![VLCPlaybackService sharedInstance].isPlaying;
if (paused) {
[self jumpForward];
} else {
......@@ -406,7 +406,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)handleSiriRemote:(VLCSiriRemoteGestureRecognizer *)recognizer
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -520,7 +520,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
{
NSAssert(self.isSeekable, @"Tried to seek while not media is not seekable.");
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
if (vpc.isPlaying) {
[self jumpInterval:VLCJumpInterval];
......@@ -532,7 +532,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
{
NSAssert(self.isSeekable, @"Tried to seek while not media is not seekable.");
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
if (vpc.isPlaying) {
[self jumpInterval:-VLCJumpInterval];
......@@ -545,11 +545,11 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
{
NSAssert(self.isSeekable, @"Tried to seek while not media is not seekable.");
NSInteger duration = [VLCPlaybackController sharedInstance].mediaDuration;
NSInteger duration = [VLCPlaybackService sharedInstance].mediaDuration;
if (duration==0) {
return;
}
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
CGFloat intervalFraction = ((CGFloat)interval)/((CGFloat)duration);
CGFloat currentFraction = vpc.playbackPosition;
......@@ -561,7 +561,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
{
NSAssert(self.isSeekable, @"Tried to seek while not media is not seekable.");
NSInteger duration = [VLCPlaybackController sharedInstance].mediaDuration;
NSInteger duration = [VLCPlaybackService sharedInstance].mediaDuration;
if (duration==0) {
return;
}
......@@ -624,7 +624,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
NSAssert(self.isSeekable || scanState == VLCPlayerScanStateNone, @"Tried to seek while media not seekable.");
if (_scanState == VLCPlayerScanStateNone) {
self.scanSavedPlaybackRate = @([VLCPlaybackController sharedInstance].playbackRate);
self.scanSavedPlaybackRate = @([VLCPlaybackService sharedInstance].playbackRate);
}
_scanState = scanState;
float rate = 1.0;
......@@ -647,24 +647,24 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
break;
}
[VLCPlaybackController sharedInstance].playbackRate = rate;
[VLCPlaybackService sharedInstance].playbackRate = rate;
[self.transportBar setHint:hint];
}
- (BOOL)isSeekable
{
return [[VLCPlaybackController sharedInstance] isSeekable];
return [[VLCPlaybackService sharedInstance] isSeekable];
}
- (BOOL)canJump
{
// to match the AVPlayerViewController behavior only allow jumping when playing.
return [VLCPlaybackController sharedInstance].isPlaying;
return [VLCPlaybackService sharedInstance].isPlaying;
}
- (BOOL)canScrub
{
// to match the AVPlayerViewController behavior only allow scrubbing when paused.
return ![VLCPlaybackController sharedInstance].isPlaying;
return ![VLCPlaybackService sharedInstance].isPlaying;
}
#pragma mark -
......@@ -672,7 +672,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
- (void)updateTimeLabelsForScrubbingFraction:(CGFloat)scrubbingFraction
{
VLCTransportBar *bar = self.transportBar;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
// MAX 1, _ is ugly hack to prevent --:-- instead of 00:00
int scrubbingTimeInt = MAX(1,vpc.mediaDuration*scrubbingFraction);
VLCTime *scrubbingTime = [VLCTime timeWithInt:scrubbingTimeInt];
......@@ -685,7 +685,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
{
NSAssert(self.isSeekable, @"Tried to seek while not media is not seekable.");
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
self.transportBar.scrubbing = YES;
[self updateDimmingView];
if (vpc.isPlaying) {
......@@ -696,7 +696,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
{
self.transportBar.scrubbing = NO;
[self updateDimmingView];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
[vpc playPause];
}
......@@ -733,14 +733,14 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
- (void)fireHidePlaybackControlsIfNotPlayingTimer:(NSTimer *)timer
{
BOOL playing = [[VLCPlaybackController sharedInstance] isPlaying];
BOOL playing = [[VLCPlaybackService sharedInstance] isPlaying];
if (playing) {
[self animatePlaybackControlsToVisibility:NO];
}
}
- (void)showPlaybackControlsIfNeededForUserInteraction
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
NSInteger currentTitle = [vpc indexOfCurrentTitle];
if (currentTitle < [vpc numberOfTitles]) {
NSDictionary *title = [vpc titleDescriptionsDictAtIndex:currentTitle];
......@@ -798,7 +798,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
#pragma mark - playback controller delegation
- (void)prepareForMediaPlayback:(VLCPlaybackController *)controller
- (void)prepareForMediaPlayback:(VLCPlaybackService *)controller
{
self.audioView.hidden = YES;
}
......@@ -812,16 +812,16 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
isPlaying:(BOOL)isPlaying
currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
currentMediaHasChapters:(BOOL)currentMediaHasChapters
forPlaybackController:(VLCPlaybackController *)controller
forPlaybackService:(VLCPlaybackService *)playbackService
{
[self updateActivityIndicatorForState:currentState];
if (controller.isPlaying) {
if (playbackService.isPlaying) {
// we sometimes don't set the vout correctly if playback stops and restarts without dismising and redisplaying the VC
// hence, manually reset the vout container here if it doesn't have sufficient children
if (self.movieView.subviews.count < 2) {
controller.videoOutputView = self.movieView;
playbackService.videoOutputView = self.movieView;
}
if (!self.bufferingLabel.hidden) {
......@@ -832,7 +832,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
}
}
- (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller metadata:(VLCMetaData *)metadata
- (void)displayMetadataForPlaybackService:(VLCPlaybackService *)playbackService
metadata:(VLCMetaData *)metadata
{
NSString *title = metadata.title;
NSString *artist = metadata.artist;
......@@ -896,14 +897,14 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)updateTransportBarPosition
{
VLCPlaybackController *controller = [VLCPlaybackController sharedInstance];
VLCPlaybackService *controller = [VLCPlaybackService sharedInstance];
VLCTransportBar *transportBar = self.transportBar;
transportBar.remainingTimeLabel.text = [[controller remainingTime] stringValue];
transportBar.markerTimeLabel.text = [[controller playedTime] stringValue];
transportBar.playbackFraction = controller.playbackPosition;
}
- (void)playbackPositionUpdated:(VLCPlaybackController *)controller
- (void)playbackPositionUpdated:(VLCPlaybackService *)controller
{
// FIXME: hard coded state since the state in mediaPlayer is incorrectly still buffering
[self updateActivityIndicatorForState:VLCMediaPlayerStatePlaying];
......
......@@ -10,7 +10,7 @@
*****************************************************************************/
#import "VLCOpenNetworkStreamTVViewController.h"
#import "VLCPlaybackController.h"
#import "VLCPlaybackService.h"
#import "VLCPlayerDisplayController.h"
#import "VLCFullscreenMovieTVViewController.h"
#import "CAAnimation+VLCWiggle.h"
......@@ -145,7 +145,7 @@
- (void)_openURLStringAndDismiss:(NSString *)urlString
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
VLCMedia *media = [VLCMedia mediaWithURL:[NSURL URLWithString:urlString]];
VLCMediaList *medialist = [[VLCMediaList alloc] init];
[medialist addMedia:media];
......
......@@ -12,7 +12,7 @@
#import "VLCRemoteBrowsingCollectionViewController.h"
#import "VLCRemoteBrowsingTVCell.h"
#import "VLCPlayerDisplayController.h"
#import "VLCPlaybackController.h"
#import "VLCPlaybackService.h"
#import "VLCServerBrowsingController.h"
#import "VLCMaskView.h"
......
......@@ -300,7 +300,7 @@
VLCMediaList *medialist = [[VLCMediaList alloc] init];
[medialist addMedia:[VLCMedia mediaWithURL:url]];
[[VLCPlaybackController sharedInstance] playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
[[VLCPlaybackService sharedInstance] playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
[self presentViewController:[VLCFullscreenMovieTVViewController fullscreenMovieTVViewController]
animated:YES
completion:nil];
......
......@@ -12,7 +12,7 @@
#import "VLCServerBrowsingTVViewController.h"
#import "VLCRemoteBrowsingTVCell.h"
#import "VLCPlayerDisplayController.h"
#import "VLCPlaybackController.h"
#import "VLCPlaybackService.h"
#import "VLCServerBrowsingController.h"
#import "VLCMaskView.h"
#import "GRKArrayDiff+UICollectionView.h"
......
......@@ -191,7 +191,7 @@
VLCMediaList *medialist = [[VLCMediaList alloc] init];
[medialist addMedia:[VLCMedia mediaWithURL:url]];
[[VLCPlaybackController sharedInstance] playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
[[VLCPlaybackService sharedInstance] playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
[self presentViewController:[VLCFullscreenMovieTVViewController fullscreenMovieTVViewController]
animated:YES
......
......@@ -14,7 +14,7 @@
#import "VLCBoxCollectionViewController.h"
#import "VLCBoxController.h"
#import <XKKeychain/XKKeychainGenericPasswordItem.h>
#import "VLCPlaybackController.h"