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

Player remains in Buffering state if a midroll ad has offset greater than Video length #5534

Open
raunakyadav opened this issue Feb 19, 2019 · 7 comments

Comments

@raunakyadav
Copy link

Issue description

If the AdsMediaSource has a mid-roll ad that has timeOffset > video duration, then on video end, STATE_BUFFERING is received instead of STATE_ENDED in onPlayerStateChanged.

Reproduction steps

Configure a mid-roll ad with offset greater than video length. Play the video till end.
Observe the callbacks from player. Also the controller remains in playing state after this.

Link to test content

Any test vmap would work satisfying the offset as specified in Title. Example

Version of ExoPlayer being used

2.9.5

Device(s) and version(s) of Android being used

Samsung Galaxy S6, Android 7

A full bug report captured from the device

Will mail.

@andrewlewis
Copy link
Collaborator

Is it feasible to ensure that the VMAP ad break times are compatible with the content duration? This is a known issue but seems tricky to fix with the IMA API at the moment (we have AdsRenderingSettings.setPlayAdsAfterTime, but not setPlayAdsBeforeTime).

@raunakyadav
Copy link
Author

Yes. We are working on getting the ad breaks to be according to the video duration. But that might not be possible for some third party ad tags.
Can this be raised with IMA team then to give a feature like "setPlayAdsBeforeTime"?
I also receive IMA's adEvent ALL_ADS_COMPLETED when the video ends even though mid-roll did not play. So maybe checking that event and player's position being equal to the total duration, we can deem it ended and update UI accordingly.

@andrewlewis
Copy link
Collaborator

@raunakyadav You could ask about this request on the IMA SDK technical forum.

As a tangential side note: to get the best user experience with client-side video ad insertion it's necessary to ensure that there are keyframes in the content at ad insertion cue points (otherwise, transitions from midroll ads back to content can't generally be seamless when using one video decoder). If you author the content and ad tag together you can guarantee this, and it also makes it easy to ensure that no ad insertion cue points are after the content duration.

@ojw28
Copy link
Contributor

ojw28 commented Jul 10, 2019

@andrewlewis - What's the expected behaviour that this enhancement is tracking? Should the ad just not be played? I think the problem is identical to that described in #5067, however the proposed solutions are possibly different.

@andrewlewis
Copy link
Collaborator

What's the expected behaviour that this enhancement is tracking? Should the ad just not be played?

It would probably make most sense to discard any midrolls after the content length but play the postroll (if there is one) when playback reaches the end of the content. We should check that IMA expects the postroll to play after notifying it with contentComplete, even if there's an unplayed midroll before. This issue could be classed as a bug if one considers it valid to have midroll ads after the content duration.

I think the problem is identical to that described in #5067, however the proposed solutions are possibly different.

Isn't #5067 more about being able to position the ad breaks within the content once its duration is known? There may actually be a quick fix for that, which is to have AdsMediaSource expose a timeline with a "unset" number of ads if the content is prepared but the ad state isn't ready. Then the ads loader can get the content timeline before it places ads. (I have a work in progress change for concatenation that does this.)

@Proxwian
Copy link

Proxwian commented Aug 6, 2021

Any updates yet?

@andrewlewis
Copy link
Collaborator

andrewlewis commented Aug 6, 2021

No updates I'm afraid. I'd still recommend setting ad cue points based on the content duration (and keyframe positions) as suggested above.

[Edited to remove a potentially incorrect point about the failure mode changing as actually I don't think we will detect that we are waiting for an ad load so ad loading may not time out.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants