PlayToManager.DefaultSourceSelection 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
啟用或停用 [播放至] 的預設來源選取範圍。
public:
property bool DefaultSourceSelection { bool get(); void set(bool value); };
/// [get: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [set: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
bool DefaultSourceSelection();
void DefaultSourceSelection(bool value);
/// [get: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
bool DefaultSourceSelection();
void DefaultSourceSelection(bool value);
public bool DefaultSourceSelection { [Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; [Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] set; }
public bool DefaultSourceSelection { [Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; [Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] set; }
var boolean = playToManager.defaultSourceSelection;
playToManager.defaultSourceSelection = boolean;
Public Property DefaultSourceSelection As Boolean
屬性值
Boolean
bool
True 是表示 啟用預設來源選取;否則為 false。 預設值是 true。
- 屬性
備註
包含媒體元素的應用程式預設會啟用 [播放至]。 如果使用者在執行應用程式時叫用 [裝置 ] 常用鍵,並選取要串流媒體的目標裝置,則 [播放到] 會從目前頁面上的第一個音訊、視訊或影像元素串流媒體。 您可以將 DefaultSourceSelection 屬性設定為 false,以停用此預設行為。
var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView();
ptm.defaultSourceSelection = false;
您可以在 HTML 標記中新增 -ms-playToDisabled 屬性,以排除預設的 Play To 行為中的個別 HTML 元素。
<video src="http://www.example.com/videos/video.mp4" x-ms-playToDisabled/>