Hi I want to play pls file from iphone application. The url for that is "http://yp.shoutcast.com/sbin/tunein-station.pls?id=4512", Please help me how can I play this file from iphone application. Thanks in advance.
A:
NSString *url = @"http://yp.shoutcast.com/sbin/tunein-station.pls?id=4512";
if (url != nil)
{
NSURL *movieURL = [NSURL URLWithString:url];
if (movieURL)
{
if ([movieURL scheme]) // sanity check on the URL
{
yourapplicationnameAppDelegate *appDelegate = (yourapplicationnameAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate initAndPlayMovie:movieURL];
}
}
}
You can try it on any button action where u want. and in appdelegate u specify all the methods for player.
Arun Sharma
2010-05-14 12:30:25
Yes that is right but I want to parse it actually and want to get the individual urls....Do you have any idea about it, then please help me :)
jaynaiphone
2010-05-14 13:17:08
i think that a .pls file is actually just a xml file with different stream URLs for a radio stations in it. Therefore you should be able to open it using NSDictionary and send the values for the different keys to the object that handles the actual playing of the stream using 'objectForKey:'.
David Schiefer
2010-05-14 16:09:48