videojs / videojs-contrib-ads

A Tool for Building Video.js Ad Plugins
http://videojs.github.io/videojs-contrib-ads/
Other
380 stars 257 forks source link

What should we do after failed content? #466

Open zhulduz opened 5 years ago

zhulduz commented 5 years ago

Hi, I have a question about failed content video.

The case:

  1. Play preroll ad + video content with failed response(for example, the source not found)
  2. Change player content source
  3. Catch warning Unexpected startLinearAdMode invocation (Preroll)

Logs for successful case (with success content):

VIDEOJS: ADS: Received play event (BeforePreroll)
VIDEOJS: ADS: BeforePreroll -> Preroll
VIDEOJS: ADS: Received adsready event (Preroll)
VIDEOJS: ADS: Triggered readyforpreroll event (Preroll)
VIDEOJS: ADS: Starting ad break
VIDEOJS: ADS: Ending ad break
VIDEOJS: ADS: Preroll -> ContentPlayback

Logs for failuer case (with failure content):

VIDEOJS: ADS: Received contentchanged event (ContentState)
VIDEOJS: ADS: ContentPlayback -> BeforePreroll
VIDEOJS: ADS: BeforePreroll -> Preroll

`log with some error: The media could not be loaded, either because the ...`

VIDEOJS: ADS: Received adsready event (Preroll)
VIDEOJS: ADS: Triggered readyforpreroll event (Preroll)
VIDEOJS: ADS: Starting ad break
VIDEOJS: ADS: Ending ad break

The main diff is an absence state.transitionTo. Is there something what I should do in my side for correct work? Or is this bug?

misteroneill commented 5 years ago

It sounds like the root cause of your troubles is probably the same as in #464 - so, let's focus on that issue first.

zhulduz commented 5 years ago

Hi @misteroneill,

I have prepared example https://codepen.io/zhulduz/pen/GzpYer?editors=1010

Step to reproduce:

  1. watch until the end of the ad first video
  2. click on the button Change source
  3. watch until the end of the ad second video
  4. get the warning Unexpected startLinearAdMode invocation (Preroll)
  5. click on the button Change source
  6. after watching until the end of the ad third video is not play automatically