PlayToReceiver.NotifyPlaying 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
通知“播放到”接收器音频或视频播放已开始。
public:
virtual void NotifyPlaying() = NotifyPlaying;
void NotifyPlaying();
public void NotifyPlaying();
function notifyPlaying()
Public Sub NotifyPlaying ()
Windows 要求
应用功能 |
privateNetworkClientServer
|
注解
有关创建软件“播放到”接收器的示例,请参阅 媒体转换。
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