Freigeben über


PlayToReceiver.NotifyPlaying Methode

Definition

Benachrichtigt den Wiedergabeempfänger, dass die Audio- oder Videowiedergabe gestartet wurde.

public:
 virtual void NotifyPlaying() = NotifyPlaying;
void NotifyPlaying();
public void NotifyPlaying();
function notifyPlaying()
Public Sub NotifyPlaying ()

Windows-Anforderungen

App-Funktionen
privateNetworkClientServer

Hinweise

Ein Beispiel zum Erstellen eines Softwarewiedergabeempfängers finden Sie unter Medienumwandlung.

void VideoPlayer_CurrentStateChanged(object sender, RoutedEventArgs e)
{
    if (receiver != null)
    {
        switch (VideoPlayer.CurrentState)
        {
            case MediaElementState.Playing:
                receiver.NotifyPlaying();
                break;
            case MediaElementState.Paused:
                receiver.NotifyPaused();
                break;
            case MediaElementState.Stopped:
                receiver.NotifyStopped();
                break;
        }
    }
}

void VideoPlayer_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
    if (receiver != null) { receiver.NotifyError(); }
}
Sub VideoPlayer_CurrentStateChanged()

    If receiver IsNot Nothing Then
        Select Case VideoPlayer.CurrentState
            Case MediaElementState.Playing
                receiver.NotifyPlaying()
            Case MediaElementState.Paused
                receiver.NotifyPaused()
            Case MediaElementState.Stopped
                receiver.NotifyStopped()
        End Select
    End If
End Sub

Sub VideoPlayer_MediaFailed()
    If receiver IsNot Nothing Then receiver.NotifyError()
End Sub

Gilt für:

Weitere Informationen