MediaPlayer..::.MediaSource Property
This page is specific to:Microsoft Version:Silverlight 3
.NET Framework Class Library for Silverlight
MediaPlayer..::.MediaSource Property

Gets or sets the media file for the MediaPlayer.

Namespace:  System.Web.UI.SilverlightControls
Assembly:  System.Web.Silverlight (in System.Web.Silverlight.dll)
Syntax

'Usage

Dim instance As MediaPlayer
Dim value As String

value = instance.MediaSource

instance.MediaSource = value

'Declaration

<BindableAttribute(True)> _
<ThemeableAttribute(True)> _
Public Overridable Property MediaSource As String
    Get
    Set

Property Value

Type: System..::.String
A string that specifies the media for the MediaPlayer control.
Remarks

The MediaSource property can be specified as a Uniform Resource Identifier (URI).

The media source can be of any type that is supported by Silverlight, which includes .wma, .wmv, .mp3, and .asx. For more information about the media types supported by Silverlight, see Supported Media Formats, Protocols, and Log Fields.

If the MediaSource is set to an .asx file, all media files listed in the file are played in the order they are listed in the file.

The following is an example of an .asx playlist file.

<ASX version = "3.0">
  <TITLE>Sample Playlist</TITLE>
  <ENTRY>
    <TITLE>Halo Video</TITLE>
    <REF href="halo.wmv" />
  </ENTRY>
  <ENTRY>
    <TITLE>Expression Studio Video</TITLE>
    <REF href="expression.wmv" />
  </ENTRY>
</ASX>

If the MediaDefinition is set to a media definition file that has a mediaSource element, that file takes precedence over the media file indicated by the MediaSource property.

For more information about creating client playlists, see ASP.NET MediaPlayer Server Control.

Examples

The following example demonstrates how to set the MediaSource property of the MediaPlayer class.

        MediaPlayer1.MediaSource = DropDownList1.SelectedValue.ToString()

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View