UNPKG

videojs-vast-vpaid

Version:
18 lines (13 loc) 465 B
const xml = require('../../utils/xml'); const parsers = require('./parsers'); function TrackingEvent (trackingJTree, duration) { if (!(this instanceof TrackingEvent)) { return new TrackingEvent(trackingJTree, duration); } this.name = trackingJTree.attr('event'); this.uri = xml.keyValue(trackingJTree); if ('progress' === this.name) { this.offset = parsers.offset(trackingJTree.attr('offset'), duration); } } module.exports = TrackingEvent;