• 0

iOS Play Stream


Question

As I said in another post I am currently learning Objective-C and have got quite far with it, but having some trouble trying to play a radio stream this is what I have

MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://127.0.0.1:8000"]];
	player.shouldAutoplay = false;
	player.movieSourceType = MPMovieSourceTypeStreaming;
	[player prepareToPlay];
	[player play];

It will play, but then stop playing after 2 - 3 seconds about not enough buffered and not able to keep up. Any ideas what I am doing wrong or how I "pre-buffer" before playing so it can keep up with the stream?

Thanks!

EDIT: Figured it out using the AudioToolKit and the AVPlayer and AVPlayerItem classes that apple provide which also allows background playing when the app is quit!

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.