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

Experiment/google ima csai ads #986

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7d667c7
WIP mux-video + google ima
cjpillsbury Sep 17, 2024
95a411d
example PLUS HACK IN ADTAGURL IN PLAYER TEMPLATE.
cjpillsbury Sep 17, 2024
8c69a44
ad basic api for ad break times.
cjpillsbury Sep 17, 2024
486bda3
WIP add basic impl for ad tag url to mux-player (probably move to sep…
cjpillsbury Sep 17, 2024
08a933e
first pass on type defs for google ima sdk.
cjpillsbury Sep 17, 2024
3dd2ddd
more types cleanup and minor changes.
cjpillsbury Sep 17, 2024
453f62e
cleanup google ima types for external consumption and builds (e.g. mu…
cjpillsbury Sep 17, 2024
facc26a
more typescriptrobatics.
cjpillsbury Sep 17, 2024
04b0a48
chore: update vanilla example page title for google ima usage.
cjpillsbury Sep 17, 2024
e9698d1
try to see if this fixes silly template test fails.
cjpillsbury Sep 17, 2024
41d44b3
volume control for ads.
cjpillsbury Sep 17, 2024
5d5367e
basic autoplay and ready state for ads
cjpillsbury Sep 17, 2024
e33497e
basic postroll impl
cjpillsbury Sep 17, 2024
dd08e6a
cleanup ad break code.
cjpillsbury Sep 18, 2024
d0fdc37
ad state and various cleanups.
cjpillsbury Sep 19, 2024
7531af4
prove out mux player ad-specific UI.
cjpillsbury Sep 19, 2024
9097f4c
update vanilla ads example to demo new UI.
cjpillsbury Sep 19, 2024
bfaf5d0
no more types to pull in so removing presumptuous cp from playback-core.
cjpillsbury Sep 19, 2024
ed5699c
add resizing logic for IMA crud.
cjpillsbury Sep 23, 2024
9c1f484
fix linting errors
cjpillsbury Sep 23, 2024
a85c0c4
force exit pip on ad play.
cjpillsbury Sep 23, 2024
2bf4ce7
account for user active+inactive (NOTE: Needs followup for ad clicks).
cjpillsbury Sep 23, 2024
131beb1
more acrobatics for different playback scenarios
cjpillsbury Sep 23, 2024
e9a2b7c
bug fix for ad counter.
cjpillsbury Sep 23, 2024
115c139
minor cleanup
cjpillsbury Sep 24, 2024
d104c0b
for now no autohide of any controls during adbreak.
cjpillsbury Sep 25, 2024
84c5b06
general cleanup using more official APIs instead of data structures.
cjpillsbury Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ad basic api for ad break times.
  • Loading branch information
cjpillsbury committed Sep 19, 2024
commit 8c69a443333ea78df3e30e1db9def327597b3660
17 changes: 14 additions & 3 deletions packages/mux-video/src/google-ima-video-element-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ video::-webkit-media-text-track-container {
adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true;
this.#adsManager = adsManagerLoadedEvent.getAdsManager(this.nativeEl, adsRenderingSettings);
console.log('this.#adsManager', this.#adsManager);
console.log('cuePoints avail?', this.#adsManager.getCuePoints());
this.#startAdsManager(this.#adsManager);
},
false,
Expand Down Expand Up @@ -256,13 +257,13 @@ video::-webkit-media-text-track-container {
google.ima.AdEvent.Type.COMPLETE,
/** @TODO Define global namespace ima (likely use a module for abstractions) (CJP) */
/** @ts-ignore */
google.ima.AdEvent.Type.FIRST_QUARTILE,
// google.ima.AdEvent.Type.FIRST_QUARTILE,
/** @TODO Define global namespace ima (likely use a module for abstractions) (CJP) */
/** @ts-ignore */
google.ima.AdEvent.Type.LOADED,
/** @TODO Define global namespace ima (likely use a module for abstractions) (CJP) */
/** @ts-ignore */
google.ima.AdEvent.Type.MIDPOINT,
// google.ima.AdEvent.Type.MIDPOINT,
/** @TODO Define global namespace ima (likely use a module for abstractions) (CJP) */
/** @ts-ignore */
// google.ima.AdEvent.Type.PAUSED,
Expand All @@ -271,7 +272,7 @@ video::-webkit-media-text-track-container {
google.ima.AdEvent.Type.STARTED,
/** @TODO Define global namespace ima (likely use a module for abstractions) (CJP) */
/** @ts-ignore */
google.ima.AdEvent.Type.THIRD_QUARTILE,
// google.ima.AdEvent.Type.THIRD_QUARTILE,
];
for (const index in events) {
adsManager.addEventListener(
Expand Down Expand Up @@ -445,6 +446,16 @@ video::-webkit-media-text-track-container {
}
super.currentTime = val;
}

/** @TODO Translate these to actual text track cues? (CJP) */
get adCuePoints() {
return (this.#adsManager?.getCuePoints() ?? []).map((startTime: number) => {
return {
startTime,
value: 'AD_BREAK', // What should this be?
};
});
}
}

return GoogleIMAVideoElement;
Expand Down