UNPKG

video-ad-sdk

Version:

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

14 lines (13 loc) 423 B
import { parseMacro } from './parseMacro'; /** * Creates a tracking image with the passed URL macro. * * @param urlMacro URL Macro that need to be tracked. * @param data Data Object with the macros's variables. * @returns Image element whose source is the parsed URL Macro. */ export const pixelTracker = (urlMacro, data) => { const img = new Image(); img.src = parseMacro(urlMacro, data); return img; };