UNPKG

video-ad-sdk

Version:

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

8 lines (7 loc) 356 B
import { get, getAll, getFirstChild } from '../../xml'; const hasLinear = (creative) => get(creative, 'linear'); export const getLinearCreative = (ad) => { const adTypeElement = getFirstChild(ad); const creativesElement = adTypeElement && get(adTypeElement, 'creatives'); return creativesElement && getAll(creativesElement).find(hasLinear); };