当开发者或设计师完成Silverlight一个应用程序后,最关心的无疑是如何将我的Silverlight应用程序第一时间发布在网络上,http://silverlight.live.com为开发者和设计师提供了一个Silverlight应用程序的托管部署平台,它是微软官方提供的免费Silverlight应用程序托管平台,它具有以下特点:
每个文件上传增大到了约100M,满足开发者上传较大的多媒体文件
视频流传输速度为1400kbps,满足高清多媒体视频流畅回放
简单方便的Silverlight应用程序发布流程
使用Silverlight Streaming平台托管你的Silverlight应用程序之前,你需要将Silverlight编译后的XAP文件和一个manifest.xml文件,打包成一个zip压缩包,manifest.xml(清单)文件中包括Silverlight应用程序运行时的基本信息,例如:源文件名、版本、尺寸等,下面代码是一个最简单的清单文件。
<version>2.0</version>
<source>myapp.xap</source>
<width>400</width>
<height>300</height>
<background>white</background>
<isWindowless>false</isWindowless>
</SilverlightApp>
source
The filename of the main XAML file or the application's XAP file, relative to the directory structure of the ZIP file.
version
The minimum version of the Silverlight runtime required to run your Silverlight application. For example, if you set the value of this element to 1.0, the user must have version 1.0 or greater of the Silverlight runtime to view it. If you leave this value blank, the user will be forced to download the latest Silverlight runtime to run your application.
width
The width of the Silverlight application, expressed in browser units (pixels) or as a percentage value.
height
The height of the Silverlight application, expressed in browser units (pixels) or as a percentage value.
background
A string value specifying the background color for the application frame after the application has loaded and while it is initializing. It may be a named color value or an 8-bit or 16-bit color value, with or without alpha transparency.
backgroundImage
A string value specifying a background p_w_picpath for the application frame after the application has loaded and while it is initializing.
isWindowless
Specifies whether to display the Silverlight control in windowless mode. True or False.
framerate
The maximum number of frames to render per second.
enableHtmlAccess
Specifies whether the hosted content in the Silverlight control has access to the browser Document Object Model (DOM). True or False.
inPlaceInstallPrompt
Determines whether to display an install prompt if the detected version of Silverlight is out of date.
onLoad
The name of a JavaScript function to run when the application has finished loading and the content has rendered. Note that this functionality differs from that of the Silverlight onLoad event, which fires after the application has finished loading but before the content has rendered.
onError
The name of a JavaScript error handling function.
jsOrder
Specifies the order in which JavaScript files will be loaded. Each file should be listed with the relative path name as it appears in the ZIP file. File names and paths are case-sensitive. Any JavaScript files not mentioned will be loaded in an unspecified order after the listed files.
source
主XAML的文件名或者是XAP文件名.相对ZIP包的根目录.
运行这个Silverlight程序所需的最低Silverlight插件版本.比如,当你设置这个值为1.0,用户需要拥有1.0或者更高版本的Silverlight插件才能查看.如果这个值为空白,用户会被强制下载最新的Silverilght插件.
Silverlight程序的宽度,在浏览器中单位为象素(pixels)或者是百分比.
Silverlight程序的高度, 在浏览器中单位为象素(pixels)或者是百分比.
程序框架载入初始化时指定的背景色.可以直接命名色彩值或者是8位16位值,不能设置alpha透明值.
程序框架载入初始化时指定的背景图片.
指定是否在无窗模式中显示Silverlight控件.可设置True或False.
每秒钟最大帧数.
指定是否在Silverlight控件中的内容可以访问DOM.可设置True或False.
决定在侦测到Silverlight版本过期后是否显示安装提示.
JavaScript一个事件处理函数.当程序载入完毕内容并已经呈现时运行.它与Silverlight的onLoad事件不同,
onLoad是当程序载入完毕但是在内容完全呈现之前生效.
JavaScript一个事件处理函数
指定需要的运行Silverlight文件.每一个文件都需要列出并包括完整的路径(相对于ZIP包根目录).文件名与路径区分大小写.不包括在列表中的JavaScript文件不会被执行.
<head>
<title>My Silverlight Application</title>
<script type="text/javascript" src="https://controls.services.live.com/scripts/base/v0.3/live.js"></script>
<script type="text/javascript" src="https://controls.services.live.com/scripts/base/v0.3/controls.js"></script>
</head>
<body>
<devlive:slscontrol silverlightVersion="2.0" src="/78099/myapp/">
</body>
</html>