开发者

MPMoviePlayerController - play fullscreen

开发者 https://www.devze.com 2023-04-10 23:37 出处:网络
Starting with this code: MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieLink];

Starting with this code:

MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieLink];

The next thing I need to do is set the player's frame and add its view as a subview. But I want it to go immediately to fullscreen, and I want it to be on top of everything else. What is the best way to do that?

If I do something like this:

[self.view addSubview:player.view];

The player does a weird resizing thing, then jumps to fullscreen. I know this is the last step:

[player setFullscreen:YES animated:NO];

But where can I add the player's view so that I don't see any weird开发者_运维问答 clipping or resizing? Do I use [UIScreen mainScreen] somehow? Or access the main window of the app?

0

精彩评论

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

关注公众号