Commit fe2b01c5 by andrewlewis Committed by Oliver Woodman

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
parent 1c140603
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment