mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix content progress reporting if there is no preroll
If there was no preroll and the pending content position was set before the first midroll, the pending content position was never cleared so loading the ad was never triggered. Only set a pending content position if we know that we need to trigger playing an ad for the current position and IMA will poll for an ad (because there is a midroll ad group). Clearing the pending content position happens when IMA pauses content to play the ad. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185818315
This commit is contained in:
parent
1c140603d4
commit
fe2b01c57e
@ -889,8 +889,8 @@ public final class ImaAdsLoader extends Player.DefaultEventListener implements A
|
||||
podIndexOffset = adGroupIndexForPosition - 1;
|
||||
}
|
||||
|
||||
if (hasMidrollAdGroups(adGroupTimesUs)) {
|
||||
// IMA will poll the content position, so provide the player's initial position like a seek.
|
||||
if (adGroupIndexForPosition != C.INDEX_UNSET && hasMidrollAdGroups(adGroupTimesUs)) {
|
||||
// Provide the player's initial position to trigger loading and playing the ad.
|
||||
pendingContentPositionMs = contentPositionMs;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user