-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility improvements and new onFinish event #26
base: master
Are you sure you want to change the base?
Conversation
Hi @juanparati, Thanks for the PR. A couple of comments;
|
@Fire-Brand: yes, it resolves the issue, but you haven't cleaned up the PR yet (it is still two changes in one). |
Haven't you merged both my pr1 and pr2 ? |
You haven't submitted them as PRs as far as I can tell? |
I think that adding the It will be better to set it as with some flag, maybe by adding an options object in the |
For some Ads providers is quite important to inject cookies to users. They use the cookies for metrics and retargeting purposes. The only issue using "withCredentials" is that XMLHttpRequest will not work with IE9, this is the reason why I submitted a workaround for IE9. I also observed that big Ad providers Live Rail, Almedia and Tremor Video uses "Access-Control-Allow-Origin". The Ad providers and Ad propagators usually require to specify the domains where the Advertisement is published, and this is reflected in the "Access-Controll-Allow-Origin". I think that we should keep "withCredentials" with value equal to "true" by default and as you proposed we can also add a parameter in order to change the "withCredentials" value. NOTE: If we use "withCredentials" the XMLHttpRequest will miserably fail in IE9, however we can use XDomainRequest for this old web browser. |
@jonhoo : Regarding to the "onFinish" event, I think that is quite important, The reason is that sometimes the Ad provider send empty VAST documents (without linear and non-linear ads), so the "onFetched" and "onError" event is never raise. If you implement VAST in a video player that should start to play when the Ad is returned, the video player can wait until the infinity waiting for "onFetched" call. In order to avoid the "infinity waiting" problem I had two solutions:
The first solution is quite dirty and it will not work on mobile devices, because mobile devices require human intervention in order to play videos (You cannot autoplay videos in mobile devices, it is an intentional limitation), in the moment that you attach a timer to the "Play" button click event, the video play will become broken. This is the reason why is so quite important to have an "onFinished" event. |
@juanparati I agree that cookies are important and should be added to this library. Nevertheless, I think that this breaks the default behavior currently used, and could lead to dangerous behavior if you already use providers that do not support it. |
Re CORS: I'm happy to add Re |
I think that to use onFetched also as onFinish is also a fair solution, so for example if Ad is not retrieved the onFetched callback can return "null". |
Yeah, something like that. This will break the promise in the existing documentation for |
#34 should help with parts of this. |
Hi John,
I added some compatibility improvements regarding to:
I added the "onFinish" event, that allow to know when the VAST requests was finished and also I improved the CORS request in order to accept cookies (VAST providers usually inject cookies for metrics purposes).