0

I am creating an iPhone app where the user browse and download iTunes podcasts.

I am trying to find out how to play an audio podcast. This is what I have tried:

-(IBAction)play
{
    NSURL *urli=[NSURL URLWithString:@"https://itunes.apple.com/sa/podcast/mwq-alqary-bdalrhmn-bn-jmal/id539157991?mt=2#"];
    p = [[MPMoviePlayerController alloc] initWithContentURL:urli];

    [p play];
}

but I don't hear any sound.

David Rönnqvist
  • 56,267
  • 18
  • 167
  • 205

1 Answers1

0

ok i had research this a bit since i have never dealt with podcasts or MPMedia player before, but here is a link to a apple sample code that allows you to select a media file and play it on your device. this may not be a url download but it will give you the idea of how it is done. there are two depreciated methods in there one related to modal view and the other one is reuse identifier which you can find the new ones in stack overflows answers if you research. anyway i hope this helps you out man. here is the link:

http://developer.apple.com/library/ios/#samplecode/AddMusic/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008845

Adrian P
  • 6,479
  • 4
  • 38
  • 55