So, I got a warning window in my application, and when I click the watch video button, the video should play, but nothing happens in the simulator. I do not want to check this on the device until I get it in the simulator. This is the code below, as far as I can tell, it should work. It reaches the log statement and displays it on the console, but the video does not play. Any ideas?
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex{
if (buttonIndex == 1) {
NSURL *url = [NSURL URLWithString:@"http://srowley.co.uk/endyVid.mp4"];
MPMoviePlayerController *player = [[[MPMoviePlayerController alloc] initWithContentURL:url] autorelease];
[player setFullscreen:YES];
[self.view addSubview:[player view]];
NSLog(@"Player Should play!");
[player play];
}
}
source
share