I try to play a video on the server with this code. I have a error.
//Play the video from server
- (IBAction)playVideo:(id)sender;
{
NNSURL *url = [[NSURL alloc]initWithString: aVideo.urlVideo];
NSLog(@"URLVIDEO %@", url);
MPMoviePlayerController *VideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL: url];
[VideoPlayer play];
}
//Console
URLVIDEO http://147.83.74.180/videos/low/ElTemps-index.m3u8
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Content URL must not be nil.'
aVideo.urlVideo is defined on the Video class and it gets a value when I parse an xml file
//Video.h
NSString urlVideo;
//XMLParser.m
[aVideo setValue:currentElementValue forKey:elementName]; //here i add the string
If I do this I can play the video:
NSString *videoURL = @"http://147.83.74.180/videos/low/ElTemps-index.m3u8";
MPMoviePlayerController *VideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:videoURL]];