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

Parsing VAST from a string


Hi,

Does jwplayer support parsing a vast xml payload given as a string rather than a url?

In my case I have my backend returning me the vast xml payload as part of a concatenated payload. So in this case I can't provide a url for the jwplayer instance to fetch it from the net and parse on its own. I was wondering whether there is an API call that I can make use of, as it's not clear from the documentation.

Thanks,
Billy Janes.

3 Community Answers

George

JW Player Support Agent  
0 rated :

Hello Billy,

You could do something like this:

advertising: {
client:“vast”,
schedule:{
adbreak1: {
offset:“pre”,
ad: {
source: “vast”,
vastxml: vastString
}
}
}
}

Billy Janes

User  
0 rated :

Hi,

Thanks for the reply. I tried that, but the player never played the ad. i tried by either calling that .play() or even the .playAd(). Any suggestions? These are my settings;


{
file: "..initial mp4 url..",
image: void 0,
width: 500,
height: 282,
autostart: false,
controls: true,
primary: 'html5',
repeat: false,
aboutText: ABOUT_TEXT,
aboutLink: ABOUT_LINK,
advertising: {
client:"vast",
schedule:{
adbreak1: {
offset:"pre",
ad: {
source: "vast",
vastxml: decodeURIComponent("..VAST payload here encoded..")
}
}
}
}
}

George

JW Player Support Agent  
0 rated :

Do you have an ads account?
What email address is associated to the account?
Any way I can see a test page?

This question has received the maximum number of answers.