-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Update dfp.buildVideoUrl to accept adserver url #1663
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
82e1623
Update dfp.buildVideoUrl to accept adserver url
matthewlane 8e331ae
Reject invalid param usage
matthewlane 8935da5
Don't overwrite description_url if cache is disabled and input contai…
matthewlane 26a1449
Reject xml-only bids when cache is disabled
matthewlane 5ed48ac
Accept both url and params object in function call
matthewlane 9e6d46f
Fix conflict and nobid condition
matthewlane b6d8b5c
Update docs and refactor based on code review
matthewlane 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 hidden or 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 hidden or 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 hidden or 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,5 +1,6 @@ | ||
| import { videoAdapters } from './adaptermanager'; | ||
| import { getBidRequest, deepAccess } from './utils'; | ||
| import { getBidRequest, deepAccess, logError } from './utils'; | ||
| import { config } from '../src/config'; | ||
|
|
||
| const VIDEO_MEDIA_TYPE = 'video'; | ||
| const OUTSTREAM = 'outstream'; | ||
|
|
@@ -32,6 +33,15 @@ export function isValidVideoBid(bid) { | |
| // if context not defined assume default 'instream' for video bids | ||
| // instream bids require a vast url or vast xml content | ||
| if (!bidRequest || (videoMediaType && context !== OUTSTREAM)) { | ||
| // xml-only video bids require prebid-cache to be enabled | ||
| if (!config.getConfig('usePrebidCache') && bid.vastXml && !bid.vastUrl) { | ||
|
Contributor
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. very good idea. This makes the cache & no-cache workflows much more smooth... I'm a little embarrassed I never thought of it. |
||
| logError(` | ||
| This bid contains only vastXml and will not work when prebid-cache is disabled. | ||
| Try enabling prebid-cache with pbjs.setConfig({ usePrebidCache: true }); | ||
| `); | ||
| return false; | ||
| } | ||
|
|
||
| return !!(bid.vastUrl || bid.vastXml); | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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
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.
Looks like the JSDoc types need some updating for this. The
DfpVideoOptionsstill says thatparamsis required, and doesn't mentionurlat all.