Compartir a través de


PlayToSourceRequestedEventArgs Clase

Definición

Proporciona información sobre el evento SourceRequested .

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
Herencia
Object Platform::Object IInspectable PlayToSourceRequestedEventArgs
Atributos

Requisitos de Windows

Familia de dispositivos
Windows 10 (se introdujo en la versión 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (se introdujo en la versión v1.0)

Ejemplos

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

Comentarios

La propiedad SourceRequest de la clase se usa para pasar elementos multimedia de la aplicación a Reproducir a durante el evento SourceRequested .

Para obtener un ejemplo de cómo usar Play To en una aplicación, consulte DRM de PlayReady.

Propiedades

SourceRequest

Obtiene el objeto multimedia para conectarse a un destino Play To.

Se aplica a

Consulte también