Skip to content

Commit

Permalink
Do not send content complete if any midroll is skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuchilakala committed Oct 18, 2022
1 parent ab4d37f commit cc37f3a
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -1122,9 +1122,15 @@ private void handleAdPrepareError(int adGroupIndex, int adIndexInAdGroup, Except
}

private void ensureSentContentCompleteIfAtEndOfStream() {
if (player == null) {
return;
}

int pendingAdGroupIndex = adPlaybackState.getAdGroupIndexAfterPositionUs(player.getContentPosition(), player.getContentDuration());
if (!sentContentComplete
&& contentDurationMs != C.TIME_UNSET
&& pendingContentPositionMs == C.TIME_UNSET
&& !((adPlaybackState).getAdGroup(pendingAdGroupIndex).shouldPlayAdGroup())
&& getContentPeriodPositionMs(checkNotNull(player), timeline, period)
+ THRESHOLD_END_OF_CONTENT_MS
>= contentDurationMs) {
Expand Down

0 comments on commit cc37f3a

Please sign in to comment.