Dela via


PlayToManager.SourceRequested Event

Definition

Occurs when a user requests media to stream to a Play To target device.

/// [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) 

Event Type

Attributes

Remarks

The SourceRequested event is fired when a user selects the Devices charm in a Play To– enabled application. You supply the audio, video, or image that Play To will stream to a target device during the SourceRequested event.

If you do not supply a media source within 200 milliseconds, the SourceRequested event will time out and the Devices charm will not display any Play To targets for your app.

The SourceRequested event occurs before the user selects the target device. After the user has selected the target device, the SourceSelected event is fired. If the user exits the Devices charm without selecting a target device, the SourceSelected event isn't fired.

Applies to

See also