-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why Exoplayer downloads content manifest before pre-roll manifest? #1358
Comments
Thanks for your questions!
As far as I see, the content media, ads loader and ad media are all prepared in parallel. Just by the way the code is structured, you probably see the content manifest load being triggered just before the ads loader init, but both are executed in parallel. Playback can start if the the AdsLoader returned the Overall, this looks like the most efficient way of loading the required data for playback (everything in parallel + start playback as soon as data for first element is available). Does that match your observations too and if not, could you suggest in more detail what you would like to change or where the delay is coming from in your set up?
If you know the ad manifest URL, you can use caching to download the segments in advance. See https://developer.android.com/media/media3/exoplayer/downloading-media for more details (you probably don't need a Service if you trigger downloads ion background while your app has a Activity). On a lower level, you can also use |
@tonihei thanks for the explanation.
I understand maybe due to actual code structure the content manifest loading is triggered first. Is it because same thread is used to load the Ads manifest? In that case, is there any way I can change the order? Basically with pre-roll I think the Content manifest request is unnecessary before start playing the ads. So in slower network cases, it is delaying or slowing down the ads manifest request and hence increasing the overall startup time. |
I can see both content loading and ads loader preparation happening in parallel. Could you check that your throttling is just done in a If you are using IMA, you may also find that the extension itself waits for the content manifest before loading ads data as it needs to know the content start position before the IMA SDK asks to load an ad. Given you use your own ads loader, could you check that it returns an |
@tonihei I did not understand it fully. I routing the network calls from phone through PC. I am running Charles tool on PC and doing the throttling only to content master manifest URL.
Can you give more info on what do you mean by |
Thanks for explaining this again. I think this part might be the main area for improvement. I was testing with progressive content media before which has no manifest to load, so I didn't notice this part. I'll see whether we can let the ads source prepare while the main manifest is still loading to speed it up slightly.
One further note: we need to wait for the initial content manifest to generate the right media structure, for example to know when exactly media start playing in live streams. |
This means the content source is 'prepared' instantly with a placeholder, enabling all further preparation steps (e.g. loading preroll ads) while the actual content is still preparing. This improvement can speed up the start time for prerolls in manifest-based content that doesn't have a zero-time preparation step like progressive media. Issue: #1358 PiperOrigin-RevId: 633640746
Yes, it should work to load both content and preroll ad in parallel now. The change will be in Media3 1.4.0. I assume 2.16.1 refers to an old ExoPlayer version? We are no longer updating the ExoPlayer repository with new releases. |
We are using Exoplayer 2.16.1 in our application. We are seeing video startup time is high with pre-roll ads and we are checking different options to reduce it.
Our application is using custom ads loader but the implementation sequence is similar to IMA Ads loader.
We are doing the
CustomAdsLoader.requestAds()
before theplayer.prepare()
as recommended in different Exoplayer threads. So we have the ads URL while making theplayer.prepare()
call.We noticed that once the
player.prepare()
call is made,AdsLoader.start(AdsMediaSource adsMediaSource, DataSpec adTagDataSpec, Object adsId, AdViewProvider adViewProvider, EventListener eventListener)
The
CustomAdsLoader
can provide the ad URLs to Exoplayer using theeventListener.onAdPlaybackState(adPlaybackState)
only after theAdsLoader.start()
call from Exoplayer.We think this is causing some playback delay.
So my questions are,
AdsLoader.start()
whenAdsMediaSource
is used?I checked these questions, did not get answer to my questions:
The text was updated successfully, but these errors were encountered: