-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prebid Core: Define "VIDEO" compile time feature flag #9543
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b85c4e4
Define "VIDEO" compile time feature flag
mbcrute 2aea3ff
tag out adpod-related logic
mbcrute 7cc810c
replace callPrebidCache with getHook result
mbcrute 695eeeb
tag out video-related code in renderAd
mbcrute 78cf540
tag out video-related code in native.js
mbcrute f3b2ab0
tag out ORTB video conversion utils
mbcrute 1afb17f
remove unnecessary feature tag
mbcrute 0730587
tag out markWinningBidAsUsed entirely
mbcrute 8fbdaa4
revert
mbcrute 86fb9c2
Merge branch 'master' into optional-video-compilation
mbcrute 2e105a3
trigger build
mbcrute 06e516d
Merge branch 'master' into optional-video-compilation
mbcrute 8ed51d2
fix lint and test failures
mbcrute File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[ | ||
"NATIVE" | ||
"NATIVE", | ||
"VIDEO" | ||
] |
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
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
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
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
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 |
---|---|---|
|
@@ -225,14 +225,17 @@ function validateAdUnit(adUnit) { | |
export const adUnitSetupChecks = { | ||
validateAdUnit, | ||
validateBannerMediaType, | ||
validateVideoMediaType, | ||
validateSizes | ||
}; | ||
|
||
if (FEATURES.NATIVE) { | ||
Object.assign(adUnitSetupChecks, {validateNativeMediaType}); | ||
} | ||
|
||
if (FEATURES.VIDEO) { | ||
Object.assign(adUnitSetupChecks, { validateVideoMediaType }); | ||
} | ||
|
||
export const checkAdUnitSetup = hook('sync', function (adUnits) { | ||
const validatedAdUnits = []; | ||
|
||
|
@@ -248,7 +251,7 @@ export const checkAdUnitSetup = hook('sync', function (adUnits) { | |
if (mediaTypes.banner.hasOwnProperty('pos')) validatedBanner = validateAdUnitPos(validatedBanner, 'banner'); | ||
} | ||
|
||
if (mediaTypes.video) { | ||
if (FEATURES.VIDEO && mediaTypes.video) { | ||
validatedVideo = validatedBanner ? validateVideoMediaType(validatedBanner) : validateVideoMediaType(adUnit); | ||
if (mediaTypes.video.hasOwnProperty('pos')) validatedVideo = validateAdUnitPos(validatedVideo, 'video'); | ||
} | ||
|
@@ -995,21 +998,23 @@ $$PREBID_GLOBAL$$.getHighestCpmBids = function (adUnitCode) { | |
* @alias module:pbjs.markWinningBidAsUsed | ||
*/ | ||
$$PREBID_GLOBAL$$.markWinningBidAsUsed = function (markBidRequest) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may be just a stylistic difference, but I think it'd be better to not have this method rather than have it silently do nothing. |
||
let bids = []; | ||
|
||
if (markBidRequest.adUnitCode && markBidRequest.adId) { | ||
bids = auctionManager.getBidsReceived() | ||
.filter(bid => bid.adId === markBidRequest.adId && bid.adUnitCode === markBidRequest.adUnitCode); | ||
} else if (markBidRequest.adUnitCode) { | ||
bids = targeting.getWinningBids(markBidRequest.adUnitCode); | ||
} else if (markBidRequest.adId) { | ||
bids = auctionManager.getBidsReceived().filter(bid => bid.adId === markBidRequest.adId); | ||
} else { | ||
logWarn('Improper use of markWinningBidAsUsed. It needs an adUnitCode or an adId to function.'); | ||
} | ||
if (FEATURES.VIDEO) { | ||
let bids = []; | ||
|
||
if (markBidRequest.adUnitCode && markBidRequest.adId) { | ||
bids = auctionManager.getBidsReceived() | ||
.filter(bid => bid.adId === markBidRequest.adId && bid.adUnitCode === markBidRequest.adUnitCode); | ||
} else if (markBidRequest.adUnitCode) { | ||
bids = targeting.getWinningBids(markBidRequest.adUnitCode); | ||
} else if (markBidRequest.adId) { | ||
bids = auctionManager.getBidsReceived().filter(bid => bid.adId === markBidRequest.adId); | ||
} else { | ||
logWarn('Improper use of markWinningBidAsUsed. It needs an adUnitCode or an adId to function.'); | ||
} | ||
|
||
if (bids.length > 0) { | ||
bids[0].status = CONSTANTS.BID_STATUS.RENDERED; | ||
if (bids.length > 0) { | ||
bids[0].status = CONSTANTS.BID_STATUS.RENDERED; | ||
} | ||
} | ||
}; | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be unnecessary, if all the calls into this are skipped the function should already be removed as dead code.