Windows desktop applications
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MediaElement.PlayToPreferredSourceUri property

[ Updated for UWP apps on Windows 10. For Windows 8.x articles, see the archive ]

Gets or sets the path to the preferred media source which enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.

Syntax


public Uri PlayToPreferredSourceUri { get; set; }


<MediaElement PlayToPreferredSourceUri="uri" />

Property value

Type: System.Uri [.NET] | Windows::Foundation::Uri [C++]

The path to the preferred media source.

Remarks

PlayToSource.PreferredSourceUri enables Play To by reference. This allows streaming content on the Play To target device from a different location, such as a cloud media server. This enables web pages and Windows Store apps to play Digital Rights Management (DRM) protected content. The app specifies a preferred Uniform Resource Identifier (URI) that will be sent to the Play To target device. This URI can point to a cloud based media server. If the PlayToSource.PreferredSourceUri value is present, the Play To target device can stream content directly from the cloud, which can be DRM protected, instead of streaming content from the Windows machine which must be unprotected content.

A forward slash ("/") is appended to the URI string when it is sent over the network to a Play To device. This is done to conform to URI standards.

Examples

Here is some code that shows how to set up Play To by reference.


<MediaElement Source="http://www.contoso.com/videos/video.mp4" 
   PlayToPreferredSourceUri="http://www.contoso.com/catalogid=1234">
</MediaElement>


MediaElement video = new MediaElement();

video.Source = 
    new Uri("http://www.contoso.com/videos/video.mp4");

video.PlayToPreferredSourceUri = 
    new Uri("http://www.contoso.com/catalogid=1234"); 

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

MediaElement

 

 

Show:
© 2016 Microsoft