Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS App: playing mp4 file from mainBundle crashes
    primarykey
    data
    text
    <p>I am trying to play test.mp4 from inside my App, but it crashes with the following error:</p> <pre><code>2013-06-28 15:02:40.931 framing[9617:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' *** First throw call stack: (0x1a5f012 0x176ce7e 0x1a5edeb 0x11839b1 0x118393b 0x28c2 0x1780705 0x6b42c0 0x6b4258 0x775021 0x77557f 0x7746e8 0x6e3cef 0x6e3f02 0x6c1d4a 0x6b3698 0x2ac1df9 0x2ac1ad0 0x19d4bf5 0x19d4962 0x1a05bb6 0x1a04f44 0x1a04e1b 0x2ac07e3 0x2ac0668 0x6b0ffc 0x223d 0x2165) libc++abi.dylib: terminate called throwing an exception (lldb) </code></pre> <p>The following are the codes:</p> <pre><code>#import "ViewController.h" #import &lt;QuartzCore/QuartzCore.h&gt; #import &lt;AVFoundation/AVFoundation.h&gt; #import &lt;MediaPlayer/MediaPlayer.h&gt; @implementation ViewController @synthesize moviePlayer,movieScreen,viewVideoTitleBg; -(IBAction)playTheMovie { NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mp4"]; moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL fileURLWithPath:path]]; //[self presentMoviePlayerViewControllerAnimated:moviePlayer]; moviePlayer.controlStyle = MPMovieControlStyleDefault; moviePlayer.shouldAutoplay = YES; moviePlayer.view.frame = CGRectMake(64,192,895,415); [self.view addSubview:moviePlayer.view]; //[moviePlayer setFullscreen:NO animated:YES]; [moviePlayer play]; } </code></pre> <p>I have got the Frameworks installed too.</p> <p>What is wrong with my code?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload