- (void)viewDidLoad
{
[super viewDidLoad];
MPMoviePlayerController *player;
NSLog(@"%@",gotVideo);
NSURL *urlString=[NSURL URLWithString:gotVideo];
player = [[MPMoviePlayerController alloc] initWithContentURL:urlString];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
//---play movie---
[player play];
}
- (void) movieFinishedCallback:(NSNotification*) aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
}
在iOS 7.1模擬器中,視頻未播放。請提供任何建議。從url播放視頻
試了一下在真實設備上? –
NSLog(@「%@」,gotVideo); - 在這個地方你得到的網址 –
正如SergiusGee建議嘗試在設備上。這些移動模擬器在獲取在線資源時經常遇到問題。在android模擬器上最顯着的觀察! – MABVT