Talk:Fb:silverlight

From Facebook Developers Wiki

Jump to: navigation, search

This tag does not work. Bug #1392 has been opened to track this issue:

Summary: My Conclusion the <fb:silverlight/> tag isn't there yet. i'd love to know if this tag is in the process of being updated.

I did a little research into this by reverse engineering "createsilverlight.js" and "silverlight.js" which are included scripts on a facebook page. If you look at the html generated by the tag in the FBML test console you can see that a call to createSilverlightControl(...) is made. This in turn calls Sys.Silverlight.CreateObject(....). This is where I suspect things are going wrong - the version parameter is hardcoded here to "0.9". I believe this is an old version of silverlight. On a brand new Silverlight 1.0 install my version number is 1.0.30109.0.

The version number is important. If you look in facebooks silverlight.js file a call at around line 62 is

if(Sys.Silverlight.isInstalled(slProperties.version) // generate the needed html else // show the install silverlight html

Note: the value of slProperties.version is the 0.9 which was passed in. So this call fails the html is never generated and the install thing is always shown. I also investigated the Sys.Silverlight.isInstalled which is the "detectAgControlVersion()" function which starts at line 7. In my tests this always returns -1 so we always show the install silverlight script. The "detectAgControlVersion()" attempts to return a version by sniffing browser and the browsers plugin. In mty tests I am using firefox and it sniffs for a ""WPFe Plug-In" plugin for the version. This may have been the old version of the silverlight plugin but it isn't the plugin anymore. I believe this function needs to be refactored to take into account new plugins etc.

For test purposes I edited a local version of the facebook.js file and made it always pass the check to generate html and I can get it to display the silverlight control in firefox. I used the .xaml location as the silverlightsrc. However it didn;t look like any of my events were wired up.

//if(Sys.Silverlight.isInstalled(slProperties.version) if(1==1) // generate the needed html else // show the install silverlight html

[edit] Silverlight 2.0?

I'm guessing from the comment above then that Silverlight 2.0 isn't supported?

Any ideas when the tag is going to be fixed? Lots of nice things can be done with silverlight - its a shame it's not working...

I was going over the FB platform sources and silverlight is never mentioned there. I hope that it is going to be supported in the future.