将自定义控件添加到全屏电影 [英] Adding custom controls to a full screen movie

查看:84
本文介绍了将自定义控件添加到全屏电影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以向以全屏模式播放的电影添加自定义控件(使用MPMoviePlayerController)?我已经在一些流媒体应用程序中看到了这一点,并且很好奇它是如何完成的.

Is it possible to add custom controls to a movie playing in full-screen mode ( with MPMoviePlayerController )? I've seen this in a few streaming apps, and I'm curious how it is done.

推荐答案

您可以关闭播放器的标准控件,并创建自定义按钮来调用播放器上的播放,暂停等.如果将全屏设置为否",则可以使播放器以任意方式进行构图(全屏),然后在顶部放置自定义控件.

You can turn off the standard controls of the player and create custom buttons that call play, pause etc on the player. If you set fullscreen to NO, you can make the players frame whatever you want (fullscreen) and layer your custom controls on top.

类似的东西:

MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] init];
[mp setControlStyle:MPMovieControlStyleNone];
[mp setFullscreen:NO];
[[mp view] setFrame:CGRectMake(myX, myY, myWidth, myHeight)];

[myCustomController setMoviePlayer:mp];  // so controller can send control messages to mp

[myView addSubview:mp.view];
[myView addSubview:myCustomController.view];

或其他...

这篇关于将自定义控件添加到全屏电影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆