A way to retain MPMoviePlayerController.view subviews?
Is there no way to enable MPMoviePlayerController's view to retain its subviews when entering fullscreen mode?
When you add subviews to the MPMoviePlayerController.view property when the video isn't playing full screen, all is good, the views display as expected. However, when you tap the fullscreen button, they disappear.
When leaving fullscreen mode they animate back in just fine, but if you're adding content relevant 开发者_运维技巧to the video using HTTPLiveStreaming it's not a great user experience losing it all when wanting full screen.
I've experimented with NSNotifications on MPMoviePlayerDidEnterFullscreenNotification to add the views once more when entering full screen, but to no avail, they just don't appear.
The only other solution I can think of is faking full screen by rolling my own playback controls with new full screen button & method and also trying to override the full screen pinch gesture recognizer that exists with the MPMoviePlayerConroller.view
Unless there's something I've missed / a better idea?
Thanks all.
The fullscreen-mode is not using MPMoviePlayerController.view
.
Use this snippet to get the view you can add your subviews to when using MPMoviePlayerController
in fullscreen-mode;
UIWindow *window = [UIApplication sharedApplication].keyWindow;
if (!window)
{
window = [[UIApplication sharedApplication].windows objectAtIndex:0];
}
view = [[window subviews] objectAtIndex:0];
精彩评论