ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Do not send content complete if any midroll is skipped

Open vishnuchilakala opened this issue 2 years ago • 1 comments

Let Google IMA SDK handle the event if the user seeks to the very end of the content and skips any midrolls.

This fix will ensure that Exoplayer will behave the same way as the Google IMA sample application. i.e. Play the midroll before sending content complete / playing post roll.

vishnuchilakala avatar Sep 14 '22 08:09 vishnuchilakala

@marcbaechinger Can you please take a look and let me know what you think? Thanks.

To summarise the issue: Both the IMA Sample application and Exoplayer play the last of the skipped mid-rolls if the user seeks to any point in the duration of the playback. But if the user seeks directly to the very end of the duration of the playback, Exoplayer immediately is triggering the content complete event which can stop the playback of the last of the skipped mid-rolls if Google IMA wants to play it (Which is what is happening on the IMA Sample application).

Thus, checking if the user skipped over any mid-rolls will let IMA play the last mid-roll, post which the content complete signal will be sent.

vishnuchilakala avatar Sep 23 '22 11:09 vishnuchilakala

Thanks for sending a fix for this problem. Your current fix only checks if a midroll exists though and will never allow to send the content complete flag. Could you change it to only prevent sending content complete if the last midroll group hasn't been fully played yet (AdPlaybackState.shouldPlayAdGroup())?

tonihei avatar Oct 17 '22 09:10 tonihei

Thanks for the review @tonihei ! Made the change you suggested, please take a look again now.

vishnuchilakala avatar Oct 18 '22 08:10 vishnuchilakala

@tonihei Worked on the comments and updated the PR.

vishnuchilakala avatar Oct 18 '22 12:10 vishnuchilakala