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

Error in vast.js code


Hi, guys

I could not find your vast.js code on github, so probably it is not open source.
I just found a bug in your code and wanted to let you know about it.
In vast.js in routine destroy() you have the following code (obfuscated, but still obvious):
` l.each(n.Listeners, n.vpaidAd.unsubscribe)`
which, i believe, should be written as
` l.each(n.Listeners, n.vpaidAd.unsubscribe, n.vpaidAd)`

Thanks,
And sorry for bothering if you have fixed this already.

3 Community Answers

Todd

JW Player Support Agent  
0 rated :

Thanks. I’ll escalate this to our engineers and let you know what feedback they have.

Todd

JW Player Support Agent  
0 rated :

Thanks for pointing us in this direction, but what is it that you see is broken? Can you provide a link to a reproduction page? Please see http://support.jwplayer.com/customer/en/portal/articles/2186238-troubleshooting-creating-a-reproduction-page for more details on what we would like to see on a such a reproduction page.

prontiol

User  
0 rated :

Your `each` implementation has the following signature:
`each(array, func, context)`
Calling it without the `context` argument and passing an object method as the second one causes `each` to call it without context, so any code in `vpaid.unsubscribe()` which relies on `this` will fail, as `this` will be undefined.
I don't have a sample code right now sorry and I am not sure If i have time to craft one, but any javascript developer will understand, what am I talking about, I assure you.

This question has received the maximum number of answers.