ExoPlayer
ExoPlayer copied to clipboard
Do not send content complete if any midroll is skipped
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.
@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.
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()
)?
Thanks for the review @tonihei ! Made the change you suggested, please take a look again now.
@tonihei Worked on the comments and updated the PR.