Adding video to an iPhone application -
how add video iphone app. using iphone sdk 3.2.5? dont see actual video can hear playing.
here code:
-(void) viewdidload{ nsbundle *bundle=[nsbundle mainbundle]; nsstring *moviepath = [bundle pathforresource:@"facebook" oftype:@"mp4"]; nsurl *movieurl=[[nsurl fileurlwithpath:moviepath] retain]; mpmovieplayercontroller *themovie = [[mpmovieplayercontroller alloc] initwithcontenturl:movieurl]; themovie.scalingmode = mpmoviescalingmodeaspectfill; [themovie play]; [super viewdidload]; }
you need set frame mpmovieplayercontroller , add view:
themovie.view.frame = cgrectmake(0.0, 0.0, 320.0, 480.0); [self.view addsubview:themovie.view];
Comments
Post a Comment