Embed and fine-tune Silverlight on your website

Contribution.HolisticWare.SilverlightPlayer provides an advanced player for Silverlight files on web pages (developed by HolisticWare).

The player is highly configurable via a set of its function's input parameters. You can set the DOM IDs for the Silverlight object, specify the required data type attributes, control the minimum version and upgrade of the player plug-in, control what JavaScript functions to call on specific events, how to present the Silverlight object and other parameters.

Microsoft Silverlight is a development platform for creating and running Web, desktop and mobile applications.

How to implement

  1. Edit a page.
  2. Add the Contribution.HolisticWare.SilverlightPlayer function ( Insert > Function) or insert the following code on the page:
     
    <f:function name="Contribution.HolisticWare.SilverlightPlayer" xmlns:f="http://www.composite.net/ns/function/1.0"> 
      <f:param name="SourceXAP" value="/Silverlight/test1.xap" /> 
      <f:param name="Width" value="800" /> 
      <f:param name="Height" value="300" /> 
      <f:param name="IdDivSilverlightControlHost" value="silverlightControlHost" /> 
      <f:param name="IdObjectSilverlightControlHost" value="objectSilverlightControlHost" /> 
      <f:param name="Data" value="data:application/x-silverlight-2," /> 
      <f:param name="Type" value="application/x-silverlight-2" /> 
      <f:param name="JSErrorHandler" value="onSilverlightError" /> 
      <f:param name="Background" value="transparent" /> 
      <f:param name="RuntimeMin" value="2.0.40115" /> 
      <f:param name="UpgradeAutomatic" value="true" /> 
      <f:param name="AllowHtmlPopupWindow" value="true" /> 
      <f:param name="EnableHTMLAccess" value="true" /> 
      <f:param name="InitParams" value="dummy=workaround_for_SL4_Bug_change this!!!" /> 
      <f:param name="MaxFrameRate" value="60" /> 
      <f:param name="JSOnFullScreenChanged" value="onFullScreenChanged" /> 
      <f:param name="JSOnLoad" value="onLoad" /> 
      <f:param name="JSOnResize" value="onResize" /> 
      <f:param name="JSOnSourceDownloadComplete" value="onSourceDownloadComplete" /> 
      <f:param name="JSOnSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" /> 
      <f:param name="SplashScreenSource" value="/ClientBin/Logo.xaml" /> 
      <f:param name="Windowless" value="false" /> 
    </f:function>
  3. Set these required parameters:
    • SourceXAP:The address or relative path of either an initial XAML file or XAP (URI) (e.g. "/ClientBin/my.xap")
    • Width: The width of the player (e.g. "800")
    • Height: The width of the player (e.g. "300")
  4. If needed, set one or more optional parameters that configure the embedded Silverlight object:
    • IdDivSilverlightControlHost: The DOM ID of the div tag holding a Silverlight object ("silverlightControlHost" by default)
    • IdObjectSilverlightControlHost: The DOM ID of the Silverlight object("objectSilverlightControlHost" by default)
    • Data: The data attribute and its value recommended to avoid performance issues on some browsers ("data:application/x-silverlight-2," by default). Note the trailing comma in the data value, which indicates a second data parameter that has an empty value.
    • Type: The type attribute required ("application/x-silverlight-2" by default)
    • JSErrorHandler: Error handler for parse and native code run-time errors [JavaScript function name] ("onSilverlightError" by default)
    • Background: The plug-in background color. The color can be with or without alpha (RGB, ScRGB)] ("transparent" (null, white) by default)
    • RuntimeMin: The minimum version of the Silverlight plug-in required - in string format ("2.0.40115" by default)
    • UpgradeAutomatic: When "true", the plug-in should attempt to upgrade if the minimum runtime version ("RuntimeMin") is greater than the current Silverlight version ("true" by default)
    • AllowHtmlPopupWindow: When "true", the HtmlPage.PopupWindow method is allowed ("true" by default - for applications in the same domain)
    • EnableHTMLAccess: When "true", the plug-in has full access to the browser DOM ("true" by default - for applications in the same domain)
    • InitParams: A user-defined string of parameters - a string or a comma separated string (SL 1.0), comma separated key=value pairs (SL 2) (e.g. "dummy=workaround_for_SL4_Bug_change this!!!")
    • MaxFrameRate: The maximum number of frames per second that the plug-in can render ("60" by default)
    • JSOnFullScreenChanged: The function (a JavaScript function name) to call when the FullScreen property changes ("onFullScreenChanged" by default)
    • JSOnLoad: The function (a JavaScript function name) to call when the plug-in has finished loading in the DOM ("onLoad" by default)
    • JSOnResize: The function (a JavaScript function name) to call when the plug-in size changes ("onResize" by default)
    • JSOnSourceDownloadComplete: The function (a JavaScript function name) to call when the source download has completed ("onSourceDownloadComplete" by default)
    • JSOnSourceDownloadProgressChanged: The function (a JavaScript function name) to call when the source download progress changes ("onSourceDownloadProgressChanged" by default)
    • SplashScreenSource: A XAML page to use as the splash screen (URI) (e.g. "/ClientBin/Logo.xaml")
    • Windowless: The rendering mode for the plug-in for Windows versions of Silverlight. When "true", it is windowless ("false" by default).

Requirements

Composite C1 version 2.0 or later

SHARE