videojs/videojs-contrib-ads

Catch 'Unexpected startLinearAdMode invocation (Preroll)' warning

zhulduz opened this issue · 5 comments

Hi,
I use playlist example from videojs-ima with autoplay settings for video.js.

Sometimes when I switch src for the player, I get Unexpected startLinearAdMode invocation (Preroll) warning and autoplay doesn't work.

I researched the issue, the flag this.contentResuming from video-contrib-ads is false (at the error situation), but I couldn't find where this flag becomes to false (there are two places at video-contrib-ads, where this.contentResuming is set to false, none of them isn't called)

Can you help me understand, how I can fix this issue?

Hi @zhulduz

The contentResuming property will be false by default. What is the value of this.adsReady when this happens?

Also, are you changing sources during ad playback? That's currently not a supported feature.

Finally, turning on debug mode by passing {debug: true} when initializing contrib-ads may help.

Hi @misteroneill ,
thanks for the response.

  1. Plugin options (base content is hls)
{
    contentIsLive: true,
    liveCuePoints: false
}
  1. Log without changing sources (open a page with video player with ads) - autoplay doesn't work after the ad:
VIDEOJS: ADS: Received play event (BeforePreroll)
VIDEOJS: ADS: BeforePreroll -> Preroll
VIDEOJS: ADS: Received adsready event (Preroll)
VIDEOJS: ADS: Triggered readyforpreroll event (Preroll)
VIDEOJS: ADS: adtimeout (Preroll)
VIDEOJS: WARN: Unexpected startLinearAdMode invocation (Preroll)

Later, I will try to prepare an example in codepen.

Hi,

I've also seen this message, and the video doesn't resume after a preroll. After some brief analysis, I've found that in the error case:
the 1 second preroll timeout fires, and resumeAfterNoPreroll() sets contentResuming to true.
When the preroll starts, startLinearAdMode() checks for !this.isContentResuming(). As this condition is not met, adBreak.start() is not called, so ads is not in an appropriate state to resume.

I've tried lengthening the preroll timeout and this helps, but is just hiding the problem.
For now I've reverted to an older version of videojs-contrib-ads.

Any fixes for this? I am using the following versions:
"video.js": "7.7.5",
"videojs-contrib-ads": "6.6.5",
"videojs-ima": "1.8.0"
I am still having the same issue in safari....

I am still having the same issue in chrome....
video.js": "^7.8.4",
"videojs-contrib-hls": "^5.15.0",
"videojs-ima": "^1.8.3",
"videojs-contrib-ads": "^6.7.0",

Any fixes for this?