How do you implement an MPVolumeView?

Place it as a generic UIView, then use the inspector to set the class to MPVolumeView (ensuring that you also link the MediaPlayer framework). It'll still be shown as a regular slider in IB, but at runtime, it will be an instance of MPVolumeView and will have the necessary styles and behavior. Note that this may not work as expected in the iOS Simulator, which doesn't permit volume control.


Use this it will automatically get it

mpVolumeViewParentView.backgroundColor = [UIColor clearColor];
MPVolumeView *myVolumeView = [[MPVolumeView alloc] initWithFrame: mpVolumeViewParentView.bounds];
[mpVolumeViewParentView addSubview: myVolumeView];
[myVolumeView release];