PlayToManager.DefaultSourceSelection 属性

定义

启用或禁用“播放到”的默认源选择。

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 属性,可以从默认的“播放到”行为中排除单个 HTML 元素。

<video src="http://www.example.com/videos/video.mp4" x-ms-playToDisabled/>

适用于

另请参阅