MailOnline / videojs-vast-vpaid

video.js vast plugin
MIT License
296 stars 231 forks source link

Does this plugin support Adsense preroll ads? #204

Open prock13 opened 8 years ago

prock13 commented 8 years ago

I believe adsense uses Google IMA. Would this plugin support it? I'm doing some testing and I'm getting Cross-origin Request Blocked.

Here is my sample link: http://dev.salvogroup.co/videojs/vastdemo2/

prock13 commented 8 years ago

It will not play any of these types of Google sample preroll tags: http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=xml_vmap1&unviewed_position_start=1&cust_params=sample_ar%3Dpremidpostpod%26deployment%3Dgmf-js&cmsid=496&vid=short_onecue&correlator=

Fetz commented 8 years ago

If is VAST/VPAID it should work. Now regarding why you are getting CORS you should check with google.

If you need more details: If you having a cross domain request blocked with flash, please check this comment:

https://github.com/MailOnline/videojs-vast-vpaid/issues/102

What I recommend is that you contact you ad provider.

From http://www.iab.com/wp-content/uploads/2015/06/VASTv3_0.pdf see page 16

2.1.5.2 Cross Origin Resource Sharing (CORS) for JavaScript

In order for JavaScript video players to accept a VAST response, ad servers must include a CORS header in the http file that wraps the VAST response. The CORS header must be formatted as follows:

Access-Control-Allow-Origin: <origin header value>
Access-Control-Allow-Credentials: true

These HTTP headers allow an ads player on any origin to read the VAST response from the ad server origin. The value of Access-Control-Allow-Origin should be the value of the Origin header sent with the ad request. Setting the Access-Control-Allow-Credentials header to true will ensure that cookies will be sent and received properly. For more information, visit http://www.w3.org/TR/cors

This didn't happened with the flash video players, because flash uses another way to allow/block cross origins resources see page 15