July 28, 2014
Gets or sets a media source on the MediaElement.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
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.
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.
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 (/).
If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.
Windows Phone 8, Windows Phone OS 7.1
For more info, see App capabilities and hardware requirements for Windows Phone 8.