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

Player re-compiling


Dear Sirs!

We are paying for adv version. Is it possible to get a variable from XML VAST file to the JS?
If it is not possible may we ask you to re-complile player with the string something like that (must be additionally validated):

var yaID:String = String(_vpaidXML.Extensions.Extension(@type == 'yaID'));
if(yaID)
{
flash.external.ExternalInterface.call('function d(){if(typeof Ya != "undefined" && typeof Ya.Metrika != "undefined"){new Ya.Metrika({"id":'+yaID+', "clickmap":true, "trackLinks":true, "accurateTrackBounce":true, "trackHash":true});}}');
}

Thanks in advance!

Sincerely,
Andrew Gora.

P.S. Something wrong with the http://www.jwplayer.com/.

12 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you mean you want to pass in a vast xml response as an ad tag?

i...

User  
0 rated :

Hi Ethan!

I need to pass a value of a variable from VAST XML to JavaScript.

I mean this VAST XML:
advertising: {
client: "vast",
tag: "http://domain.com/vast.xml"
},

Ethan Feldman

JW Player Support Agent  
0 rated :

There is an easier way to do this.

You can set something like var tag1 = “full_vast_response”;

Then use:

vasttag: tag1

Ethan Feldman

JW Player Support Agent  
0 rated :

Sorry, vastxml, not vasttag

i...

User  
0 rated :

Thanks! You give me a hope. But I have to ask for some clarifications. Do You mean this config?
advertising: {
client: "vast",
tag: "http://domain.com/vast.xml",
vastxml: tag1
}
?
And where I should define var tag1 = “full_vast_response” and what does it mean?

For example, player receives XML as an advertising:{tag:...} (shortened):
<?xml?>
<VAST>
<Ad id="1">
<InLine>
<Extensions>
<Extension type="uID"><![CDATA[ 123 ]]></Extension>
</Extensions>
</InLine>
</Ad>
</VAST>

Just for info: one can get the value of uID in ActionScript 3 like this:
var uID:String = String(_vpaidXML..Extensions.Extension.(@type == 'uID'));

How I can get it in Javascript of the page in order to use in the next page processing?

Ethan Feldman

JW Player Support Agent  
0 rated :

So, this line:

tag: “http://domain.com/vast.xml”,

Should be:

vastxml: tag1

And var tag1 = should be on the page before the setup.

You would put the full xml for the vast tag in here as tag1. Does that make sense?

i...

User  
0 rated :

I get the idea: it is possible to give to the player not only a URL of the XML file, but also a XML itself as a content of variable tag1.

Thanks a lot, Ethan! I will try and reply.

Ethan Feldman

JW Player Support Agent  
0 rated :

Exactly.

Np.

i...

User  
0 rated :

Ethan,

Is it possible to assign "vastxml" after player finish rendering?
Like jwplayer().playAd("url") ?

Ethan Feldman

JW Player Support Agent  
0 rated :

I don’t believe so, I think it has to be done on setup only.

i...

User  
0 rated :

Its a pity, but this is not working: http://io.ua/tb.html
The same with the direct adv tag works OK: http://io.ua/tb.html

I send String not Object: string = (new XMLSerializer()).serializeToString(response);

If I send Object: response = req.responseXML.documentElement;
then player returns an error.

Ethan Feldman

JW Player Support Agent  
0 rated :

Where are you setting str_xml ?

This question has received the maximum number of answers.