我在我的應用程序中有一個帶有許多選項卡的選項卡視圖,並且在其中一個選項卡中有一個按鈕,單擊時我想在視圖中顯示電影流。我有這樣的代碼:在另一個視圖中打開電影流
NSString *moviePath = @"http://10.0.0.4/prog_index.m3u8";
theMovie = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:moviePath]];
[theMovie.view setFrame:CGRectMake(0, 0, (self.view.frame.size.width), (self.view.frame.size.height))];
theMovie.view.backgroundColor = [UIColor grayColor];
theMovie.view.tag = 9999;
[self.view addSubview:[theMovie view]];
[theMovie play];
該視圖出現,但視頻無法啓動。哪裏不對?有人可以提供一些提示嗎?
感謝
但是在相關問題中,他說我可以播放播放列表文件,MPMoviePlayerController可以播放其他文件。 –
你是對的,我完全錯了,我試圖找出你的代碼有什麼問題 – ender
我編輯了我的anser,看一看 – ender