开发者

I have 2 UIView: 1st is self.view and movieView( maked in XIB ). I can't see video in this UIView, only audio track

开发者 https://www.devze.com 2023-04-06 02:35 出处:网络
moviePlayerController.initialPlaybackTime = (int)(moviePlayerController.duration / slice ) * source.tag;
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];
0

精彩评论

暂无评论...
验证码 换一张
取 消