videojs / videojs-contrib-ads

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

Preroll doesn't start after resume video #564

Open Wadimir opened 1 year ago

Wadimir commented 1 year ago

Welcome to videojs-contrib-ads and thank you for contributing to the project! Below is a template for filing issues that will help us diagnose problems and recommend solutions.

Description

Preroll doesn't start after resume video

Steps to Reproduce

  1. Start video.
  2. Watch preroll
  3. After preroll watch video (I have 2 minutes video)
  4. When I click on the play button, when the video has played to the end, the video starts playing from the beginning.

Include step-by-step instructions on how to reproduce the issue:

Expected Results

preroll should be start play

Actual Results

video starts without preroll

Reproducing Unit Test

Please include a unit test that fails in the most recent version of videojs-contrib-ads but should pass according to your expected results. This will help us understand what the root cause is and separate ad plugin bugs from issues with this project. A unit test can be provided like below:

import QUnit from 'qunit';
import {Midroll} from '../../../src/states.js';
import adBreak from '../../../src/adBreak.js';

QUnit.test('starts an ad break on init', function(assert) {
  this.midroll = new Midroll(this.player);

  this.midroll.init(this.player);
  assert.equal(this.player.ads.adType, 'midroll', 'ad type is midroll');
  assert.equal(this.adBreakStartStub.callCount, 1, 'ad break started');
});

This example was pulled from test/states/test.Midroll.js.

Versions

videojs-contrib-ads version : 6.9.0

Video-js version: 7.21.5

Other plugins: please list other plugins that may affect videojs-contrib-ads behavior, especially ad plugins.

Platforms

Browsers : Chrome 114.0.5735.198

OS/Devices: MacOs 13.4.1