videojs-contrib-ads icon indicating copy to clipboard operation
videojs-contrib-ads copied to clipboard

Catch 'Unexpected startLinearAdMode invocation (Preroll)' warning

Open zhulduz opened this issue 6 years ago • 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?

zhulduz avatar Jan 18 '19 12:01 zhulduz

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.

misteroneill avatar Jan 24 '19 20:01 misteroneill

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.

zhulduz avatar Jan 25 '19 06:01 zhulduz

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.

Wayne-Morgan avatar Apr 25 '19 09:04 Wayne-Morgan

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....

stomata avatar Jun 11 '20 17:06 stomata

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?

yggtech avatar Nov 13 '20 14:11 yggtech