withCredentials with vast client
Hi,
JW 6.8 Player with vast-client.
How can we set withCredentials=true?
Thanks,
LN
Hi,
JW 6.8 Player with vast-client.
How can we set withCredentials=true?
Thanks,
LN
What is withCredentials used for?
Hi,
it is need to set cookies. The adserver needs cookies for frequency capping and targeting.
withCredentials:
Standard CORS requests do not send or set any cookies by default. In order to include cookies as part of the request, you need to set the XMLHttpRequests .withCredentials property to true:
http://www.html5rocks.com/en/tutorials/cors/
Regards,
Loan
Hi LN,
We were also facing similar issue and we added the withCredentials=true in jwplayer.js file.
Here are the details.
Just search for this code:
var g=j=new f.XMLHttpRequest,t=a;j.onreadystatechange=function(){if(4===g.readyState)switch(g.status){case 200:alert(b+"--"+d+"--"+k);l(g,t,b,d,k)();break;case 404:d("File not found")}}
add j.withCredentials = true; just before j.onreadystatechange=function().
Regards
Shilpa
Hi Shilpa,
thanks a lot for your help and response.
But should it not be set as a standard property in jwplayer.js?
It means, that every platform, who uses jw 6.8 has to host the jwplayer.js and every update on this script will be lost. Is it correct?
@Ehtan: is it possible to set withCredentials as a standard property in jwplayer.js?
Kind regards,
Loan
I can ask.
Loan ,
You are correct. You need to make changes and host jwplayer file at your end.
Loan / Ethan,
Need to you be careful while setting credential. VAST tag won't load and error will be thrown "A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true" if VAST server is returning header "Access-Control-Allow-Origin: *" in http response.
We noticed this issue while using Optimatic and MediaMind Vast tags. May be JWPlayer team need to come up with some clean way to handle this.
Hi Nitesh,
thanks, but its not my question.
I would just like to set withCredentials to get cookies from our adserver.
Our adserver supports CORS and set the Access-Control-Allow-Origin correctly with the origin sending by the header-request and Access-Control-Allow-Credentials:true.
For example, Mediamind supports it already for us in Germany.
Its just depends on the configuration of the server.
I hope we can get a solution to set withCredentials.
Kind regards,
Loan
We will have this fixed for 6.9.
Thanks Ethan
Thanks for the positive information, Ethan.
When is the next release 6.9 planned for?
Np. End of May.