Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

AppnexusAst mediaType="video-outstream" not working

Open Deimos01 opened this issue 9 years ago • 0 comments

Type of issue

Error in Prebid core (bidmanager.js). AppnexusAst / video-oustream

Description

There is an incompatibility between the bidder AppnexusAst and an adunit with "video-outstream" as MediaType

Steps to reproduce

Just try this tutorial with the last release (0.26) : http://prebid.org/dev-docs/show-outstream-video-ads.html. For example this simple code :

 var videoAdUnit = {
  code: 'video',
  sizes: [640,480],
  mediaType: 'video-outstream',
  bids: [
    {bidder: 'appnexusAst',
      params: {
        placementId: '5768085',
        video: {
          skippable: true,
          playback_method: [ 'auto_play_sound_off' ]
        }
      }
    }
        ]
    };
    
    pbjs.que.push(function(){
  pbjs.addAdUnits(videoAdUnit);

  pbjs.requestBids({
    timeout : 700,
    bidsBackHandler : function(bids) {
      console.log('got bids back: ');
      console.log(bids);
      if (!bids.video) {
        console.log('no video demand');
      }
      else {
        console.log('we got video demand!');
      }

      // Log the VAST URL, if there is one
      try {
        url = bids.video.bids[0].vastUrl;
        console.log('VAST URL: ');
        console.log(url);
      } catch (e) {} // ignore

    }
  });
});

Actual results

This error in the console : Video bid does not have required vastUrl property

I fixed this error by deleting these lines in bidmanager.js :

 if (bid.mediaType === 'video' && !bid.vastUrl) {
      utils.logError(errorMessage(`Video bid does not have required vastUrl property.`));
      return false;
    }

It's working but I think it's not the best way to solve this error.

Thanks

Deimos01 avatar Jul 18 '17 22:07 Deimos01