Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

withCredentials with vast client


Hi,

JW 6.8 Player with vast-client.
How can we set withCredentials=true?

Thanks,
LN

11 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

What is withCredentials used for?

JW Player

User  
0 rated :

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

JW Player

User  
1 rated :

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

JW Player

User  
0 rated :

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




Ethan Feldman

JW Player Support Agent  
0 rated :

I can ask.

JW Player

User  
0 rated :

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.

JW Player

User  
0 rated :

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

Ethan Feldman

JW Player Support Agent  
0 rated :

We will have this fixed for 6.9.

JW Player

User  
0 rated :

Thanks Ethan

JW Player

User  
0 rated :

Thanks for the positive information, Ethan.
When is the next release 6.9 planned for?

Ethan Feldman

JW Player Support Agent  
0 rated :

Np. End of May.

This question has received the maximum number of answers.