Search code examples
objective-ciosxcode4itunes-store

Music preview from iTunes music store in iOS app


I have interesting question. It is possible to play music preview from iTunes music store in iOS app? How to do that? I need your help.


Solution

  • Yes, you can do this. I have a published app which does this.

    You need to get the URL's to the music preview files. One way is via the iTunes search API's. Another is via the Apple Enterprise Partner Feed.

    http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html

    http://www.apple.com/itunes/affiliates/resources/documentation/itunes-enterprise-partner-feed.html

    Once you have the URL, you can feed it to MPMoviePlayerController for progressive-download/playback. Or you can download the file yourself and feed it into AVAudioPlayer or your own playback infrastructure.

    Please check the Apple guidelines for using preview links. I believe you must be an affiliate, and you must be advertising the sale of the associated song. I also believe (please check) that Apple also permits affiliates to place these preview links on web pages, alongside affiliate links to purchase the songs.