AVPlayer and MPMoviePlayerController differences
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
MPMoviePlayerController and AVPlayer both play media, but they belong to different eras of iOS development. MPMoviePlayerController was the older high-level playback controller, while AVPlayer is the modern playback engine in AVFoundation.
For current development, the real comparison is usually not MPMoviePlayerController versus AVPlayer alone. It is MPMoviePlayerController versus AVPlayer plus either your own UI or AVPlayerViewController from AVKit.
The Biggest Difference: Status and Direction
The most important difference is architectural and historical:
- '
MPMoviePlayerControllerwas a ready-made player UI with limited flexibility' - '
AVPlayeris a lower-level playback object with much more control' - '
MPMoviePlayerControlleris deprecated and should not be used for new code'
So if you are maintaining old code, you may still see MPMoviePlayerController. If you are writing new code, you should be using AVFoundation-based APIs.
MPMoviePlayerController Was the Easy Old Wrapper
MPMoviePlayerController handled playback and bundled a built-in media UI. That made it convenient when you wanted something quick and standard, but it also limited customization and tied your architecture closely to an older API design.
That convenience was its strength and its long-term weakness. Once you needed more control over playback state, composition, custom overlays, or integration with newer media features, the old API became restrictive.
AVPlayer Is the Modern Playback Engine
AVPlayer focuses on playback logic rather than prebuilt controls. It works with AVPlayerItem, AVAsset, and other AVFoundation pieces and gives you much finer control over media behavior.
A minimal example looks like this:
This is powerful, but on its own it does not give you a full playback UI. That is why many apps pair it with AVPlayerLayer or AVPlayerViewController.
If You Want Built-In Controls, Use AVPlayerViewController
The closest modern replacement for the old "player plus controls" experience is AVPlayerViewController:
This gives you a modern system playback UI without going back to deprecated APIs.
Control and Customization
This is where AVPlayer clearly wins.
With AVFoundation, you can:
- observe playback status and buffering state
- seek precisely
- manage player items and assets directly
- build a custom playback UI
- integrate with broader media frameworks more naturally
That flexibility is the main reason Apple moved developers toward AVFoundation.
By contrast, MPMoviePlayerController was simpler to drop in, but you got much less control over how the player fit into the rest of the app.
Streaming and Modern Media Workflows
For HTTP Live Streaming and other modern Apple media workflows, AVFoundation is the correct foundation. It is the actively supported path and integrates better with current platform behavior.
That does not mean AVPlayer is always simpler. It often requires more structure because you are assembling the playback system more explicitly. But that extra structure is exactly what makes it more capable.
Migration Mindset
If you are replacing old MPMoviePlayerController code, do not try to find a one-line equivalent and assume the API model stayed the same. Instead:
- move playback responsibility to
AVPlayer - use
AVPlayerViewControllerif you want standard controls - use
AVPlayerLayeror a custom UI if you need full control
That gives you a cleaner migration path than trying to imitate the old controller API exactly.
Common Pitfalls
The biggest pitfall is thinking AVPlayer and MPMoviePlayerController are direct drop-in equivalents. They are not. One is a playback engine, and the other was an older controller-style wrapper.
Another common mistake is using AVPlayer and then wondering where the controls went. AVPlayer does not provide a full standard UI by itself.
Developers also sometimes keep MPMoviePlayerController in new code because it feels easier. That creates technical debt immediately because the API is deprecated.
Finally, do not forget the modern replacement pattern. If you liked the convenience of the old controller, AVPlayerViewController is usually what you actually want.
Summary
- '
MPMoviePlayerControlleris the older deprecated media playback controller.' - '
AVPlayeris the modern AVFoundation playback engine.' - '
AVPlayergives much more control, but it does not provide a full playback UI by itself.' - If you want built-in controls in modern iOS code, use
AVPlayerViewControllerwithAVPlayer. - For new projects, choose the AVFoundation path rather than the deprecated movie player controller.
Related reading
- back button callback in navigationController in iOS
- Background image jumps when address bar hides iOS/Android/Mobile Chrome
- Background task, progress dialog, orientation change - is there any 100 working solution?
- Base64 Decoding in iOS 7
- Base64 Decoding in iOS 7
- Basic Drag and Drop in iOS
- Basic example for sharing text or image with UIActivityViewController in Swift
- Basic example for sharing text or image with UIActivityViewController in Swift
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.