Skip to content

Commit

Permalink
fix(Ads): Allow play interstitials using single video element when us…
Browse files Browse the repository at this point in the history
…e native HLS (#7550)
  • Loading branch information
avelad committed Nov 12, 2024
1 parent 2f7ca9d commit 9de9410
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions lib/ads/interstitial_ad_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ shaka.ads.InterstitialAdManager = class {
*/
configure(config) {
this.config_ = config;
this.determineIfUsingBaseVideo_();
}

/**
Expand Down Expand Up @@ -282,13 +283,6 @@ shaka.ads.InterstitialAdManager = class {
* @param {shaka.extern.HLSInterstitial} hlsInterstitial
*/
async addMetadata(hlsInterstitial) {
if (this.basePlayer_.getLoadMode() == shaka.Player.LoadMode.SRC_EQUALS &&
this.usingBaseVideo_) {
shaka.log.alwaysWarn(
'Unsupported HLS interstitial when using single media element',
hlsInterstitial);
return;
}
this.updatePlayerConfig_();
const adInterstitials = await this.getInterstitialsInfo_(hlsInterstitial);
if (adInterstitials.length) {
Expand Down Expand Up @@ -387,13 +381,6 @@ shaka.ads.InterstitialAdManager = class {
* @param {!Array.<shaka.extern.AdInterstitial>} interstitials
*/
addInterstitials(interstitials) {
if (this.basePlayer_.getLoadMode() == shaka.Player.LoadMode.SRC_EQUALS &&
this.usingBaseVideo_) {
shaka.log.alwaysWarn(
'Unsupported interstitial when using single media element',
interstitials);
return;
}
let cuepointsChanged = false;
for (const interstitial of interstitials) {
const interstitialId = interstitial.id || JSON.stringify(interstitial);
Expand Down

0 comments on commit 9de9410

Please sign in to comment.