Error Playing video from server with MPMoviePlayerController

Posted by skiria on Stack Overflow See other posts from Stack Overflow or by skiria
Published on 2010-05-11T23:19:28Z Indexed on 2010/05/11 23:24 UTC
Read the original article Hit count: 416

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;
    {
        NSLog(@"URLVIDEO %@", aVideo.urlVideo);
        MPMoviePlayerController *VideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:aVideo.urlVideo]];
        [VideoPlayer play];  
    }

//Error on con console

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Content URL must not be nil.'

aVideo.urlVideo is a NSString and it's correct when I copy the result on the NSLog on the browser.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa-touch