PlayToManager.SourceRequested 事件

定义

当用户请求媒体流式传输到“播放到”目标设备时发生。

/// [add: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [remove: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
// Register
event_token SourceRequested(TypedEventHandler<PlayToManager, PlayToSourceRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void SourceRequested(event_token const* cookie) const;

// Revoke with event_revoker
PlayToManager::SourceRequested_revoker SourceRequested(auto_revoke_t, TypedEventHandler<PlayToManager, PlayToSourceRequestedEventArgs const&> const& handler) const;
/// [add: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [remove: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
// Register
event_token SourceRequested(TypedEventHandler<PlayToManager, PlayToSourceRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void SourceRequested(event_token const* cookie) const;

// Revoke with event_revoker
PlayToManager::SourceRequested_revoker SourceRequested(auto_revoke_t, TypedEventHandler<PlayToManager, PlayToSourceRequestedEventArgs const&> const& handler) const;
[add: 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))]
[remove: 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))]
public event TypedEventHandler<PlayToManager,PlayToSourceRequestedEventArgs> SourceRequested;
[add: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
[remove: Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public event TypedEventHandler<PlayToManager,PlayToSourceRequestedEventArgs> SourceRequested;
function onSourceRequested(eventArgs) { /* Your code */ }
playToManager.addEventListener("sourcerequested", onSourceRequested);
playToManager.removeEventListener("sourcerequested", onSourceRequested);
- or -
playToManager.onsourcerequested = onSourceRequested;
Public Custom Event SourceRequested As TypedEventHandler(Of PlayToManager, PlayToSourceRequestedEventArgs) 

事件类型

属性

注解

当用户在启用了“播放到–”的应用程序中选择“设备”超级按钮时,将触发 SourceRequested 事件。 提供音频、视频或图像,播放到将在 SourceRequested 事件期间流式传输到目标设备。

如果在 200 毫秒内未提供媒体源, SourceRequested 事件将超时,并且“设备”超级按钮不会显示应用的任何“播放到”目标。

在用户选择目标设备之前发生 SourceRequested 事件。 用户选择目标设备后,将触发 SourceSelected 事件。 如果用户在未选择目标设备的情况下退出“ 设备 ”超级按钮,则不会触发 SourceSelected 事件。

适用于

另请参阅