Skip to content

Commit

Permalink
Static vast tag for mobile rendering API for rewarded video (#148)
Browse files Browse the repository at this point in the history
* the static vast tag for mobile rendering API for rewarded video

* update gulpfile to handle static vast XML file in build process

Co-authored-by: Yuriy Velichko <yuriy.velichko@openx.com>
Co-authored-by: Jason Snellbaker <jsnellbaker@appnexus.com>
  • Loading branch information
3 people authored Dec 8, 2021
1 parent 1b77ada commit 6c65b1b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ function buildUid() {
.pipe(gulp.dest('dist'));
}

function includeStaticVastXmlFile() {
let target = gulp.src('static/prebid-mobile-rewarded-vast.xml');
return target.pipe(gulp.dest('dist'));
}

// Run the unit tests.
//
// By default, this runs in headless chrome.
Expand Down Expand Up @@ -200,7 +205,7 @@ function setupE2E(done) {

gulp.task('test', gulp.series(clean, test));

gulp.task('e2e-test', gulp.series(clean, setupE2E, gulp.parallel(buildDev, buildCookieSync, buildCookieSyncWithConsent, buildNativeDev, buildNativeRenderDev, buildUidDev, watch), test));
gulp.task('e2e-test', gulp.series(clean, setupE2E, gulp.parallel(buildDev, buildCookieSync, buildCookieSyncWithConsent, buildNativeDev, buildNativeRenderDev, buildUidDev, includeStaticVastXmlFile, watch), test));

function watch(done) {
const mainWatcher = gulp.watch([
Expand All @@ -215,17 +220,17 @@ function watch(done) {
root: './'
});

mainWatcher.on('all', gulp.series(clean, gulp.parallel(buildDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev), test));
mainWatcher.on('all', gulp.series(clean, gulp.parallel(buildDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev, includeStaticVastXmlFile), test));
done();
}

function openWebPage() {
return opens(`${(argv.https) ? 'https' : 'http'}://localhost:${port}`);
}

gulp.task('serve', gulp.series(clean, gulp.parallel(buildDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev, watch, test), openWebPage));
gulp.task('serve', gulp.series(clean, gulp.parallel(buildDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev, includeStaticVastXmlFile, watch, test), openWebPage));

gulp.task('build', gulp.parallel(buildProd, buildCookieSync, buildCookieSyncWithConsent, buildNative, buildNativeRender, buildUid));
gulp.task('build', gulp.parallel(buildProd, buildCookieSync, buildCookieSyncWithConsent, buildNative, buildNativeRender, buildUid, includeStaticVastXmlFile));

gulp.task('test-coverage', (done) => {
new KarmaServer(karmaConfMaker(true, false, false), newKarmaCallback(done)).start();
Expand Down
22 changes: 22 additions & 0 deletions static/prebid-mobile-rewarded-vast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<VAST version="2.0">
<Ad id="PrebidMobileAppEvent">
<InLine>
<AdSystem version="1.0">Prebid org</AdSystem>
<AdTitle>PrebidAppEvent</AdTitle>
<Impression><![CDATA[https://test.url.com]]></Impression>
<Creatives>
<Creative>
<Linear>
<Duration>00:00:02</Duration>
<MediaFiles>
<MediaFile delivery="progressive" height="540" id="539733616" type="video/mp4" width="960">
<![CDATA[https://test.url.com/gam_rewarded.mp4]]>
</MediaFile>
</MediaFiles>
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>

0 comments on commit 6c65b1b

Please # to comment.