Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

swfobject 2 + flvplayer 5 + gapro: Setup?

11 replies [Last post]

This notation does not work. What's the correct way to write it. (I am x-ing out my analytics id). It does work properly without the gapro-1 plugin.

var flashvars = {};
flashvars.image = "../video/joy_websites.jpg";
flashvars.bufferlength = "0";
flashvars.file = "website_final.flv";
flashvars.plugins = "gapro-1";
flashvars.gapro.accountid = "XX-XXXXXX-X";
flashvars.gapro.trackstarts = "true";
flashvars.gapro.trackpercentage = "true";
flashvars.gapro.tracktime = "true";
var params = {};
params.play = "false";
params.loop = "false";
params.quality = "best";
params.scale = "exactfit";
params.wmode = "transparent";
params.bgcolor = "#ffffff";
params.swliveconnect = "false";
params.allowfullscreen = "false";
params.allowscriptaccess = "always";
var attributes = {};
attributes.id = "mpl";
swfobject.embedSWF("../video/player.swf", "player", "300", "240", "9.0.0", "../flash/expressInstall.swf", flashvars, params, attributes);

Where have I gone wrong? I have searched and found no solution.

When using swfobject 2, you don't need to say flashvars.value, you should do it like this:

var flashvars = {
plugins: "gapro-1",
'gapro.accountid': "XX-XXXXXX-X",
};

Etc

Note, when using a flashvar that has a period in it (the ga pro ones), you need to encapsulate it in single quotes.

Thanks. Safe and easy.

Np!

I guess I owe it to people who might think this is a solution. I don't think it is.

The way you suggest I write out the flashvars seems proper but it never displays anything using swfobject 2.2 except the replaced content.

In fact the way I present it is exactly how the swfobject script is generated using the adobe air generator at its repository at http://code.google.com/p/swfobject/.

I can't find any actual working examples using swfobject 2.x that follow your notation. Can you point me in the direction of some actual source I can study?

Okay. Well I found some at http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_dynamic_params.html that follows your notation but it is using swfobject 2.1.

I have to believe 2.2 allows for the same notation. So back to work for me

Here is some sample code

<html>
<head>

<title>SWF2.0 JW 4.0 - Standard</title>

<script type="text/javascript" src="swfobject20.js"></script>

<script type="text/javascript">
var flashvars = {
  width: "700",
  height: "450",
  file: "video.flv"
};
var params = {
  allowfullscreen: "true",
  wmode: "transparent",
  allowscriptaccess: "true"
};
var attributes = {
  id: "longtail",
  name: "longtail"
};
swfobject.embedSWF("player4.swf", "playerspace", "700", "450", "9.0.0",
"expressInstall.swf", flashvars, params, attributes);
</script>
</head>

<body >

<div id='playerspace' name='playerspace'></div>

</body>
</html>

Ethan,
Can you provide an example of how to use the gapro vars when using this notation

flashvars.backcolor = "6d7947";
flashvars.lightcolor = "d47612";
flashvars.controlbar = "over";
flashvars.plugins = "gapro-1";

I tried

flashvars.'gapro.accountid' = "UA-xxxx-xx";

but that doesn't work. Thanks.

Can you provide a link?

it's behind a firewall as its a test server. We are using the licensed player and licensed GA plugin. Here is the entire code if that helps. Also is there a way to host the plugin locally so we are not making a call to your server each time?

<script type="text/javascript">
var flashvars = {};
flashvars.streamer = "rtmp://servername/appname";
flashvars.file = "filename.flv";
flashvars.stretching = "exactfit";
flashvars.bufferlength = "6";
flashvars.plugins = "gapro-1";
flashvars.'gapro.accountid' = "UA-xxxx-xx"; <-- when I add this the player doesnt work
var params = {};
params.play = "false";
params.menu = "false";
params.scale = "exactfit";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "player";
swfobject.embedSWF("player.swf", "videodiv", "364", "200", "9.0.0", expressInstall.swf", flashvars, params, attributes);
</script>

To host the plugin locally you can just put the file on your server and reference the absolute URL of the plugin.

I really need to see a test link to be able to replace this/debug this.

Use the Forum search boxes.

This has been explained many times!

flashvars['gapro.accountid'] =