Gets or sets a media source on the MediaElement.
Assembly: System.Windows (in System.Windows.dll)
Dependency property identifier field: SourceProperty
Setting the will reset the media's Position to 00:00:00.
The string provided for the property is interpreted as a Uniform Resource Identifier (URI). This is in contrast to an Internationalized Resource Identifier (IRI). This distinction means that characters used to identify a that are outside of US-ASCII will need to be encoded.
Relative references are permitted. For more information on how relative references are evaluated, see Resource Files.
Cross-domain URIs are permitted (using http). You can also use the monikers mms:, rtsp:, or rtspt: in your URI to point to a media source. In each case the actual protocol and URI scheme falls back to http (with possible further fallbacks in behavior for differentiating streaming from progressive downloads), but the value of will retain your moniker regardless of the runtime resolution of the URI.
By using the SetSource method instead of setting directly, you can download content as a package and access parts from within the package. For details on downloading resources such as media as streams, with ability to access parts of a package, see Downloading Content on Demand.
You can specify an initial value of "" (empty string) in your XAML MediaElement object element, and then set the value in code at a later time. This creates a non-playing placeholder MediaElement that you could later set a specific for in response to a user choice.
The MediaFailed event can occur if the initial attribute value in XAML does not specify a valid source.
Setting a cross-domain URI for will either succeed or will not return a valid status for any failure. In this case, a MediaFailed event does not occur.
Backslashes (\) in URIs are not permitted; always use forward slashes (/).
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.