src/auction.js
function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded) {
  let addBid = true;

  const bidderRequest = getBidRequest(bidResponse.requestId, [bidRequests]);
  const videoMediaType =
  bidderRequest && deepAccess(bidderRequest, 'mediaTypes.video');
  const context = videoMediaType && deepAccess(videoMediaType, 'context');

  if (config.getConfig('cache.url') && context !== OUTSTREAM) {
    if (!bidResponse.videoCacheKey) {
      addBid = false;
      callPrebidCache(auctionInstance, bidResponse, afterBidAdded, bidderRequest);
    } else if (!bidResponse.vastUrl) {
      utils.logError('videoCacheKey specified but not required vastUrl for video bid');
      addBid = false;
    }
  }
  if (addBid) {
    addBidToAuction(auctionInstance, bidResponse);
    afterBidAdded();
  }
}
function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded) {
  let addBid = true;

  const bidderRequest = getBidRequest(bidResponse.requestId, [bidRequests]);
  const videoMediaType =
  bidderRequest && deepAccess(bidderRequest, 'mediaTypes.video');
  const context = videoMediaType && deepAccess(videoMediaType, 'context');

  if (config.getConfig('cache.url') && context !== OUTSTREAM) {
    if (!bidResponse.videoCacheKey) {
      addBid = false;
      callPrebidCache(auctionInstance, bidResponse, afterBidAdded, bidderRequest);
    } else if (!bidResponse.vastUrl) {
      utils.logError('videoCacheKey specified but not required vastUrl for video bid');
      addBid = false;
    }
  }
  if (addBid) {
    addBidToAuction(auctionInstance, bidResponse);
    afterBidAdded();
  }
}
function tryAddVideoBid ( auctionInstance , bidResponse , bidRequests , afterBidAdded ) { let addBid = true ; const bidderRequest = getBidRequest ( bidResponse . requestId , [ bidRequests ] ) ; const videoMediaType = bidderRequest && deepAccess ( bidderRequest , 'mediaTypes.video' ) ; const context = videoMediaType && deepAccess ( videoMediaType , 'context' ) ; if ( config . getConfig ( 'cache.url' ) && context !== OUTSTREAM ) { if ( ! bidResponse . videoCacheKey ) { addBid = false ; callPrebidCache ( auctionInstance , bidResponse , afterBidAdded , bidderRequest ) ; } else if ( ! bidResponse . vastUrl ) { utils . logError ( 'videoCacheKey specified but not required vastUrl for video bid' ) ; addBid = false ; } } if ( addBid ) { addBidToAuction ( auctionInstance , bidResponse ) ; afterBidAdded ( ) ; } }
Video bids may fail if the cache is down, or there's trouble on the network.
Video bids may fail if the cache is down or there s trouble on the network .