MediaElement.PlayToPreferredSourceUri 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
注意
PlayToPreferredSourceUri 已被取代。 相反地,呼叫 MediaElement.GetAsCastingSource ,並在傳回的值上呼叫 CastingSource.PreferredSourceUri。
取得或設定慣用媒體來源的路徑,讓 Play To 目標裝置能夠串流媒體內容,該內容可以受到 DRM 保護,例如雲端媒體伺服器。
public:
property Uri ^ PlayToPreferredSourceUri { Uri ^ get(); void set(Uri ^ value); };
/// [get: Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [set: Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
Uri PlayToPreferredSourceUri();
void PlayToPreferredSourceUri(Uri value);
/// [get: Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
Uri PlayToPreferredSourceUri();
void PlayToPreferredSourceUri(Uri value);
public System.Uri PlayToPreferredSourceUri { [Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; [Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] set; }
public System.Uri PlayToPreferredSourceUri { [Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; [Windows.Foundation.Metadata.Deprecated("PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] set; }
var uri = mediaElement.playToPreferredSourceUri;
mediaElement.playToPreferredSourceUri = uri;
Public Property PlayToPreferredSourceUri As Uri
<MediaElement PlayToPreferredSourceUri="uri" />
屬性值
慣用媒體來源的路徑。
- 屬性
範例
以下是一些程式碼,示範如何依參考設定 Play To。
<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");
auto video = ref new Windows::UI::Xaml::Controls::MediaElement();
video->Source =
ref new Windows::Foundation::Uri("http://www.contoso.com/videos/video.mp4");
video->PlayToPreferredSourceUri =
ref new Windows::Foundation::Uri("http://www.contoso.com/catalogid=1234");
備註
PlayToSource.PreferredSourceUri 會依參考啟用 Play To。 這可讓播放至目標裝置上的串流內容來自不同位置,例如雲端媒體伺服器。 這可讓網頁和 UWP 應用程式播放數位版權管理 (DRM) 受保護的內容。 應用程式會指定慣用的統一資源識別項 (URI) ,該 URI 會傳送至播放目標裝置。 此統一資源識別項 (URI) 可以指向雲端式媒體伺服器。 如果 PlayToSource.PreferredSourceUri 值存在,Play To 目標裝置可以直接從雲端串流內容,這可以是 Digital Rights Management (DRM) 受保護,而不是從 Windows 電腦串流內容,而該電腦必須是未保護的內容。
將正斜線 (「/」) 附加至統一資源識別項 (URI) 字串,當透過網路傳送至播放至裝置時。 這是為了符合統一資源識別元 (URI) 標準。