the silverlight plugin
Everybody hates Flash, don't they?
Here is how to get out of it, and present the Lytro’s Living Pictures on your site:
- Download the Silverlight application: LightFieldPlayer.xap
- If you do not have any other Silverlight applications, you might also want to improve the client experience with the plugin installation script: Silverlight.js
- Put the files on your website.
- In the Lytro Desktop software, right click on the image you want to show on your page and select Export.... In the Save as type drop down, select Stack Lfp (*.lfp) and save the file to the folder with the application. (If you do not have the desktop software, the stacklq.lfp file from the Lytro library can be used, but it has much worse quality.)
In older versions, you might look for the IMG_####-stk.lfp file in the Lytro library. It is important to take the STK version without H.264 frames, the application will not display any other files. Put it to the folder with the application.
- On the place where you want to show your picture, put the following code:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="500" height="500">
<param name="source" value="TheSilverlightPlugin/LightFieldPlayer.xap" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="5.0.61118.0" />
<param name="autoUpgrade" value="true" />
<param name="initParams" value="lfp=IMG_####-stk.lfp,thumb=pic_#####.jpg" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none" />
</a>
</object>
- Set the initParams’ lfp variable to the STK file from step 4. If you have a thumbnail to display until the Living Picture loads, set it in the thumb variable ibidem. If not, just remove the thumb variable.
- Deploy and enjoy. You should include a disclaimer on the page, that your not affiliated with or endorsed by Lytro, Inc. in any way (until the SDK becomes officially available).
supported variables
The following list of variables is supported in the initParams parameter of the object, use the variable1=value1,variable2=value2 syntax.
lfp |
Mandatory. A relative or absolute URI to the LFP file. If the file is in the same folder as the Silverlight application, just the file name is enough. The file itself must contain prerendered images, which is usually indicated by the name ending with -stk.lfp. |
thumb |
A relative URI to the thumbnail image to display until the LFP file loads completely. The file can be any image format supported by the Silverlight runtime. It must be, however, in the folder of the application (or any subfolder). |
caption |
Text to display at the bottom of the picture. Obviously it cannot contain comma directly, but it can be URL encoded (%2c). |
photographer |
Header to display at the bottom of the picture. Commas must be URL encoded. The caption variable must be set to make the header visible. |
defaultLambda |
Overrides the initial focus plane stored in the lfp file. The nearest prerendered plane available will be shown. |
showSlider |
True to display slider to control the focus plane in addition to clicking on the picture. Default is False. |
duration |
Number of milliseconds for the refocus animation (and others). Use 0 to disable animations. Default is 1000. |
stretch |
How to display the picture if its dimensions do not match the dimensions of the Silverlight object. Allowed values are None, Uniform, UniformToFill and Fill. Default is Uniform. |
radius |
Rounded corners radius. Default is 0 (not rounded). |
culture |
Overrides the plug-in culture. This value is used for numbers and dates formatting, currently without visible effect. Default depends on the visitor’s preference. |
uiculture |
Overrides the plug-in interface culture. This value is used for loading resources and can be used to force a localization language. Default depends on the visitor’s preference. |
notes
Sliverlight version 5 is required. Supported languages are English, Czech (čeština) and Tamil (தமிழ்). Let me know if you would be interested in localizing into another languages.
This plugin was not approved by Lytro, Inc.
Disclaimer: Jan Kučera and miloush.net are not affiliated with or endorsed by Lytro, Inc.