diff --git a/Classes/LocalPlayerView.m b/Classes/LocalPlayerView.m index 63c6847..5f9ac13 100644 --- a/Classes/LocalPlayerView.m +++ b/Classes/LocalPlayerView.m @@ -440,7 +440,7 @@ - (IBAction)playButtonClicked:(id)sender { id delegate = self.delegate; if (self.playerState == LocalPlayerStateStopped && delegate && [delegate respondsToSelector:@selector(continueAfterPlayButtonClicked)]) { - if (![_delegate continueAfterPlayButtonClicked]) { + if (!_delegate.continueAfterPlayButtonClicked) { return; } } diff --git a/Classes/MediaViewController.m b/Classes/MediaViewController.m index dd6744b..362b072 100644 --- a/Classes/MediaViewController.m +++ b/Classes/MediaViewController.m @@ -37,10 +37,10 @@ typedef NS_ENUM(NSInteger, PlaybackMode) { @interface MediaViewController () { - IBOutlet UILabel *titleLabel; - IBOutlet UILabel *subtitleLabel; - IBOutlet UITextView *descriptionTextView; - IBOutlet LocalPlayerView *localPlayerView; + IBOutlet UILabel *_titleLabel; + IBOutlet UILabel *_subtitleLabel; + IBOutlet UITextView *_descriptionTextView; + IBOutlet LocalPlayerView *_localPlayerView; GCKSessionManager *_sessionManager; GCKCastSession *_castSession; GCKUIMediaController *_castMediaController; @@ -77,7 +77,7 @@ - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"in MediaViewController viewDidLoad"); - localPlayerView.delegate = self; + _localPlayerView.delegate = self; _castButton = [[GCKUICastButton alloc] initWithFrame:CGRectMake(0, 0, 24, 24)]; @@ -115,7 +115,7 @@ - (void)viewWillAppear:(BOOL)animated { appDelegate.castControlBarsEnabled = YES; if ((_playbackMode == PlaybackModeLocal) && _localPlaybackImplicitlyPaused) { - [localPlayerView play]; + [_localPlayerView play]; _localPlaybackImplicitlyPaused = NO; } @@ -182,10 +182,10 @@ - (void)viewWillDisappear:(BOOL)animated { [self setNavigationBarStyle:LPVNavBarDefault]; switch (_playbackMode) { case PlaybackModeLocal: - if (localPlayerView.playerState == LocalPlayerStatePlaying || - localPlayerView.playerState == LocalPlayerStateStarting) { + if (_localPlayerView.playerState == LocalPlayerStatePlaying || + _localPlayerView.playerState == LocalPlayerStateStarting) { _localPlaybackImplicitlyPaused = YES; - [localPlayerView pause]; + [_localPlayerView pause]; } break; case PlaybackModeRemote: @@ -213,11 +213,11 @@ - (void)deviceOrientationDidChange:(NSNotification *)notification { if (UIInterfaceOrientationIsLandscape(orientation)) { [self setNavigationBarStyle:LPVNavBarTransparent]; } else if (!UIInterfaceOrientationIsLandscape(orientation) || - !localPlayerView.playingLocally) { + !_localPlayerView.playingLocally) { [self setNavigationBarStyle:LPVNavBarDefault]; } - [localPlayerView orientationChanged]; + [_localPlayerView orientationChanged]; } - (void)setMediaInfo:(GCKMediaInformation *)mediaInfo { @@ -267,7 +267,7 @@ - (void)switchToLocalPlayback { - (void)populateMediaInfo:(BOOL)autoPlay playPosition:(NSTimeInterval)playPosition { NSLog(@"populateMediaInfo"); - titleLabel.text = + _titleLabel.text = [self.mediaInfo.metadata stringForKey:kGCKMetadataKeyTitle]; NSString *subtitle = @@ -275,14 +275,14 @@ - (void)populateMediaInfo:(BOOL)autoPlay if (!subtitle) { subtitle = [self.mediaInfo.metadata stringForKey:kGCKMetadataKeyStudio]; } - subtitleLabel.text = subtitle; + _subtitleLabel.text = subtitle; NSString *description = [self.mediaInfo.metadata stringForKey:kMediaKeyDescription]; - descriptionTextView.text = + _descriptionTextView.text = [description stringByReplacingOccurrencesOfString:@"\\n" withString:@"\n"]; - [localPlayerView loadMedia:self.mediaInfo + [_localPlayerView loadMedia:self.mediaInfo autoPlay:autoPlay playPosition:playPosition]; } @@ -300,11 +300,11 @@ - (void)switchToRemotePlayback { // If we were playing locally, load the local media on the remote player if ((_playbackMode == PlaybackModeLocal) && - (localPlayerView.playerState != LocalPlayerStateStopped) && + (_localPlayerView.playerState != LocalPlayerStateStopped) && self.mediaInfo) { NSLog(@"loading media: %@", self.mediaInfo); - NSTimeInterval playPosition = localPlayerView.streamPosition; - BOOL paused = (localPlayerView.playerState == LocalPlayerStatePaused); + NSTimeInterval playPosition = _localPlayerView.streamPosition; + BOOL paused = (_localPlayerView.playerState == LocalPlayerStatePaused); GCKMediaQueueItemBuilder *builder = [[GCKMediaQueueItemBuilder alloc] init]; builder.mediaInformation = self.mediaInfo; builder.autoplay = !paused; @@ -318,17 +318,17 @@ - (void)switchToRemotePlayback { repeatMode:GCKMediaRepeatModeOff customData:nil]; } - [localPlayerView stop]; - [localPlayerView showSplashScreen]; + [_localPlayerView stop]; + [_localPlayerView showSplashScreen]; [self setQueueButtonVisible:YES]; [_castSession.remoteMediaClient addListener:self]; _playbackMode = PlaybackModeRemote; } - (void)clearMetadata { - titleLabel.text = @""; - subtitleLabel.text = @""; - descriptionTextView.text = @""; + _titleLabel.text = @""; + _subtitleLabel.text = @""; + _descriptionTextView.text = @""; } - (void)showAlertWithTitle:(NSString *)title message:(NSString *)message { @@ -351,7 +351,7 @@ - (void)finishAdjustingStreamPosition:(id)sender { } - (void)togglePlayPause:(id)sender { - [localPlayerView togglePause]; + [_localPlayerView togglePause]; } #pragma mark - GCKSessionManagerListener @@ -485,7 +485,7 @@ - (BOOL)continueAfterPlayButtonClicked { target:self selector:@selector(enqueueSelectedItemRemotely)]; } - [_actionSheet presentInController:self sourceView:localPlayerView]; + [_actionSheet presentInController:self sourceView:_localPlayerView]; return NO; } diff --git a/Classes/RootContainerViewController.m b/Classes/RootContainerViewController.m index f79e528..03c65c7 100644 --- a/Classes/RootContainerViewController.m +++ b/Classes/RootContainerViewController.m @@ -21,9 +21,9 @@ @interface RootContainerViewController ()< GCKUIMiniMediaControlsViewControllerDelegate> { - __weak IBOutlet UIView *miniMediaControlsContainerView; - __weak IBOutlet NSLayoutConstraint *miniMediaControlsHeightConstraint; - GCKUIMiniMediaControlsViewController *miniMediaControlsViewController; + __weak IBOutlet UIView *_miniMediaControlsContainerView; + __weak IBOutlet NSLayoutConstraint *_miniMediaControlsHeightConstraint; + GCKUIMiniMediaControlsViewController *_miniMediaControlsViewController; } @property(nonatomic, weak, readwrite) @@ -36,13 +36,13 @@ @implementation RootContainerViewController - (void)viewDidLoad { [super viewDidLoad]; GCKCastContext *castContext = [GCKCastContext sharedInstance]; - miniMediaControlsViewController = + _miniMediaControlsViewController = [castContext createMiniMediaControlsViewController]; - miniMediaControlsViewController.delegate = self; + _miniMediaControlsViewController.delegate = self; [self updateControlBarsVisibility]; - [self installViewController:miniMediaControlsViewController - inContainerView:miniMediaControlsContainerView]; + [self installViewController:_miniMediaControlsViewController + inContainerView:_miniMediaControlsContainerView]; } - (void)setMiniMediaControlsViewEnabled:(BOOL)miniMediaControlsViewEnabled { @@ -56,12 +56,12 @@ - (void)setMiniMediaControlsViewEnabled:(BOOL)miniMediaControlsViewEnabled { - (void)updateControlBarsVisibility { if (self.miniMediaControlsViewEnabled && - miniMediaControlsViewController.active) { - miniMediaControlsHeightConstraint.constant = - miniMediaControlsViewController.minHeight; - [self.view bringSubviewToFront:miniMediaControlsContainerView]; + _miniMediaControlsViewController.active) { + _miniMediaControlsHeightConstraint.constant = + _miniMediaControlsViewController.minHeight; + [self.view bringSubviewToFront:_miniMediaControlsContainerView]; } else { - miniMediaControlsHeightConstraint.constant = 0; + _miniMediaControlsHeightConstraint.constant = 0; } [UIView animateWithDuration:kCastControlBarsAnimationDuration animations:^{ diff --git a/Resources/Main.storyboard b/Resources/Main.storyboard index b79a75b..ccd0cac 100644 --- a/Resources/Main.storyboard +++ b/Resources/Main.storyboard @@ -1,383 +1,381 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +