I have not found a better way than using part of the volume representation of the media player.
The following code snippet:
UIView *mpVolumeViewParentView = [[UIView alloc] initWithFrame:CGRectMake(5, 50, 50, 40)];
mpVolumeViewParentView.backgroundColor = [UIColor clearColor];
mpVolumeViewParentView.clipsToBounds = YES;
MPVolumeView *systemVolumeSlider = [[MPVolumeView alloc] initWithFrame:CGRectMake(-290, 0, 320, 40)];
[mpVolumeViewParentView addSubview:systemVolumeSlider];
[systemVolumeSlider release];
[self.view addSubview:mpVolumeViewParentView];
[mpVolumeViewParentView release];
This is not an ideal solution, but it does the job.
source
share