AVPlayer 和 MPMoivePlayerController的区别
来源:互联网 发布:有关大数据的例子 编辑:程序博客网 时间:2024/04/30 14:30
AVPlayer:
AVPlayer
gives you a lot more flexibility but is pretty poorly documented. Using this API will force you to create your own UI. AVFoundation
(the framework that brings you AVPlayer
) generally is a bit hard on the user (coder) as it forces you to use Key-Value Observing a lot for checking states. The concept of KVO is great, do not get me wrong - still, for unexperienced developers it can be painful to learn. Apple sometimes omits the information on which properties are actually KVO compliant and that will force you to do some experimentation.
One big advantage of AVPlayer
over MPMoviePlayerController
would for example be its extended version, AVQueuePlayer
as that one is able to do gapless playback of multiple movie sources. Another advantage certainly is the feature rich AVFoundation
framework allowing you to do things like on-the-fly movie composition / encoding / converting.
Yet another huge advantage of AVPlayer
is the fact that you may actually play multiple video sources concurrently (e.g. side by side) without any problem.
MPMoviePlayerController
is easy to use and covers most needs out of the box. Using this API will give you a good looking and commonly understood UI. The UI however can be disabled and or replaced with a custom one.
For status changes, MPMoviePlayerController
uses a few NSNotifications
covering everything the regular App needs.
Under the hood, MPMoviePlayerController
builds on top of AVPlayer
- but that actually happens entirely transparent to the user - you have no access to that layer while using MPMoviePlayerController
.
MPMoviePlayerController
uses the underlaying AVPlayer
as a singleton instance, hence it is not possible to use multiple instances of MPMoviePlayerController
to play videos concurrently.
On the other hand, as soon as you are trying to extend the functionality of MPMoviePlayerController
with your own features, code quickly gets nasty - e.g. you will possibly start using multiple timers for covering things like a proper starve-detection (actually, that feature got included into iOS5's version of this class), custom UI updates, ... Or you may end up having more than a handful of state properties trying to cover things like gracefully aborting of the playback while the player is still pre-buffering.
- AVPlayer 和 MPMoivePlayerController的区别
- AVPlayer 播放在线视频和本地文件的设置区别
- AVPlayer 播放在线视频和本地文件的设置区别
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS中AVPlayer的在线播放和播放进度条,音量条以及AVPlayer的后台播放
- iOS中AVPlayer的在线播放和播放进度条,音量条以及AVPlayer的后台播放
- MediaPlayer 和 AVPlayer
- iOS的影片播放MediaPlayer 和avplayer的简单用法
- iOS ----iOS的影片播放 MediaPlayer 和 AVPlayer
- AVPlayer的使用
- AVPlayer的基本使用
- hdu 3709 Balanced Number 2010成都区域赛 数位dp
- ffmpeg for android error
- centos 6.6升级自带mysql版本文档
- 安装RPM套件rpm-build错误解决:NOKEY、elfutils is needed
- 一个由泛型和Auto Unbox引发的Crash
- AVPlayer 和 MPMoivePlayerController的区别
- 机器学习基石学习笔记3 VC Dimension(1)
- 解决Win10 Windows10关键错误 开始菜单和Cortana无法工作问题
- 1096. Consecutive Factors (20)
- 【剑指offer】面试题6:重建二叉树
- ipvsadm 安装配置
- win7 64位上VM虚拟机安装64位Ubuntu14.04.3
- 正则表达式匹配x相对
- 单例模式之内部静态类