Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] Fix for Issue #19. Fixes crashes on iOS 5.0, where calls to NS... #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Source/BeamMusicPlayerViewController.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,21 @@ - (void)viewDidLoad
#else
// Since there is a bug/glitch in iOS with setting the thumb, we need to use an image with 5pt transparency at the bottom
UIImage* knobImg = [UIImage imageNamed:@"BeamMusicPlayerController.bundle/images/mpSpeakerSliderKnob.png"];
[self.volumeView setVolumeThumbImage:knobImg forState:UIControlStateNormal];
[self.volumeView setVolumeThumbImage:knobImg forState:UIControlStateHighlighted];
[self.volumeView setMinimumVolumeSliderImage:minImg forState:UIControlStateNormal];
[self.volumeView setMaximumVolumeSliderImage:maxImg forState:UIControlStateNormal];

if ([MPVolumeView instancesRespondToSelector: @selector (setVolumeThumbImage:forState:)]) { // iOS6 only
[self.volumeView setVolumeThumbImage:knobImg forState:UIControlStateNormal];
[self.volumeView setVolumeThumbImage:knobImg forState:UIControlStateNormal];
[self.volumeView setVolumeThumbImage:knobImg forState:UIControlStateHighlighted];
}

if ([MPVolumeView instancesRespondToSelector: @selector (setMinimumVolumeSliderImage:forState:)]) { // iOS6 only
[self.volumeView setMinimumVolumeSliderImage:minImg forState:UIControlStateNormal];
}

if ([MPVolumeView instancesRespondToSelector: @selector (setMaximumVolumeSliderImage:forState:)]) { // iOS6 only
[self.volumeView setMaximumVolumeSliderImage:maxImg forState:UIControlStateNormal];
}

#endif

// explicitly tint buttons
Expand Down