1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 18:29:39 +02:00
Oinktube/node_modules/videojs-contrib-ads/docs/integrator/ad-mode.md
Daniel 2a9630258f https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556
Also check the lang in case insensitive
2022-03-14 14:28:38 -03:00

1.2 KiB

What is ad mode?

Defining "ad mode" has turned out to be an interesting challenge for this project. A naive definition might be "is an ad playing or not?" It turns out there are a lot of edge cases that this naive definition does not cover. The following precise definition of ad mode drives the implementation of contrib-ads and ad plugins should be careful to follow it as well to assure maximum correctness.

Ad mode is split into three parts as identified by the methods isWaitingForAdBreak(), inAdBreak(), and isContentResuming(). See the API reference for more information.

Definition

The player is in ad mode if the ad plugin is currently preventing content playback.

Examples of ad mode:

  • Waiting to find out if an ad is going to play while content would normally be playing
  • Waiting for an ad to start playing while content would normally be playing
  • A linear ad is playing
  • An ad has completed and content is about to resume, but content has not resumed yet

Examples of not ad mode:

  • Content playback has not been requested
  • Content playback is paused
  • An asynchronous ad request is ongoing while content is playing
  • A non-linear ad (such as an overlay) is active