Closed marcodeltorob closed 4 years ago
What resumeAfterNoPreroll
does is to set contentResuming
to true and unlock playback with player.ads._shouldBlockPlay = true
also remove the timeout
function and the CSS (vjs-ad-loading
& vjs-ad-content-resuming
).
In a normal scenario, the plugin will transition from Preroll -> ContentPlayback
after the Ad brake but here the plugin is getting stuck in Preroll
state so that is why inside the onAdTimeout()
I'm proposing a transition to ContentPlayback
in case of the adtimeout
is triggered since due to the AdBlocker the plugin does not fire more events and is not transitioning until the first manual player.play()
and that is why the player is sending a contentplay
instead of on play
event.
I'm a bit worried that this will change the behavior of adtimeout in the case adblockers aren't available. Like if the ad response is slow or the response contains no ads.
As discussed offline, we think this carries some risk of creating other undesirable behaviors and will close for now. If this issue comes back up, we can revisit!
Problem Description
When Preroll is blocked due to AdBlocker the plugin will trigger an
adtimeout
event then content will play without any event trigger likeplay
orcontentplay
or transition toContentPlayback
state. So, the first event triggered if we callplayer.play()
orplayer.pause()
will be prefixed withcontent
(contentpause
orcontentplay
) and plugin will transition fromPreroll -> ContentPlayback
because we are inPreroll
stuck.Solution Proposal
When we have and
adtimeout
inPreroll
state transition toContentPlayback