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

Input direct VAST-XML


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.

3 Community Answers

Randy

JW Player Support Agent  
0 rated :

Hello,

I will confirm this with our engineering team to confirm the use case. Thank you for your patience.

Randy

Alex

User  
0 rated :

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)
}
});

Randy

JW Player Support Agent  
0 rated :

Hello Alex,

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:

advertising: {client: “vast”,vastxml: “vastad1.xml,vastad2.xml,vastad3.xml,”}

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.