MPMoviePlayerController *player
= [[MPMoviePlayerController alloc] initWithContentURL:video_url];
[[player view] setFrame : [ib_image_base_view bounds]];
[ib_image_base_view addSubview : [player view]];
[player play];
Above are the 5 statements I am using to play a video file. The video_url has value :
“Intro_00.mp4 — file://localhost/” as echoed by a NSLog statement. Its value is initialized as : video_url = [NSURL fileURLWithPath: @”Intro_00.mp4″];
The problem is the MoviePlayer is not having any response, there is no error or warning message from Xcode either. The 5 lines of code are part of an iPhone project.
Hope somebody can give some hints.
(*** for some reasons stackoverflow’s “add comment” does not work at the moment)
Comments are added below …
Have tried the following as suggested, but still no response.
[player setControlStyle: MPMovieControlStyleEmbedded];
Update 1 :
Have found out that the video_url is “null” all along. So I find and download a related sample project from Apple. But the same problem seems to persist. For details please refer to here.
Update 2 :
@Eduardo has found the solution to both questions. So this question should be closed. Thanks for the kind assistance and response from all who have look into my post 🙂
Use
[[NSBundle mainBundle] pathForResource:"Intro_00.mp4"]and remember to add the file to the bundle (Project Build Steps > Copy Resources)