0

I'm trying to use an MPMoviePlayerController on iOS to play back an audio stream over HTTP.

I've imported MediaPlayer.framework and used the code from MPMoviePlayerController's documentation, but I get no sound.

MPMoviePlayerController *player =
[[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://shoutmedia.abc.net.au:10326"]];
[player prepareToPlay];
[player.view setFrame: self.view.bounds];  // player's frame must match parent's
[self.view addSubview: player.view];

[player play];

I've also tried adding player.movieSourceType = MPMovieSourceTypeStreaming; but didn't work neither.

Any thoughts?

Eric
  • 16,003
  • 15
  • 87
  • 139
  • MPMoviePlayerController for audio stream ??? – 0x8badf00d May 16 '12 at 18:40
  • From the first line of [MPMoviePlayerController's documentation](http://developer.apple.com/library/IOs/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html): "A movie player (of type MPMoviePlayerController) manages the playback of a movie from a file or a network stream." – Eric May 16 '12 at 19:36
  • But you are not playing movie, you said audio stream. Look at AVAudioPlayer if you want to play from file in memory. Since you want it streaming look at https://github.com/mattgallagher/AudioStreamer – 0x8badf00d May 16 '12 at 19:56
  • Wait, so there's a class to stream a movie but nothing to stream an audio file??? – Eric May 17 '12 at 02:42

0 Answers0