Skip to content

Commit ec5b898

Browse files
committed
pr fix: remove private variable and observedAttributes
1 parent 9105a3c commit ec5b898

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

packages/mux-video-ads/src/index.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const Attributes = {
2525
class MuxVideoAds extends MuxVideoElement {
2626
#muxAdManager: MuxAdManager | undefined;
2727
#lastCurrentime: number | undefined;
28-
#hasAllowPlaybackWithAdBlocker: boolean | undefined = false;
2928

3029
static getTemplateHTML = (attrs: Record<string, string>) => {
3130
return `
@@ -106,14 +105,6 @@ video::-webkit-media-text-track-container {
106105
return [...(super.observedAttributes ?? []), Attributes.ALLOW_PLAYBACK_WITH_AD_BLOCKER];
107106
}
108107

109-
attributeChangedCallback(name: string, _oldValue: string | null, _newValue: string | null) {
110-
super.attributeChangedCallback?.(name, _oldValue, _newValue);
111-
if (name === Attributes.ALLOW_PLAYBACK_WITH_AD_BLOCKER) {
112-
console.log('ALLOW_PLAYBACK_WITH_AD_BLOCKER', this.allowPlaybackWithAdBlocker);
113-
this.#hasAllowPlaybackWithAdBlocker = this.allowPlaybackWithAdBlocker;
114-
}
115-
}
116-
117108
constructor() {
118109
super();
119110

@@ -134,7 +125,7 @@ video::-webkit-media-text-track-container {
134125

135126
if (!MuxAdManager.isGoogleImaSDKAvailable()) {
136127
console.error('Missing google.ima SDK. Make sure you include it via a script tag.');
137-
if (!this.#hasAllowPlaybackWithAdBlocker) {
128+
if (!this.allowPlaybackWithAdBlocker) {
138129
this.#showAdBlockedMessage();
139130
} else {
140131
this.#adBreak = false;
@@ -289,7 +280,7 @@ video::-webkit-media-text-track-container {
289280
return Promise.resolve();
290281
}
291282

292-
if (this.adTagUrl && !this.#hasAllowPlaybackWithAdBlocker) {
283+
if (this.adTagUrl && !this.allowPlaybackWithAdBlocker) {
293284
this.#lastCurrentime = this.nativeEl.currentTime;
294285
this.#adBreak = true;
295286
this.dispatchEvent(new Event('durationchange'));

0 commit comments

Comments
 (0)