2010-04-27 84 views
7

我是iphone開發新手,我解析XML URL並在表格中顯示其內容,當我點擊一行時,其相應的解析管URL使用電影播放器​​播放。我正在使用媒體播放器框架。這裏是我的代碼如何在iPhone中使用「HTTP Live Streaming」播放視頻?

NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl]; 

if (movieURL) 
{ 
if ([movieURL scheme]) 
{ 
    MoviePlayerController *myMovie = [[MoviePlayerController alloc]init]; 

    [myMovie initAndPlayMovie:movieURL]; 

} 

} 

這工作正常,但我想播放視頻使用「HTTP直播流媒體」。我該怎麼做?任何教程和示例代碼都會對我更有幫助。謝謝。

+0

正如好奇心我添加另一個問題如何播放現場直播? – harshalb 2010-04-27 10:17:02

+0

@hib如果您將問題作爲新問題發佈,則有更多機會獲得答案。 – Warrior 2010-04-27 10:27:34

+0

你有沒有爲HTTP Live Streaming設置服務器端的一切工作? – Twelve47 2010-04-28 09:56:29

回答

1

使用的MPMoviePlayerController從服務器流式傳輸。

-(void)initAndPlayMovie:(NSURL *)movieURL 
{ 
    // Initialize a movie player object with the specified URL 
     MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; 
     if (mp) 
     { 
      [self.moviePlayer play]; 
     } 
} 
相關問題