Hello, is it possible to put the vast-xml code directly to the player without put the url in there.
I want to ask more than one vast-url simultaneously and the first who return a code with an ad should play the ad. For this the response code must be directly put into the player.
The waterfalling method will do this sequentially.
var _is = function(browserid) { return navigator.userAgent.toLowerCase().indexOf(browserid) >= 0; }
// small workaround for ie/safari if (_is('msie') || _is('safari') || _is('trident') || _is('edge')) { var jwplayerAjax = jwplayer.utils.ajax;
jwplayer.utils.ajax = function(xmldocpath, completecallback) { if (0 === xmldocpath.indexOf('data:')) { var text = atob(xmldocpath.split('base64,')[1]); var xhr = { status: 200, readyState: 4, responseText: text, responseXML: jwplayer.utils.parseXML(text) };
completecallback(xhr); return xhr; }
return jwplayerAjax.apply(this, arguments); } }
// you can pass VAST XML as data-uri string jwplayer('container_id').setup({ ... "advertising": { "client": "vast", "tag": "data:text/xml;base64," + btoa(your xml here) } });
Sorry for the delay on this as I have been working with our engineering team to provide a solution on this. It seems there may be a potential way to use a specific parameter such as: vastxml: XML string…. which would allow the use of various ad tags within the advertising block but this is an undocumented way of trying to achieve this and is not officially supported. This parameter would be used instead of the tag parameter within the advertising block like so:
This would however negate some of the features you might have used in the past such as seeking within VPAID and will not work as expected with vast wrappers.
Please let me know how this works for you.
Kindly,
Randy Lemoine
Primary Support Engineer
JW Player Support Team
www.jwplayer.com
This question has received the maximum number of answers.