2010-05-14 49 views

回答

0

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]; 
     } 
    } 
} 

你可以试试任何你想要的按钮动作。 并在appdelegate中为玩家指定所有方法。

+0

是的,这是对的,但我想解析它,并希望得到个人网址.... 你有什么想法,然后请帮助我:) – jaynaiphone 2010-05-14 13:17:08

+0

我认为一个.pls文件实际上只是一个xml文件,其中包含一个广播电台的不同流网址。因此,您应该能够使用NSDictionary打开它,并使用'objectForKey:'将不同键的值发送到处理实际播放流的对象。 – Pripyat 2010-05-14 16:09:48