video-ad-sdk
Version:
VAST/VPAID SDK that allows video ads to be played on top of any player
13 lines (12 loc) • 513 B
JavaScript
import { xml2js } from './helpers/xml2js';
import { get, getAll, getFirstChild, getText, getAttributes, getAttribute } from './helpers/xmlSelectors';
const parser = new DOMParser();
/**
* Parses the passed xml text.
*
* @throws if there is an error parsing the xml.
* @param xmlText XML text to be parsed.
* @returns Returns the parsed xml document as a js object.
*/
export const parseXml = (xmlText) => xml2js(parser, xmlText);
export { get, getAll, getFirstChild, getText, getAttributes, getAttribute };