To what extent can the iOS Movie Player be customized and styled?

感情迁移 提交于 2019-12-21 05:33:13

问题


I am trying to accomplish something similar to the image below. That is, I would like to add a slide-out overlay navigation bar and other overlay functionality as well. In general I would also just like to know what kind customization is possible with the Movie Player. Specifically, can I add/remove buttons from the top bar, how would I add those dots to the playback bar? Thanks!

http://blog.howcast.com/wp-content/uploads/2010/06/ipad-video.png


回答1:


According to the MPMoviePlayerController class reference, "Consider a movie player view to be an opaque structure. You can add your own custom subviews to layer content on top of the movie but you must never modify any of its existing subviews."

So I would strongly recommend against trying to modify the existing top bar and instead set the controlStyle property to MPMovieControlStyleNone which completely hides all the default UI. Then, layer your own user interface views on top of the movie player's view. You'll have to re-implement some stuff, but the movie player controller exposes all its buttons' actions as methods (see the MPMediaPlayback protocol for play/pause/seeking/etc.) so this shouldn't be a big problem.



来源:https://stackoverflow.com/questions/6445291/to-what-extent-can-the-ios-movie-player-be-customized-and-styled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!