ouyang789987 / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

Youtube: "rel" flashvar not working unless passed in the query string #461

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.

In the following code, the rel flashvar is having no effect on output.
The output is as expected if and only if "rel=0" is included in the call to
embedSWF. Remove it to see the difference.  

ALL other flashvars tested work as expected!  

<script type="text/javascript">
  var flashvars = {};
  flashvars.rel = "0"; // this is having no effect on output        
  var params = {};
  params.allowscriptaccess = "always";
  var attributes = {};
  attributes.id = "myContent";
  // with "rel=0" in the call to embedSWF, output is as expected
  // remove it to see the difference
  swfobject.embedSWF("http://www.youtube.com/v/qybUFnY7Y8w?rel=0"
    , "myAlternativeContent", "560", "340", "9.0.0", false, flashvars
    , params, attributes);
</script>

2.
3.

What is the expected output? What do you see instead?

The "rel" falshvar controls the display of a menu of related videos. The
menu is displayed when the "genie menu" button is pressed on the player
control bar (far right) and when playback completes. 

What version of the product are you using? On what operating system?

Latest version of swfobject. Tested Firefox 3.6 and IE 8.

Please provide any additional information below.

Original issue reported on code.google.com by JJV...@gmail.com on 23 Apr 2010 at 3:14

Attachments:

GoogleCodeExporter commented 9 years ago
Your expected output is not correct. Flashvars and variable added to the 
querystring 
are seperate (but they will both be available to your swf internally on frame 1)

Have a read up on flashvars and how they work...

If you need a var in the querystring for the server to process the information, 
then 
flashvars is not the correct place to add it. Flashvars are for use by the swf 
internally, not the file location URL.

Original comment by aran.rhee@gmail.com on 25 Apr 2010 at 4:21

GoogleCodeExporter commented 9 years ago
OK, thanks for the correction, aran.  I had assumed that parameters in the query
string were passed to the player as flashvars.  I didn't know they were passed
separately. 

But, I think it's strange that all the other "Youtube Embedded Player 
Parameters"
listed in the Google documentation
(http://code.google.com/apis/youtube/player_parameters.html) that I passed as
flashvars worked as expected. This is not a question for this group, but I 
wonder how
a user is supposed to know which ones are NOT flashvars?  Maybe I'll look for 
that
info, or maybe I'll just pass everything in the query string which is what the 
Google
doc prescribes.

Original comment by JJV...@gmail.com on 25 Apr 2010 at 3:24

GoogleCodeExporter commented 9 years ago
No problem.

As per my previous post, I think the only real way to differentiate is to have 
an 
understanding if the var is required by the server to process and deliver 
something 
different back (e.g. deliver a different swf file which has the related videos 
at the 
end from Youtube). Anything which is required by the swf itself should be 
passed as 
flashvars.

The reason is due to caching. If you ask for some.swf?id=1 from the server, and 
then 
next time ask for some.swf?id=3, the browser will treat these as different 
files and 
will have to re-download the entire swf, rather than delivering some.swf from 
cache 
and passing in the different param. If you pass in the id var via flash vars, 
you can 
change this value without affecting your cached file.

Original comment by aran.rhee@gmail.com on 26 Apr 2010 at 1:02

GoogleCodeExporter commented 9 years ago
Hmm. In that case you'd really think the Youtube doc would indicate the 
flashvars.
For one thing, less traffic for them when the cache is used. Anyway ...

Thanks again, aran.

Original comment by JJV...@gmail.com on 26 Apr 2010 at 9:04