Skip to content
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

[Issue #10685] Do not send content complete if any midroll is skipped #10618

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1122,12 +1122,17 @@ private void handleAdPrepareError(int adGroupIndex, int adIndexInAdGroup, Except
}

private void ensureSentContentCompleteIfAtEndOfStream() {
if (!sentContentComplete
&& contentDurationMs != C.TIME_UNSET
&& pendingContentPositionMs == C.TIME_UNSET
&& getContentPeriodPositionMs(checkNotNull(player), timeline, period)
+ THRESHOLD_END_OF_CONTENT_MS
>= contentDurationMs) {

if (sentContentComplete
|| contentDurationMs == C.TIME_UNSET
|| pendingContentPositionMs != C.TIME_UNSET) {
return;
}

long contentPeriodPositionMs = getContentPeriodPositionMs(checkNotNull(player), timeline, period);
int pendingAdGroupIndex = adPlaybackState.getAdGroupIndexAfterPositionUs(contentPeriodPositionMs, contentDurationMs);
vishnuchilakala marked this conversation as resolved.
Show resolved Hide resolved
if (!adPlaybackState.getAdGroup(pendingAdGroupIndex).shouldPlayAdGroup()
&& contentPeriodPositionMs + THRESHOLD_END_OF_CONTENT_MS >= contentDurationMs) {
sendContentComplete();
}
}
Expand Down