このコードを使用して、サーバーでビデオを再生しようとしています。エラーがあります。
//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];
}
//コンソール
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 は Video クラスで定義されており、xml ファイルを解析すると値が取得されます
//Video.h
NSString urlVideo;
//XMLParser.m
[aVideo setValue:currentElementValue forKey:elementName]; //here i add the string
これを行うと、ビデオを再生できます。
NSString *videoURL = @"http://147.83.74.180/videos/low/ElTemps-index.m3u8";
MPMoviePlayerController *VideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:videoURL]];