![]() ![]() This allows your users to manage all of their downloads in one place in the Settings app.Īnd of course, the downloadTask can be configured with multiple content configurations. The asset name and image are displayed in the Settings app. It is created with an AVURLAsset and needs an asset name, and optionally, an image. This is the root which holds everything together. ![]() These multiple content configurations are tied together by the download configuration interface. You can create multiple of these content configurations and provide it to the downloadTask. We also have a set of media selections representing English and French audio, and English subtitle renditions.īoth of these can be used to create a content configuration object. It informs AVFoundation to prefer HDR variants under five megabits. Here is the variant qualifier which combines the two predicates we saw earlier. Once you have your variant qualifier, you use it to create something called as content configuration.Įach content configuration represents a set of video, audio, and subtitle renditions. You can look them up in our header doc for variant qualifier. You can also combine multiple predicates to create a compound predicate and use them to create your variant qualifier.Īny property on variant can be used to create a predicate against.įor properties such as audio channel count, which cannot be easily expressed using the predicate format string, we have custom constructors. Here we create an NSPredicate for HDR video range.Īnd similarly as before, you can construct a variant qualifier for it. Simple enough, right? Let’s take a look at another example. You use this to construct your variant qualifier, which instructs AVFoundation to prefer variants under five megabits. ![]() Here, we have a NSPredicate which expresses peak bitrate to be less than five megabits. Let’s understand by looking at few examples. This interface allows you to specify your variant preferences to AVFoundation.Īnd, as I said, they can be constructed using NSPredicates. So to get started, let me introduce the variant qualifier interface. If not, don’t worry, you will learn about them today. You may be already familiar with using predicates from Core Data. In iOS 15, we are expanding the variant selection with the use of NSPredicates. We had an option for HDR, an option for lossless audio, and a few other attributes. This may be due to business requirements, or you just want to provide more choice to your users.īefore, you could provide such input via downloadTask options. Typically, you would like to influence the HLS variants selected for the download. In iOS 15, we are taking our HLS download APIs and making them even more powerful. If you're not familiar with HLS download APIs, I would suggest you check out our earlier talk on the topic from WWDC 2020. Let's see how we can use them with downloads.ĭownloading HLS content for offline playback has been supported since 2016. Now you know how to inspect HLS variants in AVFoundation. They are called as VideoAttributes and AudioAttributes, respectively.Īs you see, each of them has relevant properties, which you can use to understand your asset. Other attributes, such as those related to video and audio renditions, are grouped together in their own subclasses. Some of the attributes, such as the media bitrate, can be accessed directly. So it has multiple properties representing different media attributes. This AVAssetVariant, as we see here, represents an HLS variant as is from the master playlist. Later on, you can obtain the HLS playlist via the variant's property. Now in iOS 15, you can directly inspect the HLS playlist to infer them.įor that, you start with an AVURLAsset pointing to the location of your master playlist. ![]() Looking closely, you see that the asset has 4K, Dolby Vision, and Dolby Atmos badges.Įarlier, you had to get such information out of the band. The asset representing this particular playlist may be presented something like this in your app. One of the variants is an SDR variant with stereo audio, and the other one is a Dolby Vision variant with Dolby Atmos audio. In this particular playlist, we have two variants. You all must be familiar with what a typical master playlist looks like. Today, we will be looking at HLS Variants.įirst, we will look at how you can inspect HLS variants, using AVFoundation APIs, and later on, we will see how we can use the HLS variants with downloads. My name is Nishant, and I’m an engineer on the AVFoundation team. ♪ Bass music playing ♪ Nishant Nelogal: Hello, and welcome to WWDC. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |