开发者

MPMoviePlayerController showing up late with http url request

开发者 https://www.devze.com 2023-01-24 22:27 出处:网络
I\'m developing an iPad app with 4.1 and deployment-target 3.2. I have a UITableViewController which adds a new View to the main view if a row becomes selected.

I'm developing an iPad app with 4.1 and deployment-target 3.2.

I have a UITableViewController which adds a new View to the main view if a row becomes selected.

In the UIViewController of the new view I've following code in the viewDidLoad method:

- (void)viewDidLoad 
{
 MPMoviePlayerController* player = [[MPMoviePlayerController alloc] initWithContentURL:movieurl];
 [[self.view viewWithTag:1] addSubview:player.view]; 开发者_StackOverflow   

 player.view.frame = CGRectMake(0, 0, 512, 289);
 [player play];

 [super viewDidLoad];
}

movieurl is an URL with a http address of our CDN.

the viewWithTag:1 is a simple standard UIView with the same frame like the player.

Now, if I click on the tablerow, the new view appears with the subview (with tag 1) in it.

And the player is not showing up. After some time, when the movie is ready to play, the movieplayer shows up like wanted and starts playing the movie.

The movieplayer works fine, it only appears really lately.

Is there any way to show the movieplayer directly on the view? Just before the movie has finished preloading. The player can be in a loadingstate or something like this.

The mainpoint is, that the player shows up from beginning, so there's no empty space in the view.

Thank you for your help!


I have the same question and a comment that before I upgraded to the most recent XCode that forced me to use 4.2 as base SDK this was working fine for me. I had 4.1 iPhone and the player showed up immediately with Movie Loading... label ...

This is no longer the case after upgrade and 4.2 base sdk selection even with 3.2 as target.

0

精彩评论

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

关注公众号