共用方式為


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

適用於

另請參閱