ios - ShouldAutoplay on MoviePlayerController -
i new developer, therefore i'm still learning , know i'm doing things wrong. have segmented control object in when user presses 1 of segments, goes play video. have setup press segment, have press play button video play. want cut out play button , have play automatically. i'm having trouble. found shouldautoplay option when use , cut out button, won't take me video @ all. i'm sure i'm not using shouldautoplay option correctly. hoping or @ least point in right direction.
- (ibaction)playmovie:(id)sender; { nsbundle *bundle = [nsbundle mainbundle]; nsstring *moviepath = [bundle pathforresource:@"mytestimony" oftype:@"m4v"]; nsurl *movieurl = [[nsurl fileurlwithpath:moviepath] retain]; mpmovieplayercontroller *themovie = [[mpmovieplayercontroller alloc] initwithcontenturl:movieurl]; themovie.shouldautoplay = yes; themovie.scalingmode = mpmoviescalingmodeaspectfill; [themovie autorelease]; mpmovieplayerviewcontroller *movieplayer = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:movieurl]; [self presentmovieplayerviewcontrolleranimated:movieplayer]; }
have tried [themovie play];
?
update: noticed set shouldautoplay
in themovie
, presented instance of mpmovieplayerviewcontroller
, movieplayer
. that's why movie did not autoplay. should instead have:
[self presentmovieplayerviewcontrolleranimated:themovie];
Comments
Post a Comment