moviePlayerController.initialPlaybackTime = (int)(moviePlayerController.duration / slice ) * source.tag;
[movieView addSubview: moviePlayerController.view];
[[self view] addSubview:movieView];
[moviePlayerController play];
With click custom P开发者_如何学编程LAY button my self.view flips to movieView ... i see my made in XIB movieView, w/o video (
Thank you
Ok. my bad. my second View has been UIImageView and i did change to UIView.. if i insert
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:[self view]
cache:YES];
[UIView commitAnimations];
self.view = moviePlayerController.view;
[moviePlayerController stop];
[moviePlayerController play];
Then appear movie w/o FlipAnimation - switch beetwen mainView and movieView
if i'm insert [[self view] addSubview:movieView] then i'll look only created in XIB playerView ( linked to movieView ), but no see video, only hear audio. what a problem?
Just need use in init section:
[self.view insertSubview:startView atIndex:0];
[self.view insertSubview:videoView atIndex:1];
and in change action write this:
[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
and return to startView write again:
[self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:0];
like
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:0];
[UIView commitAnimations];
精彩评论