Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when HLS/DASH chunks are requested before the ad returns from the broker #499

Open
nepomucenobr opened this issue Sep 12, 2019 · 1 comment

Comments

@nepomucenobr
Copy link

Description

I wrote a proof of concept FreeWheel plugin and it works fine for progressive streams. However, it fails when I use HLS/DASH (I see an error on the console and when the ad finishes, the regular video won’t play). I noticed it happens when the ad broker takes a bit of time to return something. I tested it with two ad servers, one that returns a fake ad right away and another one that goes through the bidding process with lots of fallbacks and all. It works fine for the first one, but fails for the second. Looking at the network tab, I noticed it fails when the player starts requesting the video chunks before the ad comes back from the broker (it works perfectly, otherwise). Apparently what’s happening is the player starts requesting the HLS/DASH video chunks and when it gets the ad, the video source is changed. Then, when the chunks arrive, the player says: “oh wait, I don’t know what to do with these anymore, I am playing something else now”. I am not sure if this is a bug with the videojs-contrib-ads plugin or if I should be calling something I am not.

Below you will find some information about how I am handling/triggering the main events associated with ad playback.

onRequestComplete = function(evt) {
  if (evt.success) {
    // (...)
    if (temporalSlots.length && player.fw.prerollSlots.length) {
      player.trigger("adsready");
    }
    else {
      player.trigger("nopreroll");
    }
  }
},
playAd = function() {
  if (player.fw.prerollSlots.length) {
    player.ads.startLinearAdMode();
    state.adPlaying = true;

    player.trigger('ads-ad-started'); //  I also tried placing this after the slot.play(), but it didn't work either

    var slot = player.fw.prerollSlots.shift();
    slot.play();
  }
  else {
    player.trigger('ads-ad-ended');
    player.ads.endLinearAdMode();
    state.adPlaying = false;
  }
}

Here is the actual error I am getting: Uncaught DOMException: Failed to read the ‘buffered’ property from ‘SourceBuffer’: This SourceBuffer has been removed from the parent media source.

hls_ad_issue_error

Versions

videojs-contrib-ads version: 6.6.4
Video-js version: Video.js 7.6.0
Other plugins:

Platforms

Browsers: Chrome 76.0.3809.132 and Microsoft Edge 44.17763.1.0 (Microsoft EdgeHTML 18.17763)
OS/Devices: Windows 10

@AdamTyler
Copy link

@nepomucenobr Any progress on this? I'm having the same issue. Also trying to use freewheel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants