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

Doesn't switch to next video in playlist after postroll #497

Open
polucorus opened this issue Aug 29, 2019 · 2 comments
Open

Doesn't switch to next video in playlist after postroll #497

polucorus opened this issue Aug 29, 2019 · 2 comments

Comments

@polucorus
Copy link

polucorus commented Aug 29, 2019

I've got a playlist with auto advancing on and it just pauses after the postroll instead of switching to the next video. Based on my debugging, without postroll it switches to the AdsDone state and with it, it doesn't.

When endLinearAdMode() is called, the transition is in the callback but that callback is never executed because the end() method calls restorePlayerSnapshot() and in the end of it there's a condition:

if (player.ads.videoElementRecycled()) {
   // ...
   player.on('resumeended', callback)
} else {
   // ...
   callback();
}

It goes into the first branch but resumeended is never triggered because isContentResuming() returns false. How to make it go down the playlist?

To be clear, with only preroll it works fine. I've implemented both preroll and postroll based on the official guide. I don't use googleads-ima, just contrib-ads 6.6.3 and videojs-playlist 4.3.1.

@polucorus
Copy link
Author

Further investigation has shown that isContentResuming() returns false in that case because apparently the ended event is triggered before endLinearAdMode() where the contentResuming property is set to true. Why is that?

@polucorus
Copy link
Author

polucorus commented Aug 30, 2019

Turning on autoplay() helped on Chrome, even though it wasn't required without the preroll. On Firefox it doesn't trigger transition to AdsDone so the player repeats the same video again.

Also, the contrib-ads doesn't properly restore autoadvance() state of the playlist — I have to set it on every adended.

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

No branches or pull requests

1 participant