共用方式為


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) 

事件類型

屬性

備註

當使用者在已啟用 Play To– 的應用程式中選取 [裝置] 常用鍵時,就會引發SourceRequested事件。 您可以在 SourceRequested 事件期間提供播放至目標裝置的音訊、視訊或影像。

如果您未在 200 毫秒內提供媒體來源, SourceRequested 事件將會逾時,且 [裝置] 常用鍵不會顯示您 app 的任何 [播放目標] 目標。

SourceRequested 事件發生於用戶選取目標裝置之前。 用戶選取目標裝置之後,就會引發 SourceSelected 事件。 如果使用者在未選取目標裝置的情況下結束 [裝置 ] 常用鍵,就不會引發 SourceSelected 事件。

適用於

另請參閱