Thursday, December 4, 2008

MPVolumeView Demo Project

Several people have asked for clarification on using the MPVolumeView, so I've put together a full XCode demo project to show off its usage and features.

Note: In order for the slider to respond to the volume buttons, you need to be playing audio. Otherwise you won't see anything happen.

Here's a link to the project: MPVolumeView Demo.

I included some extra features in the code I hadn't mentioned previously, such as how to change the color of portions of the slider, add icons for "soft" and "loud" ends of the slider, etc.


Anonymous said...

This seems to be missing. Can you repost or can someone point me to the project somewhere else? I'm having issues with trying to get the slider's Maximum and Minimum Track Images to display if the system volume isn't 0.

Mostly Torn said...

I updated the link. It should be correct now.

blacksheep said...

much thanx for the project.
it help me a lot!

compilation with 2.2.1 perfect.
no success with 3.0
what could be the reason?

blacksheep said...

p.s.: the app starts in simulator, but no slider showing up

Mostly Torn said...

In the 3.0 simulator, the slider will not show up, but it does still show up on a real 3.0 device.

blacksheep said...

big trouble! i uploaded my app to the app store, tested on an ipod touch where the slider is working. NOT so on iphones. wwhat could be the reason for that?

Siraj said...

When i run MPVolumeView Demo project i get 1347 error such as /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:66:0

Radu Ursache said...

even if your code don't work anymore (xcode 4.6/iOS 6) it helped me a lot!
using your code and this made the trick!

thank you!

All content copyright © 2009  Brian Stormont, unless otherwise noted.   All rights reserved.