Search This Blog

Thursday, 2 August 2012

How to stream a radio through url in xcode

Hello friends,
                after so long i got time for our blog.....hehehe was working on xcode and here is the forst one for iPhone .How to stream a radio through url in xcode.It's simple as it need to do al tht AVfoundation n all.....


NSString *urlAddress = @""; \*this is for BBc News UK *\
NSURL *url = [NSURL URLWithString:urlAddress];

MPMoviePlayerController *player = [[MPMoviePlayerController alloc]initWithContentURL:url];

\*Remember you have to add MediaPlayer.framework to your project*\

player.movieSourceType = MPMovieSourceTypeStreaming;
        player.view.hidden = YES;
        [self.view addSubview:player.view];
        [player prepareToPlay];
        [player play];

Ask for any queries!

1 comment: