xcode - iPhone App Crashes When trying to play video -
i'm trying simple view based app play video, crashes, heres code,
- (ibaction)playbutton:(id)sender { nsstring *stringpath = [[nsbundle mainbundle] pathforresource:@"1" oftype:@"mov"]; nsurl *url = [nsurl fileurlwithpath:stringpath]; mpc = [[mpmovieplayercontroller alloc]initwithcontenturl:url]; [mpc setmoviesourcetype:mpmoviesourcetypefile]; [[self view]addsubview:mpc.view]; [mpc setfullscreen:yes]; [mpc play]; } @end
and here takes me in xcode when fails
// // main.m // video_play // // created nathaniel harman on 20/04/2013. // copyright (c) 2013 machupicchumobile. rights reserved. // #import <uikit/uikit.h> #import "videoplayappdelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return uiapplicationmain(argc, argv, nil, nsstringfromclass([videoplayappdelegate class])); } }
try ,
nsstring *audio=[[nsbundle mainbundle]pathforresource:@"1" oftype:@"mov"]; nsurl *url=[[nsurl alloc]initfileurlwithpath:audio];
Comments
Post a Comment