tags:

views:

1192

answers:

5

I would like to have a feature in my iphone application that would start playing a file in my ipod section of the iphone. Does the SDK allow calls to this? Is there a simple way to start a song from my application other than using the iphones native interface?

+5  A: 

No, I think the official SDK does not allow this.

Mehrdad Afshari
Downvoters: This answer applies to iPhone OS 2.0. Look at the date!
Mehrdad Afshari
+2  A: 

You cannot launch the iPod app from your application. But you can easily play a song.

Use the AVAudioPlayer from the AVFoundation Framework.

Ars Technica has a nice article on it, here.

Gordon Wilson
Play a song from iPod music library... doubt it.
Mehrdad Afshari
No, a song within your app's sandbox.
Gordon Wilson
A: 

Nope you cannot fire off a song from your media library but you can play a song you have embedded in you app or you download from the web here are some examples

Apple - Example

AppsAmuck - Example

Jamey McElveen
+1  A: 

This is now possible with 3.0 but I will not go further into it due to NDA issues. The information is available on the Developer Site.

bjtitus
+1  A: 

Now that it's public, you're looking for MPMediaPickerController and MPMediaPickerControllerDelegate

http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMediaPickerController_ClassReference/Reference/Reference.html

John