video-ad-sdk
Version:
VAST/VPAID SDK that allows video ads to be played on top of any player
34 lines (33 loc) • 1.38 kB
JavaScript
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
import { Emitter } from '../helpers/Emitter';
import { handshakeVersion, initAd, startAd, stopAd, resumeAd, pauseAd, skipAd, setAdVolume, getAdVolume, resizeAd, adVolumeChange, getAdIcons, getAdDuration, getAdRemainingTime } from '../helpers/vpaid/api';
export class MockVpaidCreativeAd extends Emitter {
constructor(version = '2.0') {
super();
this.volume = 0.8;
this[_a] = jest.fn(() => this.version);
this[_b] = jest.fn();
this[_c] = jest.fn();
this[_d] = jest.fn();
this[_e] = jest.fn();
this[_f] = jest.fn();
this[_g] = jest.fn();
this[_h] = jest.fn();
this[_j] = jest.fn();
this[_k] = jest.fn();
this[_l] = jest.fn((volume) => {
this.volume = volume;
this.emit(adVolumeChange);
});
this[_m] = jest.fn(() => this.volume);
this[_o] = jest.fn();
this.version = version;
}
subscribe(listener, event) {
this.on(event, listener);
}
unsubscribe(listener, event) {
this.removeListener(event, listener);
}
}
_a = handshakeVersion, _b = initAd, _c = startAd, _d = stopAd, _e = resumeAd, _f = pauseAd, _g = skipAd, _h = getAdIcons, _j = getAdDuration, _k = getAdRemainingTime, _l = setAdVolume, _m = getAdVolume, _o = resizeAd;