TLDR:
* Following the documentations and examples, there is no clear indication on how to approach this problem following best practices
Note:
* We have this already working using a different VAST compatible sdk but we want to switch to the IMA sdk but it looks we we won't be able to support our use very well
First off, is there anything in the below use case which this SDK will NOT be able to support?
Use case:
* Loading multiple ads inline in a UICollectionView via UICollectionViewCell
* Ads should be able to "auto" play/pause based on 50% viewabilty (we calculate this using the cell's position relative to the visible UICollectionView)
* You should be able to resume ads that have previously been paused ideally without any loading/buffering. ie. load collection view, scroll to first ad, let it play a little, scroll down to a second ad (first ad should pause when its 50% offscreen), let the second play a little, scroll up back to the first ad (second ad should pause when 50% offscreen), first ad should resume playback at the paused point....etc
* Ads should begin muted with the ability to unmute be tapping on a mute/unmute button
* Tapping on an ad should pause a playing ad/play a paused ad
* We have a server API which requests a feed to be displayed in a UICollectionView, it essentially will dictate in what positions we want to dynamically display ads
* Given a model with `impressionId` (string unique identifier,) and an `url` (string ad server url), we can uniquely track/log actions like autoplaying/pausing/manually pausing an ad, completing an ad, error logging and things like collapsing an ad cell upon error/completion, etc
Our current implementation essentially requests/caches media units where we just have to load them into a single instance of a player which just gets added as a subview in a UICollectionViewCell.
Using this sdk we encountered the following problems so far are:
1. Using the recommended single instance of `IMAAdsLoader`, in the `IMAAdsLoaderDelegate` `func adsLoader(_ loader: IMAAdsLoader!, adsLoadedWith adsLoadedData: IMAAdsLoadedData!) {}` callback, we have no way to identify which ad was loaded. In our use case; we load our feed, scroll down enough to view 2 ads, we make 2 requests, but perhaps ad 2 finishes loading before ad 1. We would like to use our `impressionId` to uniquely track which ad has loaded but theres no way to know
2. Same problem as above but for the error case, out 2 `IMAAdsRequest`, which one failed?
I have a feeling if we created a class which has our `impressionId` and its own instance of `IMAAdsLoader` and conform to the `IMAAdsLoaderDelegate`, we could handle our use case except that it goes against the best practice of having a single loader app wide loader. This way we can uniquely track/log each individual loading of ads.
I have several follow up questions but I just wanted to start this thread off to see if I can get any responses on this.
Thanks!