Files
ShakaPlayer/lib/ads/abstract_ad.js
Álvaro Velad Galván 4f62ce8b24 build: Reduce bundle size by deduplicating license headers (#10182)
Ensure generated bundles contain a single license header instead of
repeating the same notice across bundled modules.

Normalize all copyright years to 2016 and remove
duplicate license headers from generated bundles.

This reduces the final bundle size while preserving license information
in the distributed artifacts.
2026-06-05 12:43:28 +02:00

278 lines
3.0 KiB
JavaScript
Executable File

/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
goog.provide('shaka.ads.AbstractAd');
/**
* @abstract
* @implements {shaka.extern.IAd}
* @export
*/
shaka.ads.AbstractAd = class {
/**
* @param {HTMLMediaElement=} video
*/
constructor(video = null) {
/** @protected {HTMLMediaElement} */
this.video = video;
}
/**
* @override
*/
needsSkipUI() {
return true;
}
/**
* @override
*/
isClientRendering() {
return true;
}
/**
* @override
*/
hasCustomClick() {
return false;
}
/**
* @override
*/
isUsingAnotherMediaElement() {
return false;
}
/**
* @override
*/
getDuration() {
return -1;
}
/**
* @override
*/
getMinSuggestedDuration() {
return this.getDuration();
}
/**
* @override
*/
getRemainingTime() {
return -1;
}
/**
* @override
*/
isPaused() {
return this.video ? this.video.paused : false;
}
/**
* @override
*/
isSkippable() {
return false;
}
/**
* @override
*/
getTimeUntilSkippable() {
return 0;
}
/**
* @override
*/
canSkipNow() {
return false;
}
/**
* @override
*/
skip() {
// Nothing
}
/**
* @override
*/
pause() {
if (this.video) {
this.video.pause();
}
}
/**
* @override
*/
play() {
if (this.video) {
this.video.play();
}
}
/**
* @override
*/
getVolume() {
return this.video ? this.video.volume : 1;
}
/**
* @override
*/
setVolume(volume) {
if (this.video) {
this.video.volume = volume;
}
}
/**
* @override
*/
isMuted() {
return this.video ? this.video.muted : false;
}
/**
* @override
*/
isLinear() {
return true;
}
/**
* @override
*/
resize(width, height) {
// Nothing
}
/**
* @override
*/
setMuted(muted) {
if (this.video) {
this.video.muted = muted;
}
}
/**
* @override
*/
getSequenceLength() {
return 1;
}
/**
* @override
*/
getPositionInSequence() {
return 1;
}
/**
* @override
*/
getTitle() {
return '';
}
/**
* @override
*/
getDescription() {
return '';
}
/**
* @override
*/
getVastMediaBitrate() {
return 0;
}
/**
* @override
*/
getVastMediaHeight() {
return 0;
}
/**
* @override
*/
getVastMediaWidth() {
return 0;
}
/**
* @override
*/
getVastAdId() {
return '';
}
/**
* @override
*/
getAdId() {
return '';
}
/**
* @override
*/
getCreativeAdId() {
return '';
}
/**
* @override
*/
getAdvertiserName() {
return '';
}
/**
* @override
*/
getMediaUrl() {
return null;
}
/**
* @override
*/
getTimeOffset() {
return 0;
}
/**
* @override
*/
getPodIndex() {
return 0;
}
/**
* @override
*/
release() {
this.video = null;
}
};