Ads & monetisation

Ad behaviour

What happens automatically while an ad plays - visibility, PiP, the timeline, and iOS post-rolls.
  • Pauses when unattended - on tab hide or window blur, also checked up front so a mid-roll starting on a backgrounded tab is caught. Skipped on iOS, and it doesn't auto-resume; the point is not to burn an impression on nobody.
  • Exits Picture-in-Picture if active - skipped on iOS, where the ad renders into the same <video> PiP is already mirroring.
  • Keeps the timeline on the content. timeupdate/durationchange/progress are ignored while an ad is active, so currentTime/duration/bufferedDisplay - and a Scrubber or Transcript built on them - stay on the content's position throughout.
  • Restores the source after iOS post-rolls. IMA may leave the <video> pointing at the ad creative, so "Replay" would replay the ad; the player restores the saved source and clears the browser's ended flag so the normal replay flow works.
munsonlabs · MIT licensed · © 2026