ASP.NET Futures (July 2007): ASP.NET Media and Xaml Server Control Reference
This section provides information about the declarative markup for ASP.NET server
controls that enable Silverlight functionality. The ASP.NET Futures (May 2007) release introduced
the following controls:
Changes have been made to these controls in the ASP.NET Futures (July 2007) release. For details, see the
Reference Change List section.
Provides a XAML-based player that runs media (movie or audio) in an ASP.NET Web page. The player can be represented through
a number of pre-defined skins. The Media server control inherits from the Microsoft.Web.Preview.UI.Controls.Xaml
control.
<asp:Media runat="server"
AutoPlay="true|false"
ScaleMode="None|Zoom|Stretch"
EnableCaptions="true|false"
Height="height"
MediaSkin="skinName"
MediaUrl="URL"
Muted="true|false"
PlaceholderImageUrl="URL"
Volume="volume"
Width="width"
OnClientChapterStarted="functionName"
OnClientMarkerReached ="functionName"
OnClientMediaEnded ="functionName"
OnClientMediaFailed ="functionName"
OnClientMediaOpened ="functionName"
OnClientStateChanged="functionName"
OnClientVolumeChanged="functionName"
>
<Chapters>
<asp:MediaChapter TimeIndex="index Title="title" ImageUrl="URL" />
</Chapters>
</asp:media>
Syntax
Note Members defined in the base class are not defined here. For information about
those members, see the Xaml server control reference.
| Property | Access | Type | Description |
| AutoPlay |
public virtual |
Boolean |
Gets or sets whether the media file should start playing immediately after it is opened.
The default is false. |
| Chapters |
public virtual |
MediaChapterCollection |
Gets the list of chapters in the media file. You can add to the collection or define
the chapters declaratively. |
| EnableCaptions |
public virtual |
Boolean |
Gets or sets whether to enable closed captioning. The default is true. |
| MediaSkin |
public |
MediaSkinType |
Gets or sets an enumeration value that identifies a built-in XAML skin. |
| MediaUrl |
public |
String |
Gets or sets the URL to a media source. The media source can be of any type supported by the
Silverlight player, which includes .wma, .wmv, .mp3, and .asx. |
| Muted |
public virtual |
Boolean |
Gets or sets a value that indicates whether audio should be muted in the player. The default
is false. |
| PlaceholderImageUrl |
public virtual |
String |
Gets or sets the URL (absolute, relative, or application-relative) to the image to display when
the media file is being opened. The image will be replaced by the first screen in the
media after the media file has finished loading. |
| ScaleMode |
public virtual |
ScaleMode |
Overridden. The default is ScaleMode.Zoom. See ScaleMode.
|
| Volume |
public virtual |
Double |
Gets or sets the volume setting as a value between 0 and 1. |
| OnClientChapterStarted |
public virtual |
String |
Gets or sets the JavaScript function to call when the chapter-started event is raised. |
| OnClientMarkerReached |
public virtual |
String |
Gets or sets the JavaScript function to call when the marker-reached event is raised. |
| OnClientMediaEnded |
public virtual |
String |
Gets or sets the JavaScript function to call when the media-ended event is raised. |
| OnClientMediaFailed |
public virtual |
String |
Gets or sets the JavaScript function to call when the media-failed event is raised. |
| OnClientMediaOpened |
public virtual |
String |
Gets or sets the JavaScript function to call when the media-opened event is raised. |
| OnClientStateChanged |
public virtual |
String |
Gets or sets the JavaScript function to call when the state of the media file has changed,
such as from play to stop or from play to pause. |
| OnClientVolumeChanged |
public virtual |
String |
Gets or sets the JavaScript function to call when the volume is modified. |
| DefaultClientType |
public |
String |
Overridden. The default value is Sys.Preview.UI.Xaml.Media.Player.
See DefaultClientType. |
Provides a way to integrate Silverlight in an ASP.NET Web page. This control inherits
from System.Web.UI.Controls.WebControl, and implements
System.Web.UI.IScriptControl.
<asp:Xaml runat="server"
ClientType="ClientType"
EnableHtmlAccess="true|false"
MaxFramerate="rate"
MinimumSilverlightVersion="version"
SilverlightBackColor="color"
XamlUrl="XamlUrl"
Windowless="true|false"
ScaleMode="None|Zoom|Stretch"
OnClientXamlError="functionName"
OnClientResize="functionName"
OnClientXamlLoaded="functionName"
>
<scripts>
<asp:scriptreference Path="Path" />
</scripts>
</asp:Xaml>
Syntax
Note Overridden members are not defined here.
| Property | Access | Type | Description |
| ClientType |
public virtual |
String |
Gets or sets the fully qualified type name for the JavaScript object to create and to associate
with the defined XAML. |
| DefaultClientType |
public virtual |
String |
Gets a reference to the client type that is created by default if ClientType is not specified. In the
Xaml control case this is Sys.Preview.UI.Xaml |
| MaxFramerate |
public virtual |
Integer |
Gets or sets the frame rate for media within the XAML. |
| MinimumSilverlightVersion |
public virtual |
String |
Gets or sets the minimum version of the Silverlight host required for the XAML and its associated code. |
| OnClientResize |
public virtual |
String |
Gets or sets the name of the client JavaScript function (handler) that is called when the Silverlight host is resized. |
| OnClientXamlError |
public virtual |
String |
Gets or sets the name of the client JavaScript function (handler) that is called if errors occur when the XAML is loaded
or if a run-time error occurs. |
| OnClientXamlLoaded |
public virtual |
String |
Gets or sets the name of the client JavaScript function (handler) that is called when the associated XAML is loaded. |
| ScaleMode |
public virtual |
ScaleMode |
Gets or sets the scale mode for the XAML in the player using one of the following values:
ScaleMode.Stretch. The XAML fills the
available space.
ScaleMode.Zoom. The XAML fills the specified size, but maintains aspect ratio.
ScaleMode.None. The XAML retains its original size.
The default is ScaleMode.None.
|
| Scripts |
public |
ScriptReferenceCollection |
Gets a collection of script references. You can define the collection declaratively
or programmatically. The collection contains references to the JavaScript
file that contains the definition of the ClientType class that will
be created and associated with the Silverlight host. |
| SilverlightBackColor |
public |
Color |
Gets or sets the Color value to set for the Silverlight host background. |
| Windowless |
public virtual |
Boolean |
Gets or sets a value to indicate whether the Silverlight host is in a Windowless state. The default is false. |
| XamlUrl |
public virtual |
String |
Gets or sets the URL (relative, absolute, or application-relative) to the XAML file to load into
the Silverlight host. |
| Method | Parameters | Return type | Description |
| protected virtual IEnumerable<ScriptDescriptor> GetScriptDescriptors() |
None |
IEnumerable |
Returns a list of script descriptors that individually define a JavaScript type
to create and initialize, and the type's parameters. |
| protected virtual IEnumerable<ScriptReference> GetScriptReferences() |
None |
IEnumerable |
Returns a list of script references that define a reference to a JavaScript library. |
| protected virtual Dictionary<string, string> GetSilverlightHostParameters() |
None |
Dictionary |
Returns a dictionary of name/value pairs for parameters to define for the Silverlight host. |
|