Skip to content

Commit

Permalink
chore(Demo): Allow add custom MediaTailor assets (shaka-project#5798)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and Rodolphe Breton committed Nov 30, 2023
1 parent 2f310ea commit 6ae0844
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion demo/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,21 @@ shakaDemo.Custom = class {
this.makeField_(
container, manifestTypeName, manifestTypeSetup, manifestTypeChange);

// Make the MediaTailor URL field.
const mediaTailorSetup = (input, container) => {
if (assetInProgress.mediaTailorUrl) {
input.value = assetInProgress.mediaTailorUrl;
}
};
const mediaTailorOnChange = (input) => {
assetInProgress.setMediaTailor(input.value);
this.manifestField_.required =
this.checkManifestRequired_(assetInProgress);
};
const mediaTailorName = 'Media Tailor URL';
this.makeField_(
container, mediaTailorName, mediaTailorSetup, mediaTailorOnChange);

return adsDiv;
}

Expand Down Expand Up @@ -625,7 +640,9 @@ shakaDemo.Custom = class {
// from the Google Ad Manager using IMA ids.
const isDaiAdManifest = (assetInProgress.imaContentSrcId &&
assetInProgress.imaVideoId) || assetInProgress.imaAssetKey != null;
return !isDaiAdManifest;
// Or if we are getting it from AWS Elemental MediaTailor.
const isMediaTailor = !!assetInProgress.mediaTailorUrl;
return !isDaiAdManifest && !isMediaTailor;
}

/**
Expand Down

0 comments on commit 6ae0844

Please sign in to comment.