gpt4 book ai didi

iOS:MPMoviePlayerController 完成按钮不起作用

转载 作者:行者123 更新时间:2023-11-28 20:46:00 26 4
gpt4 key购买 nike

我正在将 MPMoviePlayerController 添加到 View 中,如下所示:

player = [[MPMoviePlayerController alloc] initWithContentURL:url];
player.controlStyle = MPMovieControlStyleNone;
[player.view setFrame:self.playerView.bounds];
[self.playerView addSubview:player.view];

self.playerView 是我主视图中的一个小 View ,我有自定义按钮来控制同一个主视图中的播放。这一切都很好。

我有一个像这样工作的全屏按钮:

- (IBAction) btnFullScreenPressed:(id)sender {
[player setFullscreen:TRUE animated:TRUE];
[player setControlStyle:MPMovieControlStyleFullscreen];
}

这工作正常,但是当我点击全屏控件上的完成按钮时,电影停止播放但没有返回到我 View 中较小的 self.playerView。我怎样才能让它“取消全屏”并返回到较小的 self.playerView?

谢谢。

最佳答案

很不直观,你实际上必须将控件样式设置为默认,即:

- (IBAction) btnFullScreenPressed:(id)sender {
[player setFullscreen:TRUE animated:TRUE];
[player setControlStyle:MPMovieControlStyleDefault];
}

当然,当您收到 MPMoviePlayerWillExitFullscreenNotification 或 MPMoviePlayerDidExitFullscreenNotification(我更喜欢“退出”)时,将其设置回无。

关于iOS:MPMoviePlayerController 完成按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6356696/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com