PlayToSourceRequestedEventArgs Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Stellt Informationen zum SourceRequested-Ereignis bereit .
public ref class PlayToSourceRequestedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("PlayToSourceRequestedEventArgs may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PlayToSourceRequestedEventArgs final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Deprecated("PlayToSourceRequestedEventArgs may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
class PlayToSourceRequestedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("PlayToSourceRequestedEventArgs may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PlayToSourceRequestedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Deprecated("PlayToSourceRequestedEventArgs may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class PlayToSourceRequestedEventArgs
Public NotInheritable Class PlayToSourceRequestedEventArgs
- Vererbung
- Attribute
Windows-Anforderungen
Gerätefamilie |
Windows 10 (eingeführt in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (eingeführt in v1.0)
|
Beispiele
// Play To Contract
private Windows.Media.PlayTo.PlayToManager ptm =
Windows.Media.PlayTo.PlayToManager.GetForCurrentView();
protected override void OnNavigatedTo(NavigationEventArgs e)
{
ptm.SourceRequested += sourceRequestHandler;
}
private void sourceRequestHandler(
Windows.Media.PlayTo.PlayToManager sender,
Windows.Media.PlayTo.PlayToSourceRequestedEventArgs e)
{
try
{
e.SourceRequest.SetSource(mediaElement.PlayToSource);
}
catch (Exception ex)
{
messageBlock.Text += "Exception encountered: " + ex.Message + "\n";
}
}
' Play To Contract
Private ptm As Windows.Media.PlayTo.PlayToManager =
Windows.Media.PlayTo.PlayToManager.GetForCurrentView()
Protected Overrides Sub OnNavigatedTo(e As Navigation.NavigationEventArgs)
AddHandler ptm.SourceRequested, AddressOf sourceRequestHandler
End Sub
Private Sub sourceRequestHandler(
sender As Windows.Media.PlayTo.PlayToManager,
e As Windows.Media.PlayTo.PlayToSourceRequestedEventArgs)
Try
e.SourceRequest.SetSource(mediaElement.PlayToSource)
Catch ex As Exception
messageBlock.Text &= "Exception encountered: " & ex.Message & vbCrLf
End Try
End Sub
Hinweise
Sie verwenden die SourceRequest-Eigenschaft der -Klasse, um Medien aus Ihrer Anwendung während des SourceRequested-Ereignisses an Play To zu übergeben.
Ein Beispiel für die Verwendung von Play To in einer Anwendung finden Sie unter PlayReady DRM.
Eigenschaften
SourceRequest |
Ruft das Medienobjekt ab, das eine Verbindung mit einem Wiedergabeziel herstellen soll. |