iab-vast-parser
Version:
Parses IAB VAST tags into iab-vast-model objects.
99 lines (91 loc) • 2.66 kB
JavaScript
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _types = require('../xml/types');
var _types2 = _interopRequireDefault(_types);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var collections = {
AdVerifications: ['Verification'],
Companion: ['CompanionClickTracking'],
CompanionAds: ['Companion'],
CreativeExtensions: ['CreativeExtension'],
Creatives: ['Creative'],
Extensions: ['Extension'],
Icon: ['IconViewTracking'],
IconClicks: ['IconClickTracking'],
Icons: ['Icon'],
InLine: ['Category', 'Error', 'Impression', 'Survey'],
MediaFiles: ['MediaFile', 'InteractiveCreativeFile'],
NonLinear: ['NonLinearClickTracking'],
NonLinearAds: ['NonLinear'],
TrackingEvents: ['Tracking'],
VAST: ['Error', 'Ad'],
Verification: ['JavaScriptResource', 'FlashResource'],
ViewableImpression: ['Viewable', 'NotViewable', 'ViewUndetermined'],
VideoClicks: ['ClickTracking', 'CustomClick'],
Wrapper: ['Impression', 'Error']
}; // TODO Add required nodes & attributes
var freeforms = {
CreativeExtensions: ['CreativeExtension'],
Extensions: ['Extension']
};
var types = {
Ad: {
sequence: _types2.default.int
},
AdParameters: {
xmlEncoded: _types2.default.bool
},
Companion: {
width: _types2.default.int,
height: _types2.default.int,
expandedWidth: _types2.default.int,
expandedHeight: _types2.default.int
},
Creative: {
sequence: _types2.default.int
},
Duration: {
_value: _types2.default.time
},
Icon: {
width: _types2.default.int,
height: _types2.default.int,
offset: _types2.default.time,
duration: _types2.default.time
},
MediaFile: {
bitrate: _types2.default.int,
minBitrate: _types2.default.int,
maxBitrate: _types2.default.int,
width: _types2.default.int,
height: _types2.default.int,
scalable: _types2.default.bool,
maintainAspectRatio: _types2.default.bool
},
NonLinear: {
width: _types2.default.int,
height: _types2.default.int,
assetWidth: _types2.default.int,
assetHeight: _types2.default.int,
expandedWidth: _types2.default.int,
expandedHeight: _types2.default.int,
scalable: _types2.default.bool,
maintainAspectRatio: _types2.default.bool,
minSuggestedDuration: _types2.default.time
},
Pricing: {
_value: _types2.default.float
},
Wrapper: {
followAdditionalWrappers: _types2.default.bool,
allowMultipleAds: _types2.default.bool,
fallbackOnNoAd: _types2.default.bool
}
};
exports.default = {
collections: collections,
freeforms: freeforms,
types: types
};