PlayToReceiver.NotifyDurationChange(TimeSpan) 方法

定义

通知“播放到”接收器音频或视频播放的持续时间已更改。

public:
 virtual void NotifyDurationChange(TimeSpan duration) = NotifyDurationChange;
void NotifyDurationChange(TimeSpan const& duration);
public void NotifyDurationChange(System.TimeSpan duration);
function notifyDurationChange(duration)
Public Sub NotifyDurationChange (duration As TimeSpan)

参数

duration
TimeSpan TimeSpan

音频或视频媒体的新持续时间。

Windows 要求

应用功能
privateNetworkClientServer

注解

有关创建软件“播放到”接收器的示例,请参阅 媒体强制转换

void VideoPlayer_MediaOpened(object sender, RoutedEventArgs e)
{
    if (receiver != null)
    {
        receiver.NotifyDurationChange(VideoPlayer.NaturalDuration.TimeSpan);
        receiver.NotifyLoadedMetadata();
    }
}
Sub VideoPlayer_MediaOpened()
    If receiver IsNot Nothing Then
        receiver.NotifyDurationChange(VideoPlayer.NaturalDuration.TimeSpan)
        receiver.NotifyLoadedMetadata()
    End If
End Sub

适用于

另请参阅