-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1416109
commit 93406a9
Showing
37 changed files
with
4,157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export function createAd(adAttributes = {}) { | ||
return { | ||
id: adAttributes.id || null, | ||
sequence: adAttributes.sequence || null, | ||
adType: adAttributes.adType || null, | ||
adServingId: null, | ||
categories: [], | ||
expires: null, | ||
viewableImpression: {}, | ||
system: null, | ||
title: null, | ||
description: null, | ||
advertiser: null, | ||
#: null, | ||
survey: null, // @deprecated in VAST 4.1 | ||
errorURLTemplates: [], | ||
impressionURLTemplates: [], | ||
creatives: [], | ||
extensions: [], | ||
adVerifications: [], | ||
blockedAdCategories: [], | ||
followAdditionalWrappers: true, | ||
allowMultipleAds: false, | ||
fallbackOnNoAd: null | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function createAdVerification() { | ||
return { | ||
resource: null, | ||
vendor: null, | ||
browserOptional: false, | ||
apiFramework: null, | ||
type: null, | ||
parameters: null, | ||
trackingEvents: {} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function createClosedCaptionFile(closedCaptionAttributes = {}) { | ||
return { | ||
type: closedCaptionAttributes.type || null, | ||
language: closedCaptionAttributes.language || null, | ||
fileURL: null | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export function createCompanionAd(creativeAttributes = {}) { | ||
return { | ||
id: creativeAttributes.id || null, | ||
adType: 'companionAd', | ||
width: creativeAttributes.width || 0, | ||
height: creativeAttributes.height || 0, | ||
assetWidth: creativeAttributes.assetWidth || null, | ||
assetHeight: creativeAttributes.assetHeight || null, | ||
expandedWidth: creativeAttributes.expandedWidth || null, | ||
expandedHeight: creativeAttributes.expandedHeight || null, | ||
apiFramework: creativeAttributes.apiFramework || null, | ||
adSlotID: creativeAttributes.adSlotID || null, | ||
pxratio: creativeAttributes.pxratio || '1', | ||
renderingMode: creativeAttributes.renderingMode || 'default', | ||
staticResources: [], | ||
htmlResources: [], | ||
iframeResources: [], | ||
adParameters: null, | ||
xmlEncoded: null, | ||
altText: null, | ||
companionClickThroughURLTemplate: null, | ||
companionClickTrackingURLTemplates: [], | ||
trackingEvents: {} | ||
}; | ||
} | ||
|
||
export function isCompanionAd(ad) { | ||
return ad.adType === 'companionAd'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function createCreative(creativeAttributes = {}) { | ||
return { | ||
id: creativeAttributes.id || null, | ||
adId: creativeAttributes.adId || null, | ||
sequence: creativeAttributes.sequence || null, | ||
apiFramework: creativeAttributes.apiFramework || null, | ||
universalAdId: { value: null, idRegistry: 'unknown' }, | ||
creativeExtensions: [] | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createCreative } from './creative'; | ||
|
||
export function createCreativeCompanion(creativeAttributes = {}) { | ||
const { id, adId, sequence, apiFramework } = createCreative( | ||
creativeAttributes | ||
); | ||
return { | ||
id, | ||
adId, | ||
sequence, | ||
apiFramework, | ||
type: 'companion', | ||
required: null, | ||
variations: [] | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createCreative } from './creative'; | ||
|
||
export function createCreativeLinear(creativeAttributes = {}) { | ||
const { id, adId, sequence, apiFramework } = createCreative( | ||
creativeAttributes | ||
); | ||
return { | ||
id, | ||
adId, | ||
sequence, | ||
apiFramework, | ||
type: 'linear', | ||
duration: 0, | ||
skipDelay: null, | ||
mediaFiles: [], | ||
mezzanine: null, | ||
interactiveCreativeFile: null, | ||
closedCaptionFiles: [], | ||
videoClickThroughURLTemplate: null, | ||
videoClickTrackingURLTemplates: [], | ||
videoCustomClickURLTemplates: [], | ||
adParameters: null, | ||
icons: [], | ||
trackingEvents: {} | ||
}; | ||
} | ||
|
||
export function isCreativeLinear(ad) { | ||
return ad.type === 'linear'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createCreative } from './creative'; | ||
|
||
export function createCreativeNonLinear(creativeAttributes = {}) { | ||
const { id, adId, sequence, apiFramework } = createCreative( | ||
creativeAttributes | ||
); | ||
return { | ||
id, | ||
adId, | ||
sequence, | ||
apiFramework, | ||
type: 'nonlinear', | ||
variations: [], | ||
trackingEvents: {} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export function createExtension() { | ||
return { | ||
name: null, | ||
value: null, | ||
attributes: {}, | ||
children: [] | ||
}; | ||
} | ||
|
||
export function isEmptyExtension(extension) { | ||
return ( | ||
extension.value === null && | ||
Object.keys(extension.attributes).length === 0 && | ||
extension.children.length === 0 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export function createIcon() { | ||
return { | ||
program: null, | ||
height: 0, | ||
width: 0, | ||
xPosition: 0, | ||
yPosition: 0, | ||
apiFramework: null, | ||
offset: null, | ||
duration: 0, | ||
type: null, | ||
staticResource: null, | ||
htmlResource: null, | ||
iframeResource: null, | ||
pxratio: '1', | ||
iconClickThroughURLTemplate: null, | ||
iconClickTrackingURLTemplates: [], | ||
iconViewTrackingURLTemplate: null | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { VASTParser } from './parser/vast_parser.js'; | ||
import { VASTClient } from './vast_client.js'; | ||
import { VASTTracker } from './vast_tracker.js'; | ||
|
||
export { VASTClient, VASTParser, VASTTracker }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { parserUtils } from './parser/parser_utils'; | ||
|
||
export function createInteractiveCreativeFile( | ||
interactiveCreativeAttributes = {} | ||
) { | ||
return { | ||
type: interactiveCreativeAttributes.type || null, | ||
apiFramework: interactiveCreativeAttributes.apiFramework || null, | ||
variableDuration: parserUtils.parseBoolean( | ||
interactiveCreativeAttributes.variableDuration | ||
), | ||
fileURL: null | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export function createMediaFile() { | ||
return { | ||
id: null, | ||
fileURL: null, | ||
fileSize: 0, | ||
deliveryType: 'progressive', | ||
mimeType: null, | ||
mediaType: null, | ||
codec: null, | ||
bitrate: 0, | ||
minBitrate: 0, | ||
maxBitrate: 0, | ||
width: 0, | ||
height: 0, | ||
apiFramework: null, // @deprecated in VAST 4.1. <InteractiveCreativeFile> should be used instead. | ||
scalable: null, | ||
maintainAspectRatio: null | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export function createMezzanine() { | ||
return { | ||
id: null, | ||
fileURL: null, | ||
delivery: null, | ||
codec: null, | ||
type: null, | ||
width: 0, | ||
height: 0, | ||
fileSize: 0, | ||
mediaType: '2D' | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export function createNonLinearAd() { | ||
return { | ||
id: null, | ||
width: 0, | ||
height: 0, | ||
expandedWidth: 0, | ||
expandedHeight: 0, | ||
scalable: true, | ||
maintainAspectRatio: true, | ||
minSuggestedDuration: 0, | ||
apiFramework: 'static', | ||
adType: 'nonLinearAd', | ||
type: null, | ||
staticResource: null, | ||
htmlResource: null, | ||
iframeResource: null, | ||
nonlinearClickThroughURLTemplate: null, | ||
nonlinearClickTrackingURLTemplates: [], | ||
adParameters: null | ||
}; | ||
} | ||
|
||
export function isNonLinearAd(ad) { | ||
return ad.adType === 'nonLinearAd'; | ||
} |
Oops, something went wrong.