UNPKG

video-ad-sdk

Version:

VAST/VPAID SDK that allows video ads to be played on top of any player

11 lines (10 loc) 421 B
import { waitFor } from './waitFor'; const WAIT_TIMEOUT = 5000; export const callAndWait = (creativeAd, method, event, ...args // eslint-disable-next-line max-params ) => { const waitPromise = waitFor(creativeAd, event, WAIT_TIMEOUT); const creativeMethod = creativeAd[method]; creativeMethod === null || creativeMethod === void 0 ? void 0 : creativeMethod.apply(creativeAd, args); return waitPromise; };