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 is.....no need to do al tht AVfoundation n all.....


CODE:

NSString *urlAddress = @"http://wsmp32.bbc.co.uk:80"; \*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];
 if(player){
        [player play];
}


Ask for any queries!

1 comment: