gpt4 book ai didi

ios - 一种保留 MPMoviePlayerController.view subview 的方法?

转载 作者:行者123 更新时间:2023-12-01 17:01:22 25 4
gpt4 key购买 nike

有没有办法让 MPMoviePlayerController 的 View 在进入全屏模式时保留其 subview ?

当您在视频未全屏播放时将 subview 添加到 MPMoviePlayerController.view 属性时,一切都很好, View 按预期显示。但是,当您点击全屏按钮时,它们会消失。

离开全屏模式时,它们的动画效果很好,但如果您使用 HTTPLiveStreaming 添加与视频相关的内容,那么在想要全屏时失去所有内容并不是一个很好的用户体验。

我已经在 MPMoviePlayerDidEnterFullscreenNotification 上尝试了 NSNotifications,以便在进入全屏时再次添加 View ,但无济于事,它们只是没有出现。

我能想到的唯一其他解决方案是通过使用新的全屏按钮和方法滚动我自己的播放控件来伪造全屏,并尝试覆盖 MPMoviePlayerConroller.view 中存在的全屏捏合手势识别器

除非我错过了什么/更好的主意?

谢谢大家。

最佳答案

全屏模式是不是 使用 MPMoviePlayerController.view .

在使用 MPMoviePlayerController 时,使用此代码段获取可以添加 subview 的 View 在全屏模式下;

UIWindow *window = [UIApplication sharedApplication].keyWindow;
if (!window)
{
window = [[UIApplication sharedApplication].windows objectAtIndex:0];
}
view = [[window subviews] objectAtIndex:0];

关于ios - 一种保留 MPMoviePlayerController.view subview 的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6596625/

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