1. Unfortunately, `AVFoundation` is a typical closed-source Apple framework. 2. Yes, `AVPlayer` is free to use for developers. Apple pays for the necessary patent licenses and extends those licenses to include developers’ apps.
Hi, Sundus & welcome to devForums,
1. ~ 2. - Apple has Private (to them) and Public APIs. Devs are permitted to code against Public API only, according to the usage guidelines outlined in their Developer Program account agreement. One difference is whether or not an API is documented - Private are not, Public are.
AVPlayer is a multi-platform documented Public API, and as fumoboy007 notes, iOS devs are free to use it, in their App Store apps, the only cost being the USD$99 annual program fee.
Not sure there is an 'open source' context in this example, but I think I know why you included that reference.
>Are midrolls, postrolls and banner ads also supported?
There don't seem to be any ad break restrictions, if that's what you're asking, but specific implementation is on the dev, not by the API outright (tacit support from the API, I'd guess you'd call it) - example here:
>AVPlayer only supports iAds or it can play ads from any Adserver?
iAd is history. Ad content/payload on iOS, for some time now, is on the dev, meaning the API is otherwise agnostic. Can't confirm 'any' tho...