video-ad-sdk
Version:
VAST/VPAID SDK that allows video ads to be played on top of any player
14 lines (13 loc) • 445 B
JavaScript
import { getLinearTrackingEvents } from '../../../vastSelectors';
import { linearEvents } from '../../../tracker';
const { progress } = linearEvents;
export const getProgressEvents = (vastChain) => vastChain
.map(({ ad }) => ad)
.reduce((accumulated, ad) => {
const events = (ad && getLinearTrackingEvents(ad, progress)) || [];
return [...accumulated, ...events];
}, [])
.map(({ offset, uri }) => ({
offset,
uri
}));