Utsav Dusad
Utsav Dusad

Reputation: 2199

Difference between AV Foundation framework and Media Player framework

Audio and video files can be played using AV Foundation framework and Media Player framework.

With Media Player framework, we can access the iPod library, and can find and play audio-based media items synced from iTunes on the desktop.

With AVFoundation, we can examine, create, edit, or reencode media files.

Upvotes: 3

Views: 4822

Answers (2)

akshay
akshay

Reputation: 775

Media Player framework:

This high-level framework provides easy access to a user’s iTunes library and support for playing tracks and playlists. Use this framework when you want to integrate audio into your app quickly and when you don’t need to control playback behavior.

AV Foundation:

AV Foundation is an Objective-C interface for managing the recording and playback of audio and video. Use this framework for recording audio and when you need fine-grained control over the audio playback process.

https://developer.apple.com/library/content/documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/MediaLayer/MediaLayer.html

Upvotes: 2

Ketan Parmar
Ketan Parmar

Reputation: 27448

When you want to much customization then it is better to use AVFoundation for example AVPlayer. You can totally customize player, audio, sessions etc. so, it is better to use AVPlayer instead of MPMoviePlayerController when lot's of customization requires.

MPMoviePlayerController are very easy to implements compare to AVPlayer.

MPMoviePlayerController: You have to set controlStyle to MPMovieControlStyleNone, set up Timer because currentPlaybackTime is not KVO compliance

AVPlayer: AVPlayer has no built in controls, but it has addPeriodicTimeObserverForInterval:queue:usingBlock: that makes handling the current time easily. The nicer thing about periodTimeObserver is that “The block is also invoked whenever time jumps and whenever playback starts or stops”

etc etc.

You can refer this document for more details and better understanding.

Hope this will help :)

Upvotes: 2

Related Questions