- (void) playerWithUrl:(NSURL *)url{
// http://player.youku.com/embed/XNzA4NjE1MTQ4 //從優酷上取到的地址;要轉化成下面的格式(m3u8)才能播放;
NSURL *movieUrl = [NSURL URLWithString:@"http://v.youku.com/player/getRealM3U8/vid/XNzA4NjE1MTQ4/type/video.m3u8"];
mpMoviePlayerC= [[MPMoviePlayerViewController alloc] initWithContentURL: movieUrl];
[mpMoviePlayerC.view setFrame: self.view.bounds]; // player's frame must match parent'
[self presentViewController:mpMoviePlayerC animated:YES completion:nil];
[mpMoviePlayerC.moviePlayer play];}
MPMoviePlayerViewController播放優酷視頻
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.